From 87cf0280b28cd5d1f2e7675016e768d64d56ecd2 Mon Sep 17 00:00:00 2001
From: Markus Quaritsch <markus.quaritsch@tugraz.at>
Date: Tue, 12 Apr 2016 09:05:43 +0200
Subject: [PATCH] moving projects to tools / common

---
 .../DeclarationConverter.py                   |  0
 .../DeclarationConverter.pyproj               |  0
 .../DeclarationCycleZip}/App.config           |  0
 .../DeclarationCycleZip.csproj                |  0
 .../DeclarationCycleZip}/Program.cs           |  0
 .../Properties/AssemblyInfo.cs                |  0
 {GraphDrawer => Tools/GraphDrawer}/App.config |  0
 .../GraphDrawer}/GraphDrawer.csproj           |  0
 {GraphDrawer => Tools/GraphDrawer}/Program.cs |  0
 .../GraphDrawer}/Properties/AssemblyInfo.cs   |  0
 .../AdvancedAuxiliaryInterfaces.vbproj        |  0
 .../Diagnostics.vb                            |  0
 .../Enumerations.vb                           |  0
 .../IAdvancedAuxiliaries.vb                   |  0
 .../IAuxiliaryEvent.vb                        |  0
 .../IDiagnostics.vb                           |  0
 .../IFuelConsumptionMap.vb                    |  0
 .../AdvancedAuxiliaryInterfaces}/ISignals.vb  |  0
 .../IVectoInputs.vb                           |  0
 .../My Project/Application.Designer.vb        |  0
 .../My Project/Application.myapp              |  0
 .../My Project/AssemblyInfo.vb                |  0
 .../My Project/Resources.Designer.vb          |  0
 .../My Project/Resources.resx                 |  0
 .../My Project/Settings.Designer.vb           |  0
 .../My Project/Settings.settings              |  0
 .../AdvancedAuxiliaryInterfaces}/Signals.vb   |  0
 .../VectoInputs.vb                            |  0
 .../packages.config                           |  0
 .../BusAuxiliaries/BusAdapterTest.cs          | 93 +++++++++++++++++++
 30 files changed, 93 insertions(+)
 rename {DeclarationConverter => Tools/DeclarationConverter}/DeclarationConverter.py (100%)
 rename {DeclarationConverter => Tools/DeclarationConverter}/DeclarationConverter.pyproj (100%)
 rename {DeclarationCycleZip => Tools/DeclarationCycleZip}/App.config (100%)
 rename {DeclarationCycleZip => Tools/DeclarationCycleZip}/DeclarationCycleZip.csproj (100%)
 rename {DeclarationCycleZip => Tools/DeclarationCycleZip}/Program.cs (100%)
 rename {DeclarationCycleZip => Tools/DeclarationCycleZip}/Properties/AssemblyInfo.cs (100%)
 rename {GraphDrawer => Tools/GraphDrawer}/App.config (100%)
 rename {GraphDrawer => Tools/GraphDrawer}/GraphDrawer.csproj (100%)
 rename {GraphDrawer => Tools/GraphDrawer}/Program.cs (100%)
 rename {GraphDrawer => Tools/GraphDrawer}/Properties/AssemblyInfo.cs (100%)
 rename {AdvancedAuxiliaryInterfaces => VectoCommon/AdvancedAuxiliaryInterfaces}/AdvancedAuxiliaryInterfaces.vbproj (100%)
 rename {AdvancedAuxiliaryInterfaces => VectoCommon/AdvancedAuxiliaryInterfaces}/Diagnostics.vb (100%)
 rename {AdvancedAuxiliaryInterfaces => VectoCommon/AdvancedAuxiliaryInterfaces}/Enumerations.vb (100%)
 rename {AdvancedAuxiliaryInterfaces => VectoCommon/AdvancedAuxiliaryInterfaces}/IAdvancedAuxiliaries.vb (100%)
 rename {AdvancedAuxiliaryInterfaces => VectoCommon/AdvancedAuxiliaryInterfaces}/IAuxiliaryEvent.vb (100%)
 rename {AdvancedAuxiliaryInterfaces => VectoCommon/AdvancedAuxiliaryInterfaces}/IDiagnostics.vb (100%)
 rename {AdvancedAuxiliaryInterfaces => VectoCommon/AdvancedAuxiliaryInterfaces}/IFuelConsumptionMap.vb (100%)
 rename {AdvancedAuxiliaryInterfaces => VectoCommon/AdvancedAuxiliaryInterfaces}/ISignals.vb (100%)
 rename {AdvancedAuxiliaryInterfaces => VectoCommon/AdvancedAuxiliaryInterfaces}/IVectoInputs.vb (100%)
 rename {AdvancedAuxiliaryInterfaces => VectoCommon/AdvancedAuxiliaryInterfaces}/My Project/Application.Designer.vb (100%)
 rename {AdvancedAuxiliaryInterfaces => VectoCommon/AdvancedAuxiliaryInterfaces}/My Project/Application.myapp (100%)
 rename {AdvancedAuxiliaryInterfaces => VectoCommon/AdvancedAuxiliaryInterfaces}/My Project/AssemblyInfo.vb (100%)
 rename {AdvancedAuxiliaryInterfaces => VectoCommon/AdvancedAuxiliaryInterfaces}/My Project/Resources.Designer.vb (100%)
 rename {AdvancedAuxiliaryInterfaces => VectoCommon/AdvancedAuxiliaryInterfaces}/My Project/Resources.resx (100%)
 rename {AdvancedAuxiliaryInterfaces => VectoCommon/AdvancedAuxiliaryInterfaces}/My Project/Settings.Designer.vb (100%)
 rename {AdvancedAuxiliaryInterfaces => VectoCommon/AdvancedAuxiliaryInterfaces}/My Project/Settings.settings (100%)
 rename {AdvancedAuxiliaryInterfaces => VectoCommon/AdvancedAuxiliaryInterfaces}/Signals.vb (100%)
 rename {AdvancedAuxiliaryInterfaces => VectoCommon/AdvancedAuxiliaryInterfaces}/VectoInputs.vb (100%)
 rename {AdvancedAuxiliaryInterfaces => VectoCommon/AdvancedAuxiliaryInterfaces}/packages.config (100%)
 create mode 100644 VectoCoreTest/Integration/BusAuxiliaries/BusAdapterTest.cs

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 0000000000..8bebb4fe87
--- /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
-- 
GitLab