Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit adbdd991 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

show actual values without rounding

parent 87bd32e6
No related branches found
No related tags found
No related merge requests found
......@@ -492,7 +492,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
// braking power is in the range of the exceeding delta. set searching range to 2/3 so that
// the target point is approximately in the center of the second interval
var searchInterval = origDelta.Abs() * 2 / 3;
debug.Add(new { brakePower = 0.SI<Watt>(), searchInterval, delta = origDelta, operatingPoint });
var brakePower = searchInterval * -origDelta.Sign();
......@@ -728,9 +728,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
retVal.SimulationInterval = ds / currentSpeed;
return retVal;
}
Log.Error("vehicle speed is {0}, acceleration is {1}", currentSpeed, acceleration);
Log.Error("vehicle speed is {0}, acceleration is {1}", currentSpeed.Value(), acceleration.Value());
throw new VectoSimulationException(
"vehicle speed has to be > 0 if acceleration = 0! v: {0}", currentSpeed);
"vehicle speed has to be > 0 if acceleration = 0! v: {0}, a: {1}", currentSpeed.Value(), acceleration.Value());
}
// we need to accelerate / decelerate. solve quadratic equation...
......@@ -777,7 +777,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
public IResponse DrivingActionHalt(Second absTime, Second dt, MeterPerSecond targetVelocity, Radian gradient)
{
if (!targetVelocity.IsEqual(0) || !DataBus.VehicleSpeed.IsEqual(0, 1e-3)) {
throw new NotImplementedException("TargetVelocity or VehicleVelocity is not zero!");
throw new NotImplementedException(string.Format(
"TargetVelocity or VehicleVelocity is not zero! v: {0} target: {1}", DataBus.VehicleSpeed.Value(),
targetVelocity.Value()));
}
DataBus.BreakPower = Double.PositiveInfinity.SI<Watt>();
var retVal = NextComponent.Request(absTime, dt, 0.SI<MeterPerSquareSecond>(), gradient);
......
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