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

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

DebugData

parent 5a856f27
No related branches found
No related tags found
No related merge requests found
......@@ -102,10 +102,11 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
Initialize();
IResponse response;
var iterationCount = 0;
try {
do {
response = DoSimulationStep();
DebugData.Clear();
debug.Add($"[VR.R] ---- ITERATION {iterationCount++} ---- ", response);
if (response is ResponseSuccess) {
Container.CommitSimulationStep(AbsTime, dt);
......@@ -165,11 +166,12 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
throw ex;
}
Container.RunStatus = Container.RunData.Exempted || Container.RunData.MultistageRun
? Status.Success
: CyclePort.Progress < 1
? (response is ResponseBatteryEmpty ? Status.REESSEmpty : Status.Aborted)
: Status.Success;
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
Container.RunStatus = Status.Success;
Container.FinishSimulationRun();
WritingResultsDone = true;
if (Progress.IsSmaller(1, 1e-9) && !(response is ResponseBatteryEmpty)) {
......
......@@ -1263,7 +1263,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
DataBus.Brakes.BrakePower = 0.SI<Watt>();
response = Driver.DrivingActionBrake(absTime, ds, DriverStrategy.BrakeTrigger.NextTargetSpeed,
gradient, targetDistance: targetDistance);
debug.Add("[DMB-DB-4] Brake", response);
debug.Add($"[DMB-DB-4-{i}] Brake", response);
}
if (response == null) {
......
......@@ -51,6 +51,9 @@ namespace TUGraz.VectoCore.Utils
public DebugData(bool globalDebug = true) => _globalDebug = globalDebug;
[Conditional("DEBUG")]
public static void Clear() => GlobalData.Clear();
[Conditional("DEBUG")]
public void Add(dynamic value)
{
......
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