Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 0da3a6b9 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

use first mission as reference for VTP simulation

parent 0813f2bc
No related branches found
No related tags found
No related merge requests found
......@@ -164,9 +164,9 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl
}
// simulate the LongHaul cycle with RefLoad
var mission = Segment.Missions.FirstOrDefault(m => m.MissionType == DeclarationData.VTPMode.SelectedMission);
var mission = Segment.Missions.FirstOrDefault();
if (mission == null) {
throw new VectoException("Mission {0} not found in segmentation matrix", DeclarationData.VTPMode.SelectedMission);
throw new VectoException("No Mission found in segmentation matrix");
}
var loading = mission.Loadings.FirstOrDefault(l => l.Key == DeclarationData.VTPMode.SelectedLoading);
var runData = CreateVectoRunData(Segment, mission, loading.Value);
......
......@@ -181,9 +181,9 @@ namespace TUGraz.VectoCore.OutputData.XML
var vtpResult = Missions.FirstOrDefault(x => x.Key == MissionType.VerificationTest).Value.ResultEntry
.FirstOrDefault().Value;
const MissionType selectedMission = DeclarationData.VTPMode.SelectedMission;
//const MissionType selectedMission = DeclarationData.VTPMode.SelectedMission;
const LoadingType selectedLoading = DeclarationData.VTPMode.SelectedLoading;
var result = Missions.FirstOrDefault(x => x.Key == selectedMission).Value.ResultEntry
var result = Missions.FirstOrDefault(x => x.Key != MissionType.VerificationTest).Value.ResultEntry
.FirstOrDefault(x => x.Key == selectedLoading).Value;
var vtpFcMeasured = vtpResult.VTPFcMeasured / vtpResult.VTPWorkPWheelPos;
var vtpFcMeasuredCorr = vtpResult.VTPFcMeasured / vtpResult.VTPWorkPWheelPos * vtpResult.VTPFcCorrectionFactor;
......@@ -223,7 +223,7 @@ namespace TUGraz.VectoCore.OutputData.XML
tns + "CO2",
new XElement(
tns + "Mission",
string.Format("{0}, {1}", selectedMission.ToXMLFormat(), selectedLoading.ToString())
string.Format("{0}, {1}", Missions.FirstOrDefault(x => x.Key != MissionType.VerificationTest).Key.ToXMLFormat(), selectedLoading.ToString())
),
new XElement(
tns + "Declared", new XAttribute(XMLNames.Report_Results_Unit_Attr, "g/t-km"),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment