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

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

extend databus with vehicle's current altitude

parent 4aee7688
No related branches found
No related tags found
No related merge requests found
......@@ -343,5 +343,10 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
{
get { return DrivingCycle.CycleData; }
}
public Meter Altitude
{
get { return DrivingCycle.Altitude; }
}
}
}
\ No newline at end of file
......@@ -29,6 +29,7 @@
* Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology
*/
using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore.Models.SimulationComponent.Data;
namespace TUGraz.VectoCore.Models.SimulationComponent
......@@ -43,5 +44,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent
/// Returns the data samples for the current position in the cycle.
/// </summary>
CycleData CycleData { get; }
Meter Altitude { get; }
}
}
\ No newline at end of file
......@@ -350,7 +350,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
if (cycleIterator.RightSample.VehicleTargetSpeed.IsEqual(velocity)) {
continue;
}
retVal.Add(cycleIterator.RightSample);
retVal.Add(cycleIterator.RightSample); // TODO: MQ 2016-05-13: use clone if iterator here?
velocity = cycleIterator.RightSample.VehicleTargetSpeed;
} while (cycleIterator.MoveNext() && cycleIterator.RightSample.Distance < PreviousState.Distance + lookaheadDistance);
if (retVal.Count > 0) {
......@@ -378,6 +378,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
}
}
public Meter Altitude
{
get { return CurrentState.Altitude; }
}
internal void SetDriveOffDistance(Meter startDistance)
{
while (CycleIntervalIterator.MoveNext() && CycleIntervalIterator.RightSample.Distance < startDistance) {}
......
......@@ -799,7 +799,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
foreach (var kv in _coastData) {
container.SetDataValue(kv.Key, kv.Value);
}
container.SetDataValue("Alt", DataBus.CycleData.LeftSample.Altitude.Value());
container.SetDataValue("Alt", DataBus.Altitude.Value());
container.SetDataValue("DrivingMode", ((DefaultDriverStrategy)DriverStrategy).CurrentDrivingMode);
container.SetDataValue("Action", CurrentAction);
_coastData.Clear();
......
......@@ -215,6 +215,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
};
}
}
public Meter Altitude
{
get { return 0.SI<Meter>(); }
}
}
/// <summary>
......@@ -514,6 +519,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
}
}
public Meter Altitude
{
get { return LeftSample.Current.Altitude; }
}
protected override void DoWriteModalResults(IModalDataContainer container)
{
container[ModalResultField.dist] = CurrentState.Distance;
......
......@@ -74,6 +74,11 @@ namespace TUGraz.VectoCore.Tests.Utils
}
}
public Meter Altitude
{
get { return 0.SI<Meter>(); }
}
protected override void DoWriteModalResults(IModalDataContainer container)
{
container[ModalResultField.dist] = 0.SI<Meter>();
......
......@@ -110,6 +110,7 @@ namespace TUGraz.VectoCore.Tests.Utils
public bool VehicleStopped { get; private set; }
public DrivingBehavior DriverBehavior { get; private set; }
public CycleData CycleData { get; set; }
public Meter Altitude { get; set; }
public ExecutionMode ExecutionMode { get; set; }
public IModalDataContainer ModalData { get; private set; }
public VectoRunData RunData { get; private set; }
......
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