diff --git a/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationVTPModeVectoRunDataFactory.cs b/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationVTPModeVectoRunDataFactory.cs index e48d99ed431b8cf40f66cbfeff000d3fb444bb56..9085820a837105e508578cba50f993d5cd15b3f8 100644 --- a/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationVTPModeVectoRunDataFactory.cs +++ b/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationVTPModeVectoRunDataFactory.cs @@ -219,8 +219,11 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl vtpRunData.VTPData = new VTPData() { CorrectionFactor = mileageCorrection, }; + + vtpRunData.TorqueDriftLeftWheel = JobInputData.TorqueDriftLeftWheel; + vtpRunData.TorqueDriftRightWheel = JobInputData.TorqueDriftRightWheel; + yield return vtpRunData; - } public IInputDataProvider DataProvider { get; } diff --git a/VectoCore/VectoCore/Models/Simulation/Data/VectoRunData.cs b/VectoCore/VectoCore/Models/Simulation/Data/VectoRunData.cs index a35fc933a3f3b7011941c990074b724e185c5248..7bfd6cd6cc2a03593fb50ae6b823b961ca6fff8b 100644 --- a/VectoCore/VectoCore/Models/Simulation/Data/VectoRunData.cs +++ b/VectoCore/VectoCore/Models/Simulation/Data/VectoRunData.cs @@ -138,6 +138,10 @@ namespace TUGraz.VectoCore.Models.Simulation.Data public Watt ElectricAuxDemand { get; internal set; } + public NewtonMeter TorqueDriftLeftWheel { get; internal set; } + + public NewtonMeter TorqueDriftRightWheel { get; internal set; } + public class AuxData { // ReSharper disable once InconsistentNaming diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/VTPCycle.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/VTPCycle.cs index ceaefb2c19272463deb5f71589c494ddff1a8685..94f4e96f8c0ff34e5ff099184b6a3f379fba53af 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/VTPCycle.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/VTPCycle.cs @@ -65,7 +65,15 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl protected internal void PrepareCycleData() { + Second timeDriftZero = Data.Entries.First().Time; + Second timeDriftCheck = Data.Entries.Last().Time; + foreach (var entry in Data.Entries) { + var timeFactor = (entry.Time - timeDriftZero) / (timeDriftCheck - timeDriftZero); + + entry.TorqueWheelLeft = entry.TorqueWheelLeft - (RunData.TorqueDriftLeftWheel * timeFactor); + entry.TorqueWheelRight = entry.TorqueWheelRight - (RunData.TorqueDriftRightWheel * timeFactor); + var wheelSpeed = (entry.WheelSpeedLeft + entry.WheelSpeedRight) / 2; var wheelPower = entry.TorqueWheelLeft * entry.WheelSpeedLeft + entry.TorqueWheelRight * entry.WheelSpeedRight; entry.PWheel = wheelPower;