diff --git a/DeclarationConverter/DeclarationConverter.py b/Tools/DeclarationConverter/DeclarationConverter.py similarity index 100% rename from DeclarationConverter/DeclarationConverter.py rename to Tools/DeclarationConverter/DeclarationConverter.py diff --git a/DeclarationConverter/DeclarationConverter.pyproj b/Tools/DeclarationConverter/DeclarationConverter.pyproj similarity index 100% rename from DeclarationConverter/DeclarationConverter.pyproj rename to Tools/DeclarationConverter/DeclarationConverter.pyproj diff --git a/DeclarationCycleZip/App.config b/Tools/DeclarationCycleZip/App.config similarity index 100% rename from DeclarationCycleZip/App.config rename to Tools/DeclarationCycleZip/App.config diff --git a/DeclarationCycleZip/DeclarationCycleZip.csproj b/Tools/DeclarationCycleZip/DeclarationCycleZip.csproj similarity index 100% rename from DeclarationCycleZip/DeclarationCycleZip.csproj rename to Tools/DeclarationCycleZip/DeclarationCycleZip.csproj diff --git a/DeclarationCycleZip/Program.cs b/Tools/DeclarationCycleZip/Program.cs similarity index 100% rename from DeclarationCycleZip/Program.cs rename to Tools/DeclarationCycleZip/Program.cs diff --git a/DeclarationCycleZip/Properties/AssemblyInfo.cs b/Tools/DeclarationCycleZip/Properties/AssemblyInfo.cs similarity index 100% rename from DeclarationCycleZip/Properties/AssemblyInfo.cs rename to Tools/DeclarationCycleZip/Properties/AssemblyInfo.cs diff --git a/GraphDrawer/App.config b/Tools/GraphDrawer/App.config similarity index 100% rename from GraphDrawer/App.config rename to Tools/GraphDrawer/App.config diff --git a/GraphDrawer/GraphDrawer.csproj b/Tools/GraphDrawer/GraphDrawer.csproj similarity index 100% rename from GraphDrawer/GraphDrawer.csproj rename to Tools/GraphDrawer/GraphDrawer.csproj diff --git a/GraphDrawer/Program.cs b/Tools/GraphDrawer/Program.cs similarity index 100% rename from GraphDrawer/Program.cs rename to Tools/GraphDrawer/Program.cs diff --git a/GraphDrawer/Properties/AssemblyInfo.cs b/Tools/GraphDrawer/Properties/AssemblyInfo.cs similarity index 100% rename from GraphDrawer/Properties/AssemblyInfo.cs rename to Tools/GraphDrawer/Properties/AssemblyInfo.cs diff --git a/AdvancedAuxiliaryInterfaces/AdvancedAuxiliaryInterfaces.vbproj b/VectoCommon/AdvancedAuxiliaryInterfaces/AdvancedAuxiliaryInterfaces.vbproj similarity index 100% rename from AdvancedAuxiliaryInterfaces/AdvancedAuxiliaryInterfaces.vbproj rename to VectoCommon/AdvancedAuxiliaryInterfaces/AdvancedAuxiliaryInterfaces.vbproj diff --git a/AdvancedAuxiliaryInterfaces/Diagnostics.vb b/VectoCommon/AdvancedAuxiliaryInterfaces/Diagnostics.vb similarity index 100% rename from AdvancedAuxiliaryInterfaces/Diagnostics.vb rename to VectoCommon/AdvancedAuxiliaryInterfaces/Diagnostics.vb diff --git a/AdvancedAuxiliaryInterfaces/Enumerations.vb b/VectoCommon/AdvancedAuxiliaryInterfaces/Enumerations.vb similarity index 100% rename from AdvancedAuxiliaryInterfaces/Enumerations.vb rename to VectoCommon/AdvancedAuxiliaryInterfaces/Enumerations.vb diff --git a/AdvancedAuxiliaryInterfaces/IAdvancedAuxiliaries.vb b/VectoCommon/AdvancedAuxiliaryInterfaces/IAdvancedAuxiliaries.vb similarity index 100% rename from AdvancedAuxiliaryInterfaces/IAdvancedAuxiliaries.vb rename to VectoCommon/AdvancedAuxiliaryInterfaces/IAdvancedAuxiliaries.vb diff --git a/AdvancedAuxiliaryInterfaces/IAuxiliaryEvent.vb b/VectoCommon/AdvancedAuxiliaryInterfaces/IAuxiliaryEvent.vb similarity index 100% rename from AdvancedAuxiliaryInterfaces/IAuxiliaryEvent.vb rename to VectoCommon/AdvancedAuxiliaryInterfaces/IAuxiliaryEvent.vb diff --git a/AdvancedAuxiliaryInterfaces/IDiagnostics.vb b/VectoCommon/AdvancedAuxiliaryInterfaces/IDiagnostics.vb similarity index 100% rename from AdvancedAuxiliaryInterfaces/IDiagnostics.vb rename to VectoCommon/AdvancedAuxiliaryInterfaces/IDiagnostics.vb diff --git a/AdvancedAuxiliaryInterfaces/IFuelConsumptionMap.vb b/VectoCommon/AdvancedAuxiliaryInterfaces/IFuelConsumptionMap.vb similarity index 100% rename from AdvancedAuxiliaryInterfaces/IFuelConsumptionMap.vb rename to VectoCommon/AdvancedAuxiliaryInterfaces/IFuelConsumptionMap.vb diff --git a/AdvancedAuxiliaryInterfaces/ISignals.vb b/VectoCommon/AdvancedAuxiliaryInterfaces/ISignals.vb similarity index 100% rename from AdvancedAuxiliaryInterfaces/ISignals.vb rename to VectoCommon/AdvancedAuxiliaryInterfaces/ISignals.vb diff --git a/AdvancedAuxiliaryInterfaces/IVectoInputs.vb b/VectoCommon/AdvancedAuxiliaryInterfaces/IVectoInputs.vb similarity index 100% rename from AdvancedAuxiliaryInterfaces/IVectoInputs.vb rename to VectoCommon/AdvancedAuxiliaryInterfaces/IVectoInputs.vb diff --git a/AdvancedAuxiliaryInterfaces/My Project/Application.Designer.vb b/VectoCommon/AdvancedAuxiliaryInterfaces/My Project/Application.Designer.vb similarity index 100% rename from AdvancedAuxiliaryInterfaces/My Project/Application.Designer.vb rename to VectoCommon/AdvancedAuxiliaryInterfaces/My Project/Application.Designer.vb diff --git a/AdvancedAuxiliaryInterfaces/My Project/Application.myapp b/VectoCommon/AdvancedAuxiliaryInterfaces/My Project/Application.myapp similarity index 100% rename from AdvancedAuxiliaryInterfaces/My Project/Application.myapp rename to VectoCommon/AdvancedAuxiliaryInterfaces/My Project/Application.myapp diff --git a/AdvancedAuxiliaryInterfaces/My Project/AssemblyInfo.vb b/VectoCommon/AdvancedAuxiliaryInterfaces/My Project/AssemblyInfo.vb similarity index 100% rename from AdvancedAuxiliaryInterfaces/My Project/AssemblyInfo.vb rename to VectoCommon/AdvancedAuxiliaryInterfaces/My Project/AssemblyInfo.vb diff --git a/AdvancedAuxiliaryInterfaces/My Project/Resources.Designer.vb b/VectoCommon/AdvancedAuxiliaryInterfaces/My Project/Resources.Designer.vb similarity index 100% rename from AdvancedAuxiliaryInterfaces/My Project/Resources.Designer.vb rename to VectoCommon/AdvancedAuxiliaryInterfaces/My Project/Resources.Designer.vb diff --git a/AdvancedAuxiliaryInterfaces/My Project/Resources.resx b/VectoCommon/AdvancedAuxiliaryInterfaces/My Project/Resources.resx similarity index 100% rename from AdvancedAuxiliaryInterfaces/My Project/Resources.resx rename to VectoCommon/AdvancedAuxiliaryInterfaces/My Project/Resources.resx diff --git a/AdvancedAuxiliaryInterfaces/My Project/Settings.Designer.vb b/VectoCommon/AdvancedAuxiliaryInterfaces/My Project/Settings.Designer.vb similarity index 100% rename from AdvancedAuxiliaryInterfaces/My Project/Settings.Designer.vb rename to VectoCommon/AdvancedAuxiliaryInterfaces/My Project/Settings.Designer.vb diff --git a/AdvancedAuxiliaryInterfaces/My Project/Settings.settings b/VectoCommon/AdvancedAuxiliaryInterfaces/My Project/Settings.settings similarity index 100% rename from AdvancedAuxiliaryInterfaces/My Project/Settings.settings rename to VectoCommon/AdvancedAuxiliaryInterfaces/My Project/Settings.settings diff --git a/AdvancedAuxiliaryInterfaces/Signals.vb b/VectoCommon/AdvancedAuxiliaryInterfaces/Signals.vb similarity index 100% rename from AdvancedAuxiliaryInterfaces/Signals.vb rename to VectoCommon/AdvancedAuxiliaryInterfaces/Signals.vb diff --git a/AdvancedAuxiliaryInterfaces/VectoInputs.vb b/VectoCommon/AdvancedAuxiliaryInterfaces/VectoInputs.vb similarity index 100% rename from AdvancedAuxiliaryInterfaces/VectoInputs.vb rename to VectoCommon/AdvancedAuxiliaryInterfaces/VectoInputs.vb diff --git a/AdvancedAuxiliaryInterfaces/packages.config b/VectoCommon/AdvancedAuxiliaryInterfaces/packages.config similarity index 100% rename from AdvancedAuxiliaryInterfaces/packages.config rename to VectoCommon/AdvancedAuxiliaryInterfaces/packages.config diff --git a/VectoCoreTest/Integration/BusAuxiliaries/BusAdapterTest.cs b/VectoCoreTest/Integration/BusAuxiliaries/BusAdapterTest.cs new file mode 100644 index 0000000000000000000000000000000000000000..8bebb4fe871fb5064d901f8e1c243cea49a42e38 --- /dev/null +++ b/VectoCoreTest/Integration/BusAuxiliaries/BusAdapterTest.cs @@ -0,0 +1,93 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using NUnit.Framework; +using TUGraz.VectoCore.Models.Simulation.DataBus; +using TUGraz.VectoCore.Tests.Utils; +using TUGraz.VectoCore.Utils; +using Assert = Microsoft.VisualStudio.TestTools.UnitTesting.Assert; + +namespace TUGraz.VectoCore.Tests.Integration.BusAuxiliaries +{ + [TestFixture] + public class BusAdapterTest + { + [Test] + [TestCase(12000, 1256, 148, 148, 6087.0317)] + [TestCase(12000, 1256, -48, -148, 6087.0317)] + [TestCase(12000, 1256, 48, -148, 6087.0317)] + [TestCase(12000, 800, 148, 148, 6377.2026)] + [TestCase(12000, 800, -48, -148, 6377.2026)] + [TestCase(12000, 800, 48, -148, 6377.2026)] + public void TestNoSmartAuxDuringDrive(double vehicleWeight, double engineSpeedRpm, double driveLinePower, + double internalPower, double expectedPowerDemand) + { + MockDriver driver; + var busAux = AuxDemandTest.CreateBusAuxAdapterForTesting(vehicleWeight, out driver); + + driver.DrivingBehavior = DrivingBehavior.Driving; + + var engineDrivelinePower = (driveLinePower * 1000).SI<Watt>(); + var engineSpeed = engineSpeedRpm.RPMtoRad(); + busAux.Initialize(engineDrivelinePower / engineSpeed, engineSpeed); + + var torque = busAux.PowerDemand(0.SI<Second>(), 1.SI<Second>(), engineDrivelinePower / engineSpeed, + (internalPower * 1000).SI<Watt>() / engineSpeed, engineSpeed); + + Assert.AreEqual(expectedPowerDemand, (torque * engineSpeed).Value(), 1e-4); + } + + [Test] + [TestCase(12000, 1256, 148, 148, 6087.0317)] + [TestCase(12000, 1256, -28, -27, 6087.0317)] + [TestCase(12000, 1256, -28, -29, 6087.0317)] + [TestCase(12000, 1256, -128, -28, 6087.0317)] + [TestCase(12000, 1256, 28, -28, 6087.0317)] + [TestCase(12000, 800, 148, 148, 6377.2026)] + [TestCase(12000, 800, -14, -13, 6377.2026)] + [TestCase(12000, 800, -14, -15, 6377.2026)] + [TestCase(12000, 800, -35, -14, 6377.2026)] + [TestCase(12000, 800, 35, -14, 6377.2026)] + public void TestNoSmartAuxDuringCoasting(double vehicleWeight, double engineSpeedRpm, double driveLinePower, + double internalPower, double expectedPowerDemand) + { + // this test is to make sure that the aux power-demand does not jump between average and smart power demand + // when searching for the operating point for coasting (i.e. power demand (internal Power) is close to the motoring curve, + // intependent of power demand of power train) + MockDriver driver; + var busAux = AuxDemandTest.CreateBusAuxAdapterForTesting(vehicleWeight, out driver); + + driver.DrivingBehavior = DrivingBehavior.Coasting; + + var engineDrivelinePower = (driveLinePower * 1000).SI<Watt>(); + var engineSpeed = engineSpeedRpm.RPMtoRad(); + busAux.Initialize(engineDrivelinePower / engineSpeed, engineSpeed); + + var torque = busAux.PowerDemand(0.SI<Second>(), 1.SI<Second>(), engineDrivelinePower / engineSpeed, + (internalPower * 1000).SI<Watt>() / engineSpeed, engineSpeed); + + Assert.AreEqual(expectedPowerDemand, (torque * engineSpeed).Value(), 1e-4); + } + + [Test] + [TestCase(12000, 1256, -48, -148, 8954.14355)] + [TestCase(12000, 1256, 48, -148, 8954.14355)] + [TestCase(12000, 800, -48, -148, 8281.51367)] + [TestCase(12000, 800, 48, -148, 8281.51367)] + public void TestSmartAuxDuringBrake(double vehicleWeight, double engineSpeedRpm, double driveLinePower, + double internalPower, double expectedPowerDemand) + { + MockDriver driver; + var busAux = AuxDemandTest.CreateBusAuxAdapterForTesting(vehicleWeight, out driver); + + driver.DrivingBehavior = DrivingBehavior.Braking; + + var engineDrivelinePower = (driveLinePower * 1000).SI<Watt>(); + var engineSpeed = engineSpeedRpm.RPMtoRad(); + busAux.Initialize(engineDrivelinePower / engineSpeed, engineSpeed); + + var torque = busAux.PowerDemand(0.SI<Second>(), 1.SI<Second>(), engineDrivelinePower / engineSpeed, + (internalPower * 1000).SI<Watt>() / engineSpeed, engineSpeed); + + Assert.AreEqual(expectedPowerDemand, (torque * engineSpeed).Value(), 1e-4); + } + } +} \ No newline at end of file