diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/HybridController.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/HybridController.cs index 6cefbecddff4cec580737f5b0de692f66e4e0f86..f1eac30799b5c239bce548092c401ace9514fff4 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/HybridController.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/HybridController.cs @@ -147,8 +147,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl CurrentStrategySettings = strategySettings; retVal = NextComponent.Request(absTime, dt, outTorque, outAngularVelocity, dryRun); - DebugData.Add("HC.R", new { - DrivingAction = DataBus.DriverInfo.DrivingAction, + DebugData.Add($"HC.R-{retryCount}", new { + DataBus.DriverInfo.DrivingAction, StrategySettings = strategySettings, Response = retVal, DryRun = dryRun diff --git a/VectoCore/VectoCore/Utils/DebugData.cs b/VectoCore/VectoCore/Utils/DebugData.cs index 707422c1575ca6776bcacb4de2acfb3f79a63827..377097346fe503ec16f1fc0bd7fce342c927663f 100644 --- a/VectoCore/VectoCore/Utils/DebugData.cs +++ b/VectoCore/VectoCore/Utils/DebugData.cs @@ -42,11 +42,12 @@ namespace TUGraz.VectoCore.Utils private static readonly ThreadLocal<Queue<dynamic>> _data = new ThreadLocal<Queue<dynamic>>( () => new Queue<dynamic>(Capacity)); - private readonly Queue<dynamic> _localData = new Queue<dynamic>(); - private readonly bool _globalDebug; - internal Queue<dynamic> Data => _globalDebug ? _data.Value : _localData; + internal Queue<dynamic> Data => _globalDebug ? GlobalData : LocalData; + + internal static Queue<dynamic> GlobalData => _data.Value; + internal Queue<dynamic> LocalData { get; } = new Queue<dynamic>(); public DebugData(bool globalDebug = true) => _globalDebug = globalDebug; diff --git a/VectoCore/VectoCore/Utils/SearchAlgorithm.cs b/VectoCore/VectoCore/Utils/SearchAlgorithm.cs index bbb43bfa5823e3ac6aaefb29c92e3d00c2e25a01..4e0058bf987127f34bb02c27b62c2fc409dfaf1e 100644 --- a/VectoCore/VectoCore/Utils/SearchAlgorithm.cs +++ b/VectoCore/VectoCore/Utils/SearchAlgorithm.cs @@ -125,7 +125,7 @@ namespace TUGraz.VectoCore.Utils var intervalFactor = 1.0; var origY = y; - var debug = new DebugData(false); + var debug = new DebugData(); debug.Add(new { x = x.Value(), y = y.Value() }); log.Debug("Log Disabled during LineSearch."); LogManager.DisableLogging(); @@ -208,7 +208,7 @@ namespace TUGraz.VectoCore.Utils log.Debug("Log Disabled during InterpolateSearch."); LogManager.DisableLogging(); - var debug = new DebugData(false); + var debug = new DebugData(); debug.Add(new { x = x1, y = y1 }); try {