From 71f140254bb67df6cdfd89dfd99f63546b362bbe Mon Sep 17 00:00:00 2001
From: Markus Quaritsch <markus.quaritsch@tugraz.at>
Date: Wed, 11 Nov 2015 12:20:29 +0100
Subject: [PATCH] more verbose logging in driver model

---
 .../Data/Gearbox/TransmissionLossMap.cs                |  1 +
 VectoCore/Models/SimulationComponent/Impl/Driver.cs    | 10 ++++++----
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/VectoCore/Models/SimulationComponent/Data/Gearbox/TransmissionLossMap.cs b/VectoCore/Models/SimulationComponent/Data/Gearbox/TransmissionLossMap.cs
index d855f87647..5364dd3ace 100644
--- a/VectoCore/Models/SimulationComponent/Data/Gearbox/TransmissionLossMap.cs
+++ b/VectoCore/Models/SimulationComponent/Data/Gearbox/TransmissionLossMap.cs
@@ -129,6 +129,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox
 			} catch (VectoException) {
 				Log.Error("{0} - Failed to interpolate in TransmissionLossMap. angularVelocity: {1}, torque: {2}", GearName,
 					inAngularVelocity, outTorque);
+
 				return outTorque / _ratio;
 			}
 		}
diff --git a/VectoCore/Models/SimulationComponent/Impl/Driver.cs b/VectoCore/Models/SimulationComponent/Impl/Driver.cs
index ceaf1e58e2..26b901877e 100644
--- a/VectoCore/Models/SimulationComponent/Impl/Driver.cs
+++ b/VectoCore/Models/SimulationComponent/Impl/Driver.cs
@@ -74,7 +74,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
 		public IResponse Request(Second absTime, Meter ds, MeterPerSecond targetVelocity, Radian gradient)
 		{
 			VehicleStopped = false;
-			Log.Debug("==== DRIVER Request ====");
+			Log.Debug("==== DRIVER Request (distance) ====");
 			Log.Debug(
 				"Request: absTime: {0},  ds: {1}, targetVelocity: {2}, gradient: {3} | distance: {4}, velocity: {5}, vehicle stopped: {6}",
 				absTime, ds, targetVelocity, gradient, DataBus.Distance, DataBus.VehicleSpeed, VehicleStopped);
@@ -93,7 +93,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
 		public IResponse Request(Second absTime, Second dt, MeterPerSecond targetVelocity, Radian gradient)
 		{
 			VehicleStopped = true;
-			Log.Debug("==== DRIVER Request ====");
+			Log.Debug("==== DRIVER Request (time) ====");
 			Log.Debug(
 				"Request: absTime: {0},  dt: {1}, targetVelocity: {2}, gradient: {3} | distance: {4}, velocity: {5} gear: {6}: vehicle stopped: {7}",
 				absTime, dt, targetVelocity, gradient, DataBus.Distance, DataBus.VehicleSpeed, DataBus.Gear, VehicleStopped);
@@ -720,9 +720,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
 					retVal.SimulationInterval = ds / currentSpeed;
 					return retVal;
 				}
-				Log.Error("vehicle speed is {0}, acceleration is {1}", currentSpeed.Value(), acceleration.Value());
+				Log.Error("{2}: vehicle speed is {0}, acceleration is {1}", currentSpeed.Value(), acceleration.Value(),
+					DataBus.Distance);
 				throw new VectoSimulationException(
-					"vehicle speed has to be > 0 if acceleration = 0!  v: {0}, a: {1}", currentSpeed.Value(), acceleration.Value());
+					"vehicle speed has to be > 0 if acceleration = 0!  v: {0}, a: {1}, distance: ", currentSpeed.Value(),
+					acceleration.Value(), DataBus.Distance);
 			}
 
 			// we need to accelerate / decelerate. solve quadratic equation...
-- 
GitLab