From 3ea516ef8c4b6e6da5c0e762e825efb8532a22ef Mon Sep 17 00:00:00 2001 From: Michael Krisper <michael.krisper@tugraz.at> Date: Thu, 7 Oct 2021 20:28:34 +0200 Subject: [PATCH] PCCSegmentPreProcessor: changed to debug.writeline to console.writeline with conditional("DEBUG") --- .../Models/Simulation/Impl/PCCSegmentPreprocessor.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/VectoCore/VectoCore/Models/Simulation/Impl/PCCSegmentPreprocessor.cs b/VectoCore/VectoCore/Models/Simulation/Impl/PCCSegmentPreprocessor.cs index 967230e8a6..bd2402ec2c 100644 --- a/VectoCore/VectoCore/Models/Simulation/Impl/PCCSegmentPreprocessor.cs +++ b/VectoCore/VectoCore/Models/Simulation/Impl/PCCSegmentPreprocessor.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Diagnostics; using System.Linq; using TUGraz.VectoCommon.InputData; @@ -30,8 +31,8 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl var maxSpeed = VectoMath.Max(Container.VehicleInfo.MaxVehicleSpeed, Container.RunData.Cycle.Entries.Max(x => x.VehicleTargetSpeed)); var preProcessor = new PCCEcoRollEngineStopPreprocessor(Container, slopes, PCCDriverData.MinSpeed, maxSpeed); preProcessor.RunPreprocessing(); - - Debug.WriteLine("Slopes:\n" + string.Join("\n", slopes.Select(p => $"{p.Key.Value()}\t{p.Value.Value()}"))); + + DebugWriteLine("Slopes:\n" + string.Join("\n", slopes.Select(p => $"{p.Key.Value():F}\t{Math.Tan(p.Value.Value()):P}"))); var runData = Container.RunData; @@ -119,6 +120,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl } } } - + [Conditional("DEBUG")] + private static void DebugWriteLine(object value) => Console.WriteLine(value); } } -- GitLab