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

Skip to content
Snippets Groups Projects
Commit 0b774576 authored by Michael KRISPER's avatar Michael KRISPER
Browse files

reverted distance check

parent a83ed485
No related branches found
No related merge requests found
......@@ -298,17 +298,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
protected override void DoWriteModalResults(IModalDataContainer container)
{
// sanity check: is the vehicle in step with the cycle?
if (container[ModalResultField.dist] == DBNull.Value) {
Log.Warn("Distance field is not set!");
} else {
var distance = (SI)container[ModalResultField.dist];
if (!distance.IsEqual(CurrentState.Distance)) {
Log.Warn("Vehicle Distance diverges from Cycle by {0} [m]. Distance: {1}",
(distance - CurrentState.Distance).Value(), distance);
}
}
container[ModalResultField.dist] = CurrentState.Distance; // (CurrentState.Distance + PreviousState.Distance) / 2.0;
container[ModalResultField.simulationDistance] = CurrentState.SimulationDistance;
container[ModalResultField.v_targ] = CurrentState.VehicleTargetSpeed;
......
......@@ -174,7 +174,16 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
container[ModalResultField.P_slope] = CurrentState.SlopeResistance * averageVelocity;
container[ModalResultField.P_trac] = CurrentState.VehicleTractionForce * averageVelocity;
container[ModalResultField.dist] = CurrentState.Distance;
// sanity check: is the vehicle in step with the cycle?
if (container[ModalResultField.dist] == DBNull.Value) {
Log.Warn("Distance field is not set!");
} else {
var distance = (SI)container[ModalResultField.dist];
if (!distance.IsEqual(CurrentState.Distance)) {
Log.Warn("Vehicle Distance diverges from Cycle by {0} [m]. Distance: {1}",
(distance - CurrentState.Distance).Value(), distance);
}
}
}
protected override void DoCommitSimulationStep()
......
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