diff --git a/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationVTPModeVectoRunDataFactory.cs b/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationVTPModeVectoRunDataFactory.cs index f8f5e6738888d3807a9f576c23f2975fb0b0710e..d85f808baa5334028191ab1d4799d478169f3af0 100644 --- a/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationVTPModeVectoRunDataFactory.cs +++ b/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationVTPModeVectoRunDataFactory.cs @@ -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); diff --git a/VectoCore/VectoCore/OutputData/XML/XMLVTPReport.cs b/VectoCore/VectoCore/OutputData/XML/XMLVTPReport.cs index a9873b1113ffcef76fd3678cfdd6d1dcd2cc74d3..709aac33b19d87d9499f96d5bc3819c7e9c72b70 100644 --- a/VectoCore/VectoCore/OutputData/XML/XMLVTPReport.cs +++ b/VectoCore/VectoCore/OutputData/XML/XMLVTPReport.cs @@ -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"),