diff --git a/VectoCore/VectoCore/InputData/Reader/DrivingCycleDataReader.cs b/VectoCore/VectoCore/InputData/Reader/DrivingCycleDataReader.cs index 0648c6303620a77e4190d84a14b86424162b3860..d657149c2ef2b385407ace2da920f453ecf08b92 100644 --- a/VectoCore/VectoCore/InputData/Reader/DrivingCycleDataReader.cs +++ b/VectoCore/VectoCore/InputData/Reader/DrivingCycleDataReader.cs @@ -242,7 +242,7 @@ namespace TUGraz.VectoCore.InputData.Reader // vehicle stops. duplicate current distance entry with 0 waiting time var tmp = new DrivingCycleData.DrivingCycleEntry(entry) { StoppingTime = 0.SI<Second>(), - PTOActive = PTOActivity.Inactive, + PTOActive = entry.PTOActive, RoadGradient = entry.RoadGradient, VehicleTargetSpeed = i < entries.Count - 1 ? entries[i + 1].VehicleTargetSpeed : 0.SI<MeterPerSecond>() }; diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/RoadSweeperAuxiliary.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/RoadSweeperAuxiliary.cs index 22d01ea0f8c2fbe373a0f53a9a5aa6919c0ed64d..f70467680d8b715e7c50c778a50309db8d2077f6 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/RoadSweeperAuxiliary.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/RoadSweeperAuxiliary.cs @@ -28,8 +28,10 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var powerDemand = 0.SI<Watt>(); if (left.PTOActive == PTOActivity.PTOActivityRoadSweeping) { - // todo: iterate over cycle from left to right and compute pto energy and then average power demand - powerDemand = left.PTOPowerDemandDuringDrive; + var right = DataBus.CycleData.RightSample; + powerDemand = (left.Distance - right.Distance).IsEqual(0) ? left.PTOPowerDemandDuringDrive : + VectoMath.Interpolate( + left.Distance, right.Distance, left.PTOPowerDemandDuringDrive, right.PTOPowerDemandDuringDrive, DataBus.Distance); } return powerDemand;