diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs index f1db349ead16c64d448b56d100b4e8210296dccc..94d3d8bab43761a9d847a0d2bfc625887494c983 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs @@ -37,6 +37,7 @@ using TUGraz.VectoCore.Models.Connector.Ports.Impl; using TUGraz.VectoCore.Models.Simulation; using TUGraz.VectoCore.Models.Simulation.Data; using TUGraz.VectoCore.Models.Simulation.DataBus; +using TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox; using TUGraz.VectoCore.OutputData; using TUGraz.VectoCore.Utils; @@ -180,20 +181,46 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl _engageTime = absTime + dt; } + if (ClutchClosed(absTime) && Disengaged && !outAngularVelocity.IsEqual(0)) { + ReEngageGear(absTime, dt, outTorque, outAngularVelocity); + Log.Debug("Gearbox engaged gear {0}", Gear); + } + + var gear = Disengaged ? NextGear.Gear : Gear; + var avgOutAngularVelocity = (PreviousState.OutAngularVelocity + outAngularVelocity) / 2.0; + var inTorqueLossResult = ModelData.Gears[gear].LossMap.GetTorqueLoss(avgOutAngularVelocity, outTorque); + if (avgOutAngularVelocity.IsEqual(0, 1e-9)) { + inTorqueLossResult.Value = 0.SI<NewtonMeter>(); + } + + var inAngularVelocity = outAngularVelocity * ModelData.Gears[gear].Ratio; + var avgInAngularVelocity = (PreviousState.InAngularVelocity + inAngularVelocity) / 2.0; + var inTorque = !avgInAngularVelocity.IsEqual(0) + ? outTorque * (avgOutAngularVelocity / avgInAngularVelocity) + : outTorque / ModelData.Gears[Gear].Ratio; + inTorque += inTorqueLossResult.Value; + //var inTorque = outTorque / ModelData.Gears[gear].Ratio + inTorqueLossResult.Value; + + var inertiaTorqueLossOut = !inAngularVelocity.IsEqual(0) + ? Formulas.InertiaPower(outAngularVelocity, PreviousState.OutAngularVelocity, ModelData.Inertia, dt) / + avgOutAngularVelocity + : 0.SI<NewtonMeter>(); + inTorque += inertiaTorqueLossOut / ModelData.Gears[gear].Ratio; + var halted = DataBus.DrivingAction == DrivingAction.Halt; - var driverDeceleratingNegTorque = DataBus.DriverBehavior == DrivingBehavior.Braking && - (DataBus.BrakePower.IsGreater(0) || outTorque < 0); + var driverDeceleratingNegTorque = DataBus.DriverBehavior == DrivingBehavior.Braking && DataBus.DrivingAction == DrivingAction.Brake && + (DataBus.BrakePower.IsGreater(0) || inTorque.IsSmaller(0)); var vehiclespeedBelowThreshold = DataBus.VehicleSpeed.IsSmaller(Constants.SimulationSettings.ClutchDisengageWhenHaltingSpeed); if (halted || (driverDeceleratingNegTorque && vehiclespeedBelowThreshold)) { _engageTime = VectoMath.Max(_engageTime, absTime + dt); - return RequestGearDisengaged(absTime, dt, outTorque, outAngularVelocity, dryRun); + return RequestGearDisengaged(absTime, dt, outTorque, outAngularVelocity, inTorque, dryRun); } return ClutchClosed(absTime) - ? RequestGearEngaged(absTime, dt, outTorque, outAngularVelocity, dryRun) - : RequestGearDisengaged(absTime, dt, outTorque, outAngularVelocity, dryRun); + ? RequestGearEngaged(absTime, dt, outTorque, outAngularVelocity, inTorque, inTorqueLossResult, inertiaTorqueLossOut, dryRun) + : RequestGearDisengaged(absTime, dt, outTorque, outAngularVelocity, inTorque, dryRun); } /// <summary> @@ -208,7 +235,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl /// <item><term>else</term><description>Response from NextComponent</description></item> /// </list> /// </returns> - private IResponse RequestGearDisengaged(Second absTime, Second dt, NewtonMeter outTorque, PerSecond outAngularVelocity, + private IResponse RequestGearDisengaged(Second absTime, Second dt, NewtonMeter outTorque, PerSecond outAngularVelocity, NewtonMeter inTorque, bool dryRun) { Disengaged = true; @@ -218,19 +245,10 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var gear = NextGear.Gear; - var avgOutAngularVelocity = (PreviousState.OutAngularVelocity + outAngularVelocity) / 2.0; - var inTorqueLossResult = ModelData.Gears[gear].LossMap.GetTorqueLoss(avgOutAngularVelocity, outTorque); - if (avgOutAngularVelocity.IsEqual(0, 1e-9)) { - inTorqueLossResult.Value = 0.SI<NewtonMeter>(); - } - var inTorque = outTorque / ModelData.Gears[gear].Ratio + inTorqueLossResult.Value; + var inAngularVelocity = outAngularVelocity * ModelData.Gears[gear].Ratio; - var inertiaTorqueLossOut = !inAngularVelocity.IsEqual(0) - ? Formulas.InertiaPower(outAngularVelocity, PreviousState.OutAngularVelocity, ModelData.Inertia, dt) / - avgOutAngularVelocity - : 0.SI<NewtonMeter>(); - inTorque += inertiaTorqueLossOut / ModelData.Gears[gear].Ratio; + var avgInAngularVelocity = (PreviousState.InAngularVelocity + inAngularVelocity) / 2.0; if (dryRun) { @@ -299,37 +317,16 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl /// <item><term>else</term><description>Response from NextComponent.</description></item> /// </list> /// </returns> - private IResponse RequestGearEngaged(Second absTime, Second dt, NewtonMeter outTorque, PerSecond outAngularVelocity, - bool dryRun) + private IResponse RequestGearEngaged(Second absTime, Second dt, NewtonMeter outTorque, PerSecond outAngularVelocity, NewtonMeter inTorque, TransmissionLossMap.LossMapResult inTorqueLossResult, NewtonMeter inertiaTorqueLossOut, bool dryRun) { // Set a Gear if no gear was set and engineSpeed is not zero //if (!Disengaged && DataBus.VehicleStopped && !outAngularVelocity.IsEqual(0)) //{ // Gear = _strategy.InitGear(absTime, dt, outTorque, outAngularVelocity); //} - if (Disengaged && !outAngularVelocity.IsEqual(0)) { - ReEngageGear(absTime, dt, outTorque, outAngularVelocity); - Log.Debug("Gearbox engaged gear {0}", Gear); - } var inAngularVelocity = outAngularVelocity * ModelData.Gears[Gear].Ratio; - var avgInAngularVelocity = (PreviousState.InAngularVelocity + inAngularVelocity) / 2.0; - var avgOutAngularVelocity = (PreviousState.OutAngularVelocity + outAngularVelocity) / 2.0; - var inTorqueLossResult = ModelData.Gears[Gear].LossMap.GetTorqueLoss(avgOutAngularVelocity, outTorque); - if (avgOutAngularVelocity.IsEqual(0, 1e-9)) { - inTorqueLossResult.Value = 0.SI<NewtonMeter>(); - } - var inTorque = !avgInAngularVelocity.IsEqual(0) - ? outTorque * (avgOutAngularVelocity / avgInAngularVelocity) - : outTorque / ModelData.Gears[Gear].Ratio; - inTorque += inTorqueLossResult.Value; - - var inertiaTorqueLossOut = !inAngularVelocity.IsEqual(0) - ? Formulas.InertiaPower(outAngularVelocity, PreviousState.OutAngularVelocity, ModelData.Inertia, dt) / - avgOutAngularVelocity - : 0.SI<NewtonMeter>(); - inTorque += inertiaTorqueLossOut / ModelData.Gears[Gear].Ratio; - + if (dryRun) { var dryRunResponse = NextComponent.Request(absTime, dt, inTorque, inAngularVelocity, true); dryRunResponse.GearboxPowerRequest = outTorque * (PreviousState.OutAngularVelocity + outAngularVelocity) / 2.0; diff --git a/VectoCore/VectoCoreTest/Integration/CoachAdvancedAuxPowertrain.cs b/VectoCore/VectoCoreTest/Integration/CoachAdvancedAuxPowertrain.cs index e85dda0689b2847f816e082ca53ed9c29fc39d4f..88666ee92da983e7f72b228afb91a7fb2a15c771 100644 --- a/VectoCore/VectoCoreTest/Integration/CoachAdvancedAuxPowertrain.cs +++ b/VectoCore/VectoCoreTest/Integration/CoachAdvancedAuxPowertrain.cs @@ -100,7 +100,8 @@ namespace TUGraz.VectoCore.Tests.Integration AirdragData = airdragData, GearboxData = gearboxData, EngineData = engineData, - SimulationType = SimulationType.DistanceCycle + SimulationType = SimulationType.DistanceCycle, + Cycle = cycleData }; container.RunData = runData; cycle.AddComponent(new Driver(container, driverData, new DefaultDriverStrategy())) diff --git a/VectoCore/VectoCoreTest/Integration/CoachPowerTrain.cs b/VectoCore/VectoCoreTest/Integration/CoachPowerTrain.cs index 296f6d4986e22d2f7bc64eaf4957aa962180a1da..32e161f1bc4c1f9588de001c8ac2283ac26feab9 100644 --- a/VectoCore/VectoCoreTest/Integration/CoachPowerTrain.cs +++ b/VectoCore/VectoCoreTest/Integration/CoachPowerTrain.cs @@ -102,7 +102,8 @@ namespace TUGraz.VectoCore.Tests.Integration GearboxData = gearboxData, EngineData = engineData, AirdragData = airDragData, - SimulationType = SimulationType.DistanceCycle + SimulationType = SimulationType.DistanceCycle, + Cycle = cycleData }; container.RunData = runData; diff --git a/VectoCore/VectoCoreTest/Integration/Declaration/EngineInputDataTests.cs b/VectoCore/VectoCoreTest/Integration/Declaration/EngineInputDataTests.cs index 21b41d09cfe4fd8b8b4793dbc1bd3cf8eb567e4b..ad992367d915b82212b9e952cb0b12d1a084c54e 100644 --- a/VectoCore/VectoCoreTest/Integration/Declaration/EngineInputDataTests.cs +++ b/VectoCore/VectoCoreTest/Integration/Declaration/EngineInputDataTests.cs @@ -58,12 +58,10 @@ namespace TUGraz.VectoCore.Tests.Integration.Declaration Directory.SetCurrentDirectory(TestContext.CurrentContext.TestDirectory); } - [Category("LongRunning")] - [Category("Integration")] - [TestCase(null, 1.0, 45.5323), - TestCase("CFRegPer", 1.2, 45.5323 * 1.2), - TestCase("BFColdHot", 1.2, 45.5323 * 1.2), - TestCase("CFNCV", 1.2, 45.5323) // has no influence - only for documentation purpose + [TestCase(null, 1.0, 45.52476184, TestName = "Engine CF - NONE"), + TestCase("CFRegPer", 1.2, 45.52476184 * 1.2, TestName = "Engine CF - CFRegPer"), + TestCase("BFColdHot", 1.2, 45.52476184 * 1.2, TestName = "Engine CF - BFColdHod"), + TestCase("CFNCV", 1.2, 45.52476184, TestName = "Engine CF - CFNCV") // has no influence - only for documentation purpose ] public void TestEngineCorrectionFactors(string correctionFactor, double value, double expectedFc) { diff --git a/VectoCore/VectoCoreTest/Integration/Declaration/NaturalGasVehicles.cs b/VectoCore/VectoCoreTest/Integration/Declaration/NaturalGasVehicles.cs index c2719b1998b70282162b6a0b5510d356d539bdf8..869ac7fbb18ca3346dfa6b56f9e203fc466a17fc 100644 --- a/VectoCore/VectoCoreTest/Integration/Declaration/NaturalGasVehicles.cs +++ b/VectoCore/VectoCoreTest/Integration/Declaration/NaturalGasVehicles.cs @@ -31,12 +31,11 @@ namespace TUGraz.VectoCore.Tests.Integration.Declaration } - [Category("LongRunning")] - [Category("Integration")] - [TestCase(Class5NG, 2, TankSystem.Liquefied, 253.7, 702.8), - TestCase(Class5NG, 2, TankSystem.Compressed, 259.5, 698.1), - TestCase(Class5NG, 6, TankSystem.Liquefied, 252.9, 700.7), - TestCase(Class5NG, 6, TankSystem.Compressed, 258.7, 696.0), + [ + TestCase(Class5NG, 2, TankSystem.Liquefied, 253.7, 702.8, TestName = "Class5 LNG 2"), + TestCase(Class5NG, 2, TankSystem.Compressed, 259.5, 698.1, TestName = "Class5 CNG 2"), + TestCase(Class5NG, 6, TankSystem.Liquefied, 252.8, 700.4, TestName = "Class5 LNG 6"), + TestCase(Class5NG, 6, TankSystem.Compressed, 258.6, 695.7, TestName = "Class5 CNG 6"), ] public void NaturalGasTankSystemTest(string filename, int runIdx, TankSystem tankSystem, double expectedFc, double expectedCo2) { diff --git a/VectoCore/VectoCoreTest/Integration/DriverStrategy/SimpleCycles.cs b/VectoCore/VectoCoreTest/Integration/DriverStrategy/SimpleCycles.cs index 0fae5ebdca22ac5529c0dedde165c60574e3f95b..863a4b492877be9fef326025b173bd1a087c8fec 100644 --- a/VectoCore/VectoCoreTest/Integration/DriverStrategy/SimpleCycles.cs +++ b/VectoCore/VectoCoreTest/Integration/DriverStrategy/SimpleCycles.cs @@ -62,8 +62,8 @@ namespace TUGraz.VectoCore.Tests.Integration.DriverStrategy GraphWriter.Series1Label = "Vecto 3"; GraphWriter.Series2Label = "Vecto 2.2"; - Directory.SetCurrentDirectory(TestContext.CurrentContext.TestDirectory); - } + Directory.SetCurrentDirectory(TestContext.CurrentContext.TestDirectory); + } private static string GetSlopeString(double slope) { diff --git a/VectoCore/VectoCoreTest/Integration/FuelTypesTest.cs b/VectoCore/VectoCoreTest/Integration/FuelTypesTest.cs index 9c90199b1ec4f424b654e50668709c5f0773168c..46175a7e039a206a00604509594548d8a58c53e5 100644 --- a/VectoCore/VectoCoreTest/Integration/FuelTypesTest.cs +++ b/VectoCore/VectoCoreTest/Integration/FuelTypesTest.cs @@ -58,40 +58,40 @@ namespace TUGraz.VectoCore.Tests.Integration [Category("Integration")] [TestCase(FuelType.DieselCI, null, @"TestData\Integration\DeclarationMode\Class2_RigidTruck_4x2\Class2_RigidTruck_DECL.vecto", 0, - 0.0002199424, 0.0002199424, 26.308901, 0.0006886, 9391.5411, + 0.0002199424, 0.0002199424, 26.3060719, 0.0006886, 9390.531125, TestName = "Diesel LH Low"), TestCase(FuelType.EthanolCI, null, @"TestData\Integration\DeclarationMode\Class2_RigidTruck_4x2\Class2_RigidTruck_DECL.vecto", 0, - 0.0002199424, 0.0002225401, 27.1390439, 0.000402797, 5652.5200, + 0.0002199424, 0.0002225401, 27.136125, 0.000402797, 5651.912176, TestName = "Ethanol/CI LH Low"), TestCase(FuelType.DieselCI, null, @"TestData\Integration\DeclarationMode\Class2_RigidTruck_4x2\Class2_RigidTruck_DECL.vecto", 1, - 0.0002547295, 0.0002547295, 30.4700418, 0.0007971, 10876.9518, + 0.0002547295, 0.0002547295, 30.4611849, 0.0007971, 10873.790098, TestName = "Diesel LH Ref"), TestCase(FuelType.EthanolCI, null, @"TestData\Integration\DeclarationMode\Class2_RigidTruck_4x2\Class2_RigidTruck_DECL.vecto", 1, - 0.0002547295, 0.000257738, 31.4314837, 0.00046650, 6546.5494, + 0.0002547295, 0.000257738, 31.4223473, 0.00046650, 6544.646499, TestName = "Ethanol/CI LH Ref"), TestCase(FuelType.EthanolPI, null, @"TestData\Integration\DeclarationMode\Class2_RigidTruck_4x2\Class2_RigidTruck_DECL.vecto", 1, - 0.0002547295, 0.00025299078, 32.1871223, 0.0005312806, 7412.62989, + 0.0002547295, 0.00025299078, 32.17776628, 0.0005312806, 7410.475219, TestName = "Ethanol/PI LH Ref"), TestCase(FuelType.PetrolPI, null, @"TestData\Integration\DeclarationMode\Class2_RigidTruck_4x2\Class2_RigidTruck_DECL.vecto", 1, - 0.0002547295, 0.00025472954, 34.054752636, 0.0007743778, 10571.27631, + 0.0002547295, 0.00025472954, 34.0448537, 0.0007743778, 10568.203491, TestName = "Petrol/PI LH Ref"), TestCase(FuelType.LPGPI, null, @"TestData\Integration\DeclarationMode\Class2_RigidTruck_4x2\Class2_RigidTruck_DECL.vecto", 1, - 0.0002547295, 0.0002547295, double.NaN, 0.00076928, 11717.55928, + 0.0002547295, 0.0002547295, double.NaN, 0.00076928, 11714.1532673, TestName = "LPG/PI LH Ref"), TestCase(FuelType.NGPI, TankSystem.Liquefied, @"TestData\Integration\DeclarationMode\Class2_RigidTruck_4x2\Class2_RigidTruck_DECL.vecto", 1, - 0.0002547295, 0.00023397765, double.NaN, 0.00064811809, 11488.30269, + 0.0002547295, 0.00023397765, double.NaN, 0.00064811809, 11484.963312, TestName = "LNG/PI LH Ref"), TestCase(FuelType.NGPI, TankSystem.Compressed, @"TestData\Integration\DeclarationMode\Class2_RigidTruck_4x2\Class2_RigidTruck_DECL.vecto", 1, - 0.0002547295, 0.0002393396, double.NaN, 0.000643823, 11488.30269, + 0.0002547295, 0.0002393396, double.NaN, 0.000643823, 11484.963312, TestName = "CNG/PI LH Ref"), ] public void TestFuelTypesCO2(FuelType fuelType, TankSystem? tankSystem, string jobName, int runIdx, diff --git a/VectoCore/VectoCoreTest/Integration/TorqueLimitsTest.cs b/VectoCore/VectoCoreTest/Integration/TorqueLimitsTest.cs index b57287d849de805ec7b9f071f361d9973b268f88..1aedb2dd045d98a72e5f17086cf40a0af250b962 100644 --- a/VectoCore/VectoCoreTest/Integration/TorqueLimitsTest.cs +++ b/VectoCore/VectoCoreTest/Integration/TorqueLimitsTest.cs @@ -29,6 +29,7 @@ * Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology */ +using System; using System.Data; using System.IO; using System.Linq; @@ -253,12 +254,13 @@ namespace TUGraz.VectoCore.Tests.Integration Assert.IsTrue(jobContainer.Runs.All(r => r.Success), string.Concat(jobContainer.Runs.Select(r => r.ExecException))); var view = new DataView(sumData.Table, "", SummaryDataContainer.SORT, DataViewRowState.CurrentRows).ToTable(); - Assert.AreEqual(201.3972, view.Rows[0][SummaryDataContainer.FCMAP_KM].ToString().ToDouble(), 1e-3); - Assert.AreEqual(239.2911, view.Rows[1][SummaryDataContainer.FCMAP_KM].ToString().ToDouble(), 1e-3); - Assert.AreEqual(170.1334, view.Rows[2][SummaryDataContainer.FCMAP_KM].ToString().ToDouble(), 1e-3); - Assert.AreEqual(183.0126, view.Rows[3][SummaryDataContainer.FCMAP_KM].ToString().ToDouble(), 1e-3); - Assert.AreEqual(224.1216, view.Rows[4][SummaryDataContainer.FCMAP_KM].ToString().ToDouble(), 1e-3); - Assert.AreEqual(254.3299, view.Rows[5][SummaryDataContainer.FCMAP_KM].ToString().ToDouble(), 1e-3); + Console.WriteLine(string.Join("; ", view.AsEnumerable().Select(x => x[SummaryDataContainer.FCMAP_KM].ToString().ToDouble()))); + Assert.AreEqual(201.39195, view.Rows[0][SummaryDataContainer.FCMAP_KM].ToString().ToDouble(), 1e-3); + Assert.AreEqual(239.28546, view.Rows[1][SummaryDataContainer.FCMAP_KM].ToString().ToDouble(), 1e-3); + Assert.AreEqual(170.11718, view.Rows[2][SummaryDataContainer.FCMAP_KM].ToString().ToDouble(), 1e-3); + Assert.AreEqual(183.02680, view.Rows[3][SummaryDataContainer.FCMAP_KM].ToString().ToDouble(), 1e-3); + Assert.AreEqual(224.07271, view.Rows[4][SummaryDataContainer.FCMAP_KM].ToString().ToDouble(), 1e-3); + Assert.AreEqual(254.35646, view.Rows[5][SummaryDataContainer.FCMAP_KM].ToString().ToDouble(), 1e-3); } [TestCase(EngineSpeedLimitJobATDecl)] diff --git a/VectoCore/VectoCoreTest/Models/SimulationComponent/GearboxPowertrainTest.cs b/VectoCore/VectoCoreTest/Models/SimulationComponent/GearboxPowertrainTest.cs index eac6e6d63ed3a70c2d4401e805ad4b6d843116d8..22a7eb5537e8e416239976ba6015c24732cadc77 100644 --- a/VectoCore/VectoCoreTest/Models/SimulationComponent/GearboxPowertrainTest.cs +++ b/VectoCore/VectoCoreTest/Models/SimulationComponent/GearboxPowertrainTest.cs @@ -29,6 +29,7 @@ * Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology */ +using System.IO; using NUnit.Framework; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Models.Connector.Ports.Impl; @@ -40,6 +41,13 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent [TestFixture] public class GearboxPowertrainTest { + + [OneTimeSetUp] + public void RunBeforeAnyTests() + { + Directory.SetCurrentDirectory(TestContext.CurrentContext.TestDirectory); + } + [TestCase] public void Gearbox_Initialize_Empty() { diff --git a/VectoCore/VectoCoreTest/Models/SimulationComponent/GearboxShiftLossesTest.cs b/VectoCore/VectoCoreTest/Models/SimulationComponent/GearboxShiftLossesTest.cs index df5f66d518bf9a459a9033ccb15f4921ddf5441b..589472269a9d4dbda1aaf6a573431f005b4f7a5e 100644 --- a/VectoCore/VectoCoreTest/Models/SimulationComponent/GearboxShiftLossesTest.cs +++ b/VectoCore/VectoCoreTest/Models/SimulationComponent/GearboxShiftLossesTest.cs @@ -51,14 +51,14 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent public class GearboxShiftLossesTest { - [OneTimeSetUp] - public void RunBeforeAnyTests() - { - Directory.SetCurrentDirectory(TestContext.CurrentContext.TestDirectory); - } + [OneTimeSetUp] + public void RunBeforeAnyTests() + { + Directory.SetCurrentDirectory(TestContext.CurrentContext.TestDirectory); + } - private static AxleGearData CreateAxleGearData(GearboxType gbxType) + private static AxleGearData CreateAxleGearData(GearboxType gbxType) { var ratio = gbxType == GearboxType.ATSerial ? 6.2 : 5.8; return new AxleGearData { diff --git a/VectoCore/VectoCoreTest/Models/SimulationComponent/GearboxTest.cs b/VectoCore/VectoCoreTest/Models/SimulationComponent/GearboxTest.cs index 382128eef923bb3e846346fbe82ab9cc84b86171..62770b0e4711aa6d305b8f96ba666414e3493a1b 100644 --- a/VectoCore/VectoCoreTest/Models/SimulationComponent/GearboxTest.cs +++ b/VectoCore/VectoCoreTest/Models/SimulationComponent/GearboxTest.cs @@ -488,12 +488,10 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent var response = gearbox.OutPort().Request(absTime, dt, outTorque, angularVelocity); Assert.IsTrue(response.GetType() == responseType); - if (responseType == typeof(ResponseSuccess)) { - AssertHelper.AreRelativeEqual(absTime, port.AbsTime); - AssertHelper.AreRelativeEqual(dt, port.Dt); - AssertHelper.AreRelativeEqual(expectedN, port.AngularVelocity); - AssertHelper.AreRelativeEqual(t, port.Torque, toleranceFactor: 1e-5); - } + AssertHelper.AreRelativeEqual(absTime, port.AbsTime); + AssertHelper.AreRelativeEqual(dt, port.Dt); + AssertHelper.AreRelativeEqual(expectedN, port.AngularVelocity); + AssertHelper.AreRelativeEqual(t, port.Torque, toleranceFactor: 1e-5); } [TestCase(8, 7, 1800, 750, typeof(ResponseGearShift)),