Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 18a6f96b authored by Michael KRISPER's avatar Michael KRISPER
Browse files

Aux Pneumatic System: Upgrade values, datatable and source

parent 56c5f529
No related branches found
No related tags found
No related merge requests found
......@@ -343,11 +343,13 @@ Public Class cVECTO
Case "Variable displacement"
auxEntry.TechStr = "Variable displacement elec. controlled"
WorkerMsg(tMsgID.Warn,
"Aux: Upgraded Steering Pump Technology from 'Variable displacement' to '" + auxEntry.TechStr + "'", msgSrc)
"Aux: Upgraded Steering Pump Technology from 'Variable displacement' to new format: '" + auxEntry.TechStr +
"'", msgSrc)
Case "Hydraulic supported by electric"
auxEntry.TechStr = "Dual displacement"
WorkerMsg(tMsgID.Warn,
"Aux: Upgraded Steering Pump Technology from 'Hydraulic supported by electric' to '" + auxEntry.TechStr + "'",
"Aux: Upgraded Steering Pump Technology from 'Hydraulic supported by electric' to new format: '" +
auxEntry.TechStr + "'",
msgSrc)
End Select
End If
......@@ -362,6 +364,12 @@ Public Class cVECTO
auxEntry.TechStr = "Belt driven or driven via transm. - On/off clutch"
End Select
End If
If JSON.Content("Header")("FileVersion") = 2 AndAlso auxId = sKey.AUX.PneumSys Then
auxEntry.TechStr = "Medium Supply 1-stage"
WorkerMsg(tMsgID.Warn, "Aux: Upgraded Pneumatic System Technology to new format: '" + auxEntry.TechStr + "'",
msgSrc)
End If
Next
End If
......
......@@ -42,9 +42,7 @@ using TUGraz.VectoCore.Models.Simulation.Data;
using TUGraz.VectoCore.Models.SimulationComponent.Data;
using TUGraz.VectoCore.Models.SimulationComponent.Data.Engine;
using TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox;
using TUGraz.VectoCore.OutputData;
using TUGraz.VectoCore.Utils;
using DriverData = TUGraz.VectoCore.Models.SimulationComponent.Data.DriverData;
namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter
{
......@@ -262,7 +260,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter
aux.ID = Constants.Auxiliaries.IDs.HeatingVentilationAirCondition;
break;
case AuxiliaryType.PneumaticSystem:
aux.PowerDemand = DeclarationData.PneumaticSystem.Lookup(mission, hvdClass);
aux.PowerDemand = DeclarationData.PneumaticSystem.Lookup(mission, auxData.Technology.First());
aux.ID = Constants.Auxiliaries.IDs.PneumaticSystem;
break;
case AuxiliaryType.ElectricSystem:
......
......@@ -36,7 +36,7 @@ using TUGraz.VectoCore.Utils;
namespace TUGraz.VectoCore.Models.Declaration
{
public sealed class PneumaticSystem : LookupData<MissionType, VehicleClass, Watt>
public sealed class PneumaticSystem : LookupData<MissionType, string, Watt>
{
protected override string ResourceId
{
......@@ -45,7 +45,7 @@ namespace TUGraz.VectoCore.Models.Declaration
protected override string ErrorMessage
{
get { return "Auxiliary Lookup Error: No value found for Pneumatic System. Mission: '{0}', HDVClass: '{1}'"; }
get { return "Auxiliary Lookup Error: No value found for Pneumatic System. Mission: '{0}', Technology: '{1}'"; }
}
protected override void ParseData(DataTable table)
......@@ -54,9 +54,11 @@ namespace TUGraz.VectoCore.Models.Declaration
NormalizeTable(table);
foreach (DataRow row in table.Rows) {
var hdvClass = VehicleClassHelper.Parse(row.Field<string>("hdvclass/power"));
foreach (MissionType mission in Enum.GetValues(typeof(MissionType))) {
Data[Tuple.Create(mission, hdvClass)] = row.ParseDouble(mission.ToString().ToLower()).SI<Watt>();
var technology = row.Field<string>("technology");
foreach (DataColumn col in table.Columns) {
if (col.Caption != "hdvclass") {
Data[Tuple.Create(col.Caption.ParseEnum<MissionType>(), technology)] = row.ParseDouble(col.Caption).SI<Watt>();
}
}
}
}
......
......@@ -360,26 +360,40 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration
}
[Test,
TestCase(VehicleClass.Class1, new[] { 0, 1300, 1240, 0, 0, 0, 0, 0, 0, 0 }),
TestCase(VehicleClass.Class2, new[] { 1180, 1280, 1320, 0, 0, 0, 0, 0, 0, 0 }),
TestCase(VehicleClass.Class3, new[] { 0, 1360, 1380, 0, 0, 0, 0, 0, 0, 0 }),
TestCase(VehicleClass.Class4, new[] { 1300, 1340, 0, 0, 0, 0, 0, 0, 0, 0 }),
TestCase(VehicleClass.Class5, new[] { 1340, 1820, 0, 0, 0, 0, 0, 0, 0, 0 }),
TestCase(VehicleClass.Class6, new[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }),
TestCase(VehicleClass.Class7, new[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }),
TestCase(VehicleClass.Class8, new[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }),
TestCase(VehicleClass.Class9, new[] { 1340, 1540, 0, 0, 0, 0, 0, 0, 0, 0 }),
TestCase(VehicleClass.Class10, new[] { 1340, 1820, 0, 0, 0, 0, 0, 0, 0, 0 }),
TestCase(VehicleClass.Class11, new[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }),
TestCase(VehicleClass.Class12, new[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }),
TestCase("Small", new[] { 1400, 1300, 1200, 1200, 1300 }),
TestCase("Small + ESS", new[] { 900, 800, 800, 800, 800 }),
TestCase("Small + visco clutch", new[] { 800, 700, 700, 700, 700 }),
TestCase("Small + mech. clutch", new[] { 600, 600, 650, 650, 600 }),
TestCase("Small + ESS + AMS", new[] { 500, 400, 500, 500, 400 }),
TestCase("Small + visco clutch + AMS", new[] { 400, 300, 400, 400, 300 }),
TestCase("Small + mech. clutch + AMS", new[] { 200, 200, 350, 350, 200 }),
TestCase("Medium Supply 1-stage", new[] { 1600, 1400, 1350, 1350, 1500 }),
TestCase("Medium Supply 1-stage + ESS", new[] { 1000, 900, 900, 900, 900 }),
TestCase("Medium Supply 1-stage + visco clutch", new[] { 850, 800, 800, 800, 750 }),
TestCase("Medium Supply 1-stage + mech. clutch", new[] { 600, 550, 550, 550, 600 }),
TestCase("Medium Supply 1-stage + ESS + AMS", new[] { 600, 700, 700, 700, 500 }),
TestCase("Medium Supply 1-stage + visco clutch + AMS", new[] { 450, 600, 600, 600, 350 }),
TestCase("Medium Supply 1-stage + mech. clutch + AMS", new[] { 200, 350, 350, 350, 200 }),
TestCase("Medium Supply 2-stage", new[] { 2100, 1750, 1700, 1700, 2100 }),
TestCase("Medium Supply 2-stage + ESS", new[] { 1100, 1050, 1000, 1000, 1000 }),
TestCase("Medium Supply 2-stage + visco clutch", new[] { 1000, 850, 800, 800, 900 }),
TestCase("Medium Supply 2-stage + mech. clutch", new[] { 700, 650, 600, 600, 800 }),
TestCase("Medium Supply 2-stage + ESS + AMS", new[] { 700, 850, 800, 800, 500 }),
TestCase("Medium Supply 2-stage + visco clutch + AMS", new[] { 600, 650, 600, 600, 400 }),
TestCase("Medium Supply 2-stage + mech. clutch + AMS", new[] { 300, 450, 400, 400, 300 }),
TestCase("Large Supply", new[] { 4300, 3600, 3500, 3500, 4100 }),
TestCase("Large Supply + ESS", new[] { 1600, 1300, 1200, 1200, 1500 }),
TestCase("Large Supply + visco clutch", new[] { 1300, 1100, 1000, 1000, 1200 }),
TestCase("Large Supply + mech. clutch", new[] { 800, 800, 700, 700, 900 }),
TestCase("Large Supply + ESS + AMS", new[] { 1100, 1000, 1000, 1000, 1000 }),
TestCase("Large Supply + visco clutch + AMS", new[] { 800, 800, 800, 800, 700 }),
TestCase("Large Supply + mech. clutch + AMS", new[] { 300, 500, 500, 500, 400 }),
]
public void AuxPneumaticSystemTest(VehicleClass vehicleClass, int[] expected)
public void AuxPneumaticSystemTest(string technology, int[] expected)
{
var ps = DeclarationData.PneumaticSystem;
for (var i = 0; i < _missions.Length; i++) {
var value = ps.Lookup(_missions[i], vehicleClass);
Assert.AreEqual(expected[i], value.Value(), Tolerance);
var value = DeclarationData.PneumaticSystem.Lookup(_missions[i], technology);
AssertHelper.AreRelativeEqual(expected[i], value);
}
}
......
......@@ -77,7 +77,7 @@ namespace TUGraz.VectoCore.Tests.Models.Simulation
aux.AddConstant("FAN",
DeclarationData.Fan.Lookup(MissionType.LongHaul, "Hydraulic driven - Constant displacement pump"));
aux.AddConstant("PS", DeclarationData.PneumaticSystem.Lookup(mission, hdvClass));
aux.AddConstant("PS", DeclarationData.PneumaticSystem.Lookup(mission, "Medium Supply 1-stage"));
aux.AddConstant("STP",
SteeringPump.Lookup(MissionType.LongHaul, hdvClass,
new[] { "Variable displacement mech. controlled" }));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment