Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit 779c4d33 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

fix more testcases

parent 45adb1cd
No related branches found
No related tags found
No related merge requests found
Showing with 22 additions and 20 deletions
......@@ -4,6 +4,7 @@ Imports TUGraz.VectoCommon.Utils
Imports TUGraz.VectoCore.InputData.FileIO.JSON
Imports TUGraz.VectoCore.InputData.Reader.ComponentData
Imports TUGraz.VectoCore.Models.BusAuxiliaries
Imports TUGraz.VectoCore.Models.BusAuxiliaries.DownstreamModules.Impl.Electrics
Imports TUGraz.VectoCore.Models.BusAuxiliaries.Interfaces
Namespace IntegrationTests
......@@ -25,7 +26,7 @@ Namespace IntegrationTests
Dim engineFCMapFilePath = "TestFiles\Integration\24t Coach.vmap"
Dim auxFilePath = "TestFiles\Integration\AdvAuxTest.aaux"
Dim aux As BusAuxiliaries = New BusAuxiliaries(Nothing)
Dim aux As BusAuxiliaries = New BusAuxiliaries(new NoBattery(Nothing))
'aux.VectoInputs.Cycle = "Coach"
'aux.VectoInputs.VehicleWeightKG = vehicleWeight.SI(Of Kilogram)()
......@@ -75,7 +76,7 @@ Namespace IntegrationTests
Dim engineFCMapFilePath = "TestFiles\Integration\24t Coach.vmap"
Dim auxFilePath = "TestFiles\Integration\AdvAuxTest.aaux"
Dim aux As BusAuxiliaries = New BusAuxiliaries(Nothing)
Dim aux As BusAuxiliaries = New BusAuxiliaries(New NoBattery(Nothing))
'aux.VectoInputs.Cycle = "Coach"
'aux.VectoInputs.VehicleWeightKG = 12000.SI(Of Kilogram)()
......
......@@ -107,7 +107,7 @@ Namespace UnitTests
Public Sub AlternatorsEfficiencyIdle2000rpmTest()
Initialise()
Dim expected As Double = 0.6308339
Dim expected As Double = 0.62 '0.6308339
Dim actual As Double = target.AlternatorsEfficiencyIdleResultCard()
Assert.AreEqual(expected, actual, 0.000001)
......@@ -118,7 +118,7 @@ Namespace UnitTests
Public Sub AlternatorsEfficiencyTraction2000rpmTest()
Initialise()
Dim expected As Double = 0.6308339
Dim expected As Double = 0.62 '0.6308339
Dim actual As Double = target.AlternatorsEfficiencyTractionOnResultCard()
Assert.AreEqual(expected, actual, 0.000001)
......@@ -129,7 +129,7 @@ Namespace UnitTests
Public Sub AlternatorsEfficiencyOverrun2000rpmTest()
Initialise()
Dim expected As Double = 0.6308339
Dim expected As Double = 0.62 '0.6308339
Dim actual As Double = target.AlternatorsEfficiencyOverrunResultCard()
Assert.AreEqual(expected, actual, 0.000001)
......
......@@ -220,7 +220,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Data
}
}
if (runData.EngineData.PTORoadSweepEngineSpeed != null) {
if ((jobType == VectoSimulationJobType.ConventionalVehicle || jobType == VectoSimulationJobType.ParallelHybridVehicle) && runData.EngineData.PTORoadSweepEngineSpeed != null) {
if (runData.EngineData.IdleSpeed.IsGreater(runData.EngineData.PTORoadSweepEngineSpeed)) {
return new ValidationResult("PTO Operating enginespeed is below engine idling speed");
}
......
......@@ -178,7 +178,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
if (Position == PowertrainPosition.HybridP2 && !DataBus.GearboxInfo.GearEngaged(absTime)) {
// electric motor is between gearbox and clutch, but no gear is engaged...
if (emTorque != null) {
if (!DataBus.HybridControllerInfo.GearboxEngaged) {
if (!DataBus.HybridControllerInfo.GearboxEngaged || (DataBus.HybridControllerInfo.GearboxEngaged && !DataBus.GearboxInfo.GearEngaged(absTime))) {
return new ResponseInvalidOperatingPoint(this) {
ElectricMotor = {
MaxDriveTorque = maxDriveTorqueDt,
......
......@@ -62,10 +62,10 @@ namespace TUGraz.VectoCore.Tests.Integration.Declaration
xmlInputReader = _kernel.Get<IXMLInputDataReader>();
}
[TestCase(null, 1.0, 45.557155, TestName = "Engine CF - NONE"),
TestCase("CFRegPer", 1.2, 45.557155 * 1.2, TestName = "Engine CF - CFRegPer"),
TestCase("BFColdHot", 1.2, 45.557155 * 1.2, TestName = "Engine CF - BFColdHod"),
TestCase("CFNCV", 1.2, 45.557155, TestName = "Engine CF - CFNCV") // has no influence - only for documentation purpose
[TestCase(null, 1.0, 45.555177, TestName = "Engine CF - NONE"),
TestCase("CFRegPer", 1.2, 45.555177 * 1.2, TestName = "Engine CF - CFRegPer"),
TestCase("BFColdHot", 1.2, 45.555177 * 1.2, TestName = "Engine CF - BFColdHod"),
TestCase("CFNCV", 1.2, 45.555177, TestName = "Engine CF - CFNCV") // has no influence - only for documentation purpose
]
public void TestEngineCorrectionFactors(string correctionFactor, double value, double expectedFc)
{
......
......@@ -88,11 +88,12 @@ namespace TUGraz.VectoCore.Tests.Integration.SimulationRuns
var fileWriter = new FileOutputWriter("Coach_MinimalPowertrainOverload");
var runData = new VectoRunData() {
JobName = "Coach_MinimalPowertrainOverload"
};
};
var modData = new ModalDataContainer(runData, fileWriter, null);
var container = new VehicleContainer(ExecutionMode.Engineering, modData) {
RunData = new VectoRunData() {
VehicleData = vehicleData,
DriverData = driverData
}
};
......@@ -154,7 +155,7 @@ namespace TUGraz.VectoCore.Tests.Integration.SimulationRuns
};
var modData = new ModalDataContainer(runData, fileWriter, null);
var container = new VehicleContainer(ExecutionMode.Engineering, modData) {
var container = new VehicleContainer(ExecutionMode.Engineering, modData) {
RunData = runData
};
......@@ -239,7 +240,7 @@ namespace TUGraz.VectoCore.Tests.Integration.SimulationRuns
ElectricMachinesData = new List<Tuple<PowertrainPosition, ElectricMotorData>>()
};
var modData = new ModalDataContainer(runData, fileWriter, null);
var container = new VehicleContainer(ExecutionMode.Engineering, modData) {
var container = new VehicleContainer(ExecutionMode.Engineering, modData) {
RunData = runData
};
......
......@@ -92,7 +92,7 @@ namespace TUGraz.VectoCore.Tests.Integration.VTP
[Category("Integration")]
[TestCase(@"TestData\Integration\VTPMode\GenericVehicle\class_5_generic vehicle_DECL.vecto", 45.6, 0.8972, TestName = "RunVTPHeavyLorry_Declaration"),
TestCase(@"TestData\Integration\VTPMode\MediumLorry\VTP_MediumLorry.vecto", 400.0, 1.06, TestName = "RunVTPMediumLorry_Declaration"),
TestCase(@"TestData\Integration\VTPMode\DualFuelVehicle\VTP_DualFuel.vecto", 43.5, 1.018, TestName = "RunVTPDualFuel_Declaration"),
TestCase(@"TestData\Integration\VTPMode\DualFuelVehicle\VTP_DualFuel.vecto", 43.5, 1.0107, TestName = "RunVTPDualFuel_Declaration"),
TestCase(@"TestData\Integration\VTPMode\HeavyBus\VTP_PrimaryBus.vecto", 14.2, 1.1413, TestName = "RunVTPHeavyPrimaryBus")
]
public void RunVTP_Declaration(string jobFile, double expectedDeclaredCO2, double expectedCVTP)
......@@ -149,7 +149,7 @@ namespace TUGraz.VectoCore.Tests.Integration.VTP
jobContainer.AddRuns(runsFactory);
Assert.AreEqual(2, jobContainer.Runs.Count);
Assert.AreEqual(1, jobContainer.Runs.Count);
//var i = 0;
//jobContainer.Runs[i].Run.Run();
//Assert.IsTrue(jobContainer.Runs[i].Run.FinishedWithoutErrors);
......@@ -160,9 +160,9 @@ namespace TUGraz.VectoCore.Tests.Integration.VTP
Assert.AreEqual(true, jobContainer.AllCompleted);
var vtpReport = XDocument.Load(XmlReader.Create(fileWriter.XMLVTPReportName));
var vtpFactor = vtpReport.XPathSelectElement("//*[local-name() = 'Results']/*[local-name() = 'VTRatio']")?.Value.ToDouble(0);
var vtpFactor = vtpReport.XPathSelectElement("//*[local-name() = 'Results']/*[local-name() = 'C_VTP']")?.Value.ToDouble(0);
Assert.AreEqual(0.8972, vtpFactor);
Assert.AreEqual(0.9549, vtpFactor);
}
......
t , v , gear , tc_active , n_eng , n_fan , fc , n_wh_left , n_wh_right , tq_left , tq_right
t , v , gear , tc_active , n_eng , n_fan , fc_Diesel CI, n_wh_left , n_wh_right , tq_left , tq_right
0.25 , 0 , 0 , 1 , 600 , 1000 , 1278.2425 , 0 , 0 , 0 , 0
1 , 0 , 0 , 1 , 600 , 1000 , 1278.2425 , 0 , 0 , 0 , 0
1.75 , 0 , 0 , 1 , 600 , 1000 , 1278.2425 , 0 , 0 , 0 , 0
......
<t> [s],<v> [km/h],<n_eng> [rpm],<n_fan> [rpm],<tq_left> [Nm],<tq_right> [Nm],<n_wh_left> [rpm],<n_wh_right> [rpm],<fc> [g/h],<gear>
<t> [s],<v> [km/h],<n_eng> [rpm],<n_fan> [rpm],<tq_left> [Nm],<tq_right> [Nm],<n_wh_left> [rpm],<n_wh_right> [rpm],<fc_NG PI> [g/h],<gear>
0,0,599.72,727.3,319.1147826,429.8065217,0.78,0.78,836,3
0.5,0,600.29,727.3,316.7856522,430.0626087,0.7832,0.78,836,3
1,0,600.1,726.912,319.9513043,430.8052174,0.78,0.78,836,3
......
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