From f3af9262ea58fca20644d6aa6e92205f11361678 Mon Sep 17 00:00:00 2001
From: Markus Quaritsch <markus.quaritsch@tugraz.at>
Date: Wed, 26 Feb 2020 16:50:42 +0100
Subject: [PATCH] bugfix medium lorry vtp: use mission dependent whtc
 correction factors (LH for heavy lorries, RD for medium lorries)

---
 .../Reader/Impl/DeclarationVTPModeVectoRunDataFactory.cs   | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationVTPModeVectoRunDataFactory.cs b/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationVTPModeVectoRunDataFactory.cs
index ae81e4e071..6dda74fa9d 100644
--- a/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationVTPModeVectoRunDataFactory.cs
+++ b/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationVTPModeVectoRunDataFactory.cs
@@ -128,12 +128,17 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl
 			var tempVehicle = Dao.CreateVehicleData(
 				vehicle, Segment.Missions.First(),
 				Segment.Missions.First().Loadings.First());
+
+			var vtpMission = Segment.VehicleClass.IsMediumLorry()
+				? DeclarationData.VTPMode.SelectedMissionMediumLorry
+				: DeclarationData.VTPMode.SelectedMissionHeavyLorry;
+
 			AirdragData = Dao.CreateAirdragData(
 				vehicle.Components.AirdragInputData,
 				Segment.Missions.First(), Segment);
 			EngineData = Dao.CreateEngineData(
 				vehicle, vehicle.Components.EngineInputData.EngineModes.First(),
-				new Mission() { MissionType = MissionType.LongHaul });
+				new Mission() { MissionType = vtpMission });
 			AxlegearData = JobInputData.Vehicle.Components.GearboxInputData.DifferentialIncluded
 				? Dao.CreateDummyAxleGearData(JobInputData.Vehicle.Components.GearboxInputData)
 				: Dao.CreateAxleGearData(vehicle.Components.AxleGearInputData);
-- 
GitLab