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 7d9122cb authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

disable logging when searching for idling speed

parent c368c52e
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Resources;
using NLog;
using TUGraz.VectoCore.Configuration;
using TUGraz.VectoCore.Exceptions;
using TUGraz.VectoCore.Models.Connector.Ports;
......@@ -528,6 +529,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
private IResponse SearchIdlingSpeed(Second absTime, Second dt, NewtonMeter torque, PerSecond angularSpeed,
ResponseUnderload responseUnderload)
{
Log.Info("Disabling logging during search idling speed");
LogManager.DisableLogging();
var prevEngineSpeed = Engine.PreviousState.EngineSpeed;
var searchInterval = Constants.SimulationSettings.EngineIdlingSearchInterval;
......@@ -549,6 +553,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
delta = response.DeltaDragLoad;
debug.Add(new { engineSpeed = nextAngularSpeed, searchInterval, delta });
if (delta.IsEqual(0.SI<Watt>(), Constants.SimulationSettings.EnginePowerSearchTolerance)) {
LogManager.EnableLogging();
Log.Debug("found operating point in {0} iterations. engine speed: {1}, delta: {2}", retryCount, nextAngularSpeed,
delta);
return RequestPort.Request(absTime, dt, torque, nextAngularSpeed);
......@@ -560,6 +565,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
searchInterval *= intervalFactor;
} while (retryCount++ < Constants.SimulationSettings.EngineSearchLoopThreshold);
LogManager.EnableLogging();
Log.Warn("Exceeded max iterations when searching for idling point!");
Log.Warn("acceleration: {0} ... {1}", ", ".Join(debug.Take(5).Select(x => x.acceleration)),
", ".Join(debug.Slice(-6).Select(x => x.acceleration)));
......
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