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 f85e6ba4 authored by Harald Martini's avatar Harald Martini
Browse files

implemented some checks in VectoRun as methods which are overriden in VectoMockupRun

parent 638b7a54
No related branches found
No related tags found
No related merge requests found
......@@ -81,6 +81,10 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
public IVehicleContainer GetContainer() => Container;
public virtual bool CalculateAggregateValues()
{
return !(GetContainer().RunData.Exempted || GetContainer().RunData.MultistageRun);
}
public void Run()
{
if (Container.RunStatus != Status.Pending) {
......@@ -119,7 +123,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
Container.AbsTime = AbsTime;
}
} while (response is ResponseSuccess);
if (!(GetContainer().RunData.Exempted || GetContainer().RunData.MultistageRun)) {
if (CalculateAggregateValues()) {
//foreach (var fuel in GetContainer().RunData.EngineData.Fuels) {
// calculate vehicleline correction here in local thread context because writing sum-data and
// report afterwards is synchronized
......@@ -165,12 +169,16 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
throw ex;
}
if (Container.RunData.Exempted || Container.RunData.MultistageRun)
Container.RunStatus = Status.Success;
else if (CyclePort.Progress < 1)
Container.RunStatus = response is ResponseBatteryEmpty ? Status.REESSEmpty : Status.Aborted;
else
if (CheckCyclePortProgress()) {
if (CyclePort.Progress < 1) {
Container.RunStatus = response is ResponseBatteryEmpty ? Status.REESSEmpty : Status.Aborted;
} else {
Container.RunStatus = Status.Success;
}
} else {
Container.RunStatus = Status.Success;
}
Container.FinishSimulationRun();
WritingResultsDone = true;
if (Progress.IsSmaller(1, 1e-9)) {
......@@ -188,6 +196,11 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
Log.Info("VectoJob finished.");
}
protected virtual bool CheckCyclePortProgress()
{
return !Container.RunData.Exempted && !Container.RunData.MultistageRun;
}
public bool PostProcessingDone { get; protected set; }
public bool WritingResultsDone { get; protected set; }
......
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