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

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

added missing Engine to tests

parent 0cbc25f4
No related branches found
No related tags found
No related merge requests found
......@@ -43,6 +43,7 @@ using TUGraz.VectoCore.Models.SimulationComponent.Data;
using TUGraz.VectoCore.Models.SimulationComponent.Impl;
using TUGraz.VectoCore.OutputData;
using TUGraz.VectoCore.OutputData.FileIO;
using TUGraz.VectoCore.Tests.Models.SimulationComponent;
using TUGraz.VectoCore.Tests.Utils;
// ReSharper disable ObjectCreationAsStatement
......@@ -90,6 +91,8 @@ namespace TUGraz.VectoCore.Tests.Models.Simulation
var t = 0.SI<Second>();
var dt = 1.SI<Second>();
new MockEngine(container);
aux.Initialize(torque, speed);
for (var i = 0; i < 11; i++) {
aux.PowerDemand(t, dt, torque, torque, speed);
......@@ -105,7 +108,7 @@ namespace TUGraz.VectoCore.Tests.Models.Simulation
var testColumns = new[] { "P_aux_FAN", "P_aux_STP", "P_aux_AC", "P_aux_ES", "P_aux_PS", "P_aux" };
ResultFileHelper.TestModFile(@"TestData\Results\EngineOnlyCycles\40t_Long_Haul_Truck_Long_Haul_Empty Loading.vmod",
ResultFileHelper.TestModFile(@"TestData\Results\EngineOnlyCycles\AuxWriteModFileSumFile.vmod",
@"AuxWriteModFileSumFile.vmod", testColumns, testVelocity: false);
ResultFileHelper.TestSumFile(@"TestData\Results\EngineOnlyCycles\AuxWriteModFileSumFile.vsum",
@"AuxWriteModFileSumFile.vsum");
......
......@@ -126,7 +126,7 @@ namespace TUGraz.VectoCore.Tests.Models.Simulation
Assert.IsTrue(run.Run.FinishedWithoutErrors, string.Format("{0}", run.ExecException));
}
ResultFileHelper.TestSumFile(@"TestData\Results\EngineOnlyCycles\24t Coach.vsum",
ResultFileHelper.TestSumFile(@"TestData\Results\EngineOnlyCycles\24t Coach EngineOnly.vsum",
@"TestData\Jobs\24t Coach EngineOnly.vsum");
ResultFileHelper.TestModFiles(new[] {
......
......@@ -35,6 +35,7 @@ using NUnit.Framework;
using Org.BouncyCastle.Asn1.Esf;
using TUGraz.VectoCommon.Models;
using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore.Models.Simulation.Data;
using TUGraz.VectoCore.Models.Simulation.DataBus;
using TUGraz.VectoCore.Models.Simulation.Impl;
using TUGraz.VectoCore.Models.SimulationComponent;
......@@ -173,12 +174,25 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent
protected override void DoWriteModalResults(IModalDataContainer container)
{
throw new System.NotImplementedException();
container[ModalResultField.P_eng_fcmap] = 0.SI<Watt>();
container[ModalResultField.P_eng_out] = 0.SI<Watt>();
container[ModalResultField.P_eng_inertia] = 0.SI<Watt>();
container[ModalResultField.n_eng_avg] = 0.SI<PerSecond>();
container[ModalResultField.T_eng_fcmap] = 0.SI<NewtonMeter>();
container[ModalResultField.P_eng_full] = 0.SI<Watt>();
container[ModalResultField.P_eng_drag] = 0.SI<Watt>();
container[ModalResultField.Tq_full] = 0.SI<NewtonMeter>();
container[ModalResultField.Tq_drag] = 0.SI<NewtonMeter>();
container[ModalResultField.FCMap] = 0.SI<KilogramPerSecond>();
container[ModalResultField.FCAUXc] = 0.SI<KilogramPerSecond>();
container[ModalResultField.FCWHTCc] = 0.SI<KilogramPerSecond>();
container[ModalResultField.FCAAUX] = 0.SI<KilogramPerSecond>();
container[ModalResultField.FCFinal] = 0.SI<KilogramPerSecond>();
}
protected override void DoCommitSimulationStep()
{
throw new System.NotImplementedException();
}
protected override void DoCommitSimulationStep() {}
}
}
\ No newline at end of file
......@@ -36,6 +36,7 @@ using TUGraz.VectoCore.Models.Simulation.Data;
using TUGraz.VectoCore.Models.Simulation.Impl;
using TUGraz.VectoCore.OutputData;
using TUGraz.VectoCore.OutputData.FileIO;
using TUGraz.VectoCore.Tests.Models.SimulationComponent;
using TUGraz.VectoCore.Utils;
namespace TUGraz.VectoCore.Tests.Reports
......@@ -50,7 +51,7 @@ namespace TUGraz.VectoCore.Tests.Reports
var sumWriter = new SummaryDataContainer(writer);
var modData = new ModalDataContainer("testsumcalc_fixed", writer);
modData.AddAuxiliary("FAN");
for (var i = 0; i < 500; i++) {
......@@ -70,6 +71,8 @@ namespace TUGraz.VectoCore.Tests.Reports
modData[ModalResultField.acc] = 0.SI<MeterPerSquareSecond>();
modData[ModalResultField.P_eng_out] = (i % 2 == 0 ? 1 : -1) * 3000.SI<Watt>();
modData[ModalResultField.P_eng_fcmap] = 0.SI<Watt>();
modData.CommitSimulationStep();
}
......@@ -122,6 +125,9 @@ namespace TUGraz.VectoCore.Tests.Reports
modData[ModalResultField.altitude] = 0.SI<Meter>();
modData[ModalResultField.acc] = 0.SI<MeterPerSquareSecond>();
modData[ModalResultField.P_eng_out] = (i % 2 == 0 ? 1 : -1) * powerDemand[i % powerDemand.Length];
modData[ModalResultField.P_eng_fcmap] = 0.SI<Watt>();
modData.CommitSimulationStep();
}
......
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