diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/CycleGearbox.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/CycleGearbox.cs index 3274a5a568143d798bfe50d86e5464bf48064890..fa2ee45207fced4419840963378a1d85a657362f 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/CycleGearbox.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/CycleGearbox.cs @@ -426,7 +426,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var nextGear = 0u; var torqueConverterLocked = true; foreach (var entry in future) { - if (entry.WheelAngularVelocity.IsEqual(0)) { + if (entry.VehicleTargetSpeed != null && entry.VehicleTargetSpeed.IsEqual(0)) { + // vehicle is stopped, no next gear, engine should go to idle + break; + } + if (entry.WheelAngularVelocity != null && entry.WheelAngularVelocity.IsEqual(0)) { // vehicle is stopped, no next gear, engine should go to idle break; } diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/PowertrainDrivingCycle.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/PowertrainDrivingCycle.cs index 35f5b42270eb617a8b78cff5f437c1e75e36d641..62e0102d0b4c53b8221374c4b245884e59f078c0 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/PowertrainDrivingCycle.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/PowertrainDrivingCycle.cs @@ -88,7 +88,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl public virtual IResponse Request(Second absTime, Second dt) { // cycle finished (no more entries in cycle) - if (CycleIterator.LastEntry) { + if (CycleIterator.LastEntry && CycleIterator.RightSample.Time == absTime) { return new ResponseCycleFinished { Source = this }; } diff --git a/VectoCore/VectoCoreTest/VectoCoreTest.csproj b/VectoCore/VectoCoreTest/VectoCoreTest.csproj index 481c9329ebff5e3fee39df1b9c30d82a19c5039c..30e21b6b0e7ab2fc1f829ca1d485d4c2f3e3261e 100644 --- a/VectoCore/VectoCoreTest/VectoCoreTest.csproj +++ b/VectoCore/VectoCoreTest/VectoCoreTest.csproj @@ -1279,6 +1279,9 @@ <None Include="TestData\MeasuredSpeed\GearboxSerial.vgbx"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> + <None Include="TestData\MeasuredSpeed\Gearbox_TractionInterruption.vgbx"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> <None Include="TestData\MeasuredSpeed\Gear_Axle_loss.vtlm"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> @@ -1324,6 +1327,9 @@ <None Include="TestData\MeasuredSpeed\MeasuredSpeedGear_AT-PS.vdri"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> + <None Include="TestData\MeasuredSpeed\MeasuredSpeedGear_TractionInterruption.vecto"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> <None Include="TestData\MeasuredSpeed\MeasuredSpeedVair.vdri"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> @@ -1360,6 +1366,9 @@ <None Include="TestData\MeasuredSpeed\MeasuredSpeed_Gear_Rural_Aux.vdri"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> + <None Include="TestData\MeasuredSpeed\MeasuredSpeed_Gear_Rural_TractionInterruption.vdri"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> <None Include="TestData\MeasuredSpeed\MeasuredSpeed_Gear_Rural_Vair.vdri"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> @@ -1411,6 +1420,12 @@ <None Include="TestData\MeasuredSpeed\Results\MeasuredSpeedGear_MeasuredSpeed_Gear_Rural.vmod"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> + <None Include="TestData\MeasuredSpeed\Results\MeasuredSpeedGear_TractionInterruption.vsum"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\MeasuredSpeed\Results\MeasuredSpeedGear_TractionInterruption_MeasuredSpeed_Gear_Rural_TractionInterruption.vmod"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> <None Include="TestData\MeasuredSpeed\Results\MeasuredSpeedVair.vsum"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None>