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