diff --git a/VECTO/GUI/VectoJobForm.vb b/VECTO/GUI/VectoJobForm.vb index 8de0045c8c8e611310b762898a43dbb1d61eb44e..2a1ffb8d412bddc3c08cb27b145476d1e3139c4e 100644 --- a/VECTO/GUI/VectoJobForm.vb +++ b/VECTO/GUI/VectoJobForm.vb @@ -484,7 +484,7 @@ Public Class VectoJobForm Else TbENG.Text = "" End If - If (JobType <> VectoSimulationJobType.BatteryElectricVehicle AndAlso inputData.JobInputData.Vehicle.Components.GearboxInputData IsNot Nothing) Then + If (JobType <> VectoSimulationJobType.BatteryElectricVehicle orelse inputData.JobInputData.Vehicle.Components.GearboxInputData IsNot Nothing) Then TbGBX.Text = GetRelativePath(inputData.JobInputData.Vehicle.Components.GearboxInputData.DataSource.SourceFile, _basePath) Else TbGBX.Text = "" diff --git a/VectoCore/VectoCore/Models/Simulation/Impl/PCCEcoRollEngineStopPreprocessor.cs b/VectoCore/VectoCore/Models/Simulation/Impl/PCCEcoRollEngineStopPreprocessor.cs index d2b1379ec1550d6139d663c702fa8d296f6cc1eb..1b6c4c75fbfd4bd1b5210f1c1a66119c29697cbc 100644 --- a/VectoCore/VectoCore/Models/Simulation/Impl/PCCEcoRollEngineStopPreprocessor.cs +++ b/VectoCore/VectoCore/Models/Simulation/Impl/PCCEcoRollEngineStopPreprocessor.cs @@ -125,7 +125,9 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl var gradient = 0.SI<Radian>(); foreach (var motor in container.ElectricMotors.Values) { - ((motor as ElectricMotor).Control as DummyElectricMotorControl).EmTorque = null; + if ((motor as ElectricMotor).Control is DummyElectricMotorControl emCtl) { + emCtl.EmTorque = null; + } } var initialResponse = vehicle.Request(absTime, simulationInterval, acceleration, gradient); diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs index bf6b18be3ee04aca6f676ecdf06c0210f97d0f6d..be24cb9f28815d4f5e10dd37d01eace0f9d4e930 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs @@ -114,13 +114,25 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl if (ADAS.PredictiveCruiseControl != PredictiveCruiseControlType.None) { // create a dummy powertrain for pre-processing and estimations var testContainer = new SimplePowertrainContainer(data); - if (data.JobType != VectoSimulationJobType.BatteryElectricVehicle && data.JobType != VectoSimulationJobType.SerialHybridVehicle && - data.JobType != VectoSimulationJobType.IEPC_E && data.JobType != VectoSimulationJobType.IEPC_S) - PowertrainBuilder.BuildSimplePowertrain(data, testContainer); - else { - PowertrainBuilder.BuildSimplePowertrainElectric(data, testContainer); - } + switch (data.JobType) { + case VectoSimulationJobType.BatteryElectricVehicle: + case VectoSimulationJobType.SerialHybridVehicle: + case VectoSimulationJobType.IEPC_E: + case VectoSimulationJobType.IEPC_S: + PowertrainBuilder.BuildSimplePowertrainElectric(data, testContainer); + break; + case VectoSimulationJobType.IHPC: + case VectoSimulationJobType.ParallelHybridVehicle: + PowertrainBuilder.BuildSimpleHybridPowertrain(data, testContainer); + break; + case VectoSimulationJobType.ConventionalVehicle: + PowertrainBuilder.BuildSimplePowertrain(data, testContainer); + break; + default: + throw new ArgumentOutOfRangeException(nameof(data.JobType)); + } + container.AddPreprocessor(new PCCSegmentPreprocessor(testContainer, PCCSegments, data?.DriverData.PCC)); } }