private void clearLines() { SpeedChart.clearData(); OffsetChart.clearData(); AccelerationChart.clearData(); BrakeChart.clearData(); FollowChart.clearData(); }
private void hideMarkers() { SpeedChart.HideMarkers(); OffsetChart.HideMarkers(); AccelerationChart.HideMarkers(); BrakeChart.HideMarkers(); FollowChart.HideMarkers(); }
private void showMarkers() { SpeedChart.ShowMarkers(); OffsetChart.ShowMarkers(); AccelerationChart.ShowMarkers(); BrakeChart.ShowMarkers(); FollowChart.ShowMarkers(); }
private void clearChart() { SpeedChart.clearData(); LittleSpeed.clearData(); AccelerationChart.clearData(); LittleAcc.clearData(); OffsetChart.clearData(); LittleOffset.clearData(); BrakeChart.clearData(); FollowChart.clearData(); LittleFollow.clearData(); }
private void changeChartsVisible(int chartMode, bool visible) { if (bars != null && bars.Children != null) { foreach (BarChart chart in bars.Children) { if (chart != null) { chart.setBarVisible(chartMode, visible); } } } SpeedChart.setLineVisible(chartMode, visible); OffsetChart.setLineVisible(chartMode, visible); AccelerationChart.setLineVisible(chartMode, visible); BrakeChart.setLineVisible(chartMode, visible); FollowChart.setLineVisible(chartMode, visible); }
// distance oriented private void plotMarks() { if (currentScene == UserSelections.ScenePractice) { return; } SimulatedVehicle top = new SimulatedVehicle(); SimulatedVehicle bottom = new SimulatedVehicle(); int count = 0; int index; ExperienceUnit unit = null; foreach (int mode in UserSelections.ModeList) { index = user.Index[UserSelections.getIndex(currentScene, mode)]; if (index != -1) { unit = user.Experiences[index]; foreach (PropertyInfo p in top.GetType().GetProperties()) { if ((float)p.GetValue(unit.Top) > (float)p.GetValue(top)) { p.SetValue(top, (float)p.GetValue(unit.Top)); } if ((float)p.GetValue(unit.Bottom) < (float)p.GetValue(bottom)) { p.SetValue(bottom, (float)p.GetValue(unit.Bottom)); } } ++count; } } if (count != 0) { foreach (DistractMark mark in unit.Marks) { float start = mark.Start.TotalDistance; float end = mark.End.TotalDistance; SpeedChart.AddAMarker(new List <Point>() { new Point(start, top.Speed), new Point(start, bottom.Speed), new Point(end, bottom.Speed), new Point(end, top.Speed), new Point(start, top.Speed) }); OffsetChart.AddAMarker(new List <Point>() { new Point(start, top.Offset), new Point(start, bottom.Offset), new Point(end, bottom.Offset), new Point(end, top.Offset), new Point(start, top.Offset) }); AccelerationChart.AddAMarker(new List <Point>() { new Point(start, top.Acceleration), new Point(start, bottom.Acceleration), new Point(end, bottom.Acceleration), new Point(end, top.Acceleration), new Point(start, top.Acceleration) }); BrakeChart.AddAMarker(new List <Point>() { new Point(start, top.BrakePedal), new Point(start, bottom.BrakePedal), new Point(end, bottom.BrakePedal), new Point(end, top.BrakePedal), new Point(start, top.BrakePedal) }); FollowChart.AddAMarker(new List <Point>() { new Point(start, top.DistanceToNext), new Point(start, bottom.DistanceToNext), new Point(end, bottom.DistanceToNext), new Point(end, top.DistanceToNext), new Point(start, top.DistanceToNext) }); } } if (showMark && axis == 1) { showMarkers(); } else { hideMarkers(); } }
private void plotExperienceLine(int _mode, int indexOfSelection) { Dispatcher dispatcher = PageList.Main.Dispatcher; ExperienceUnit unit = user.Experiences[user.Index[indexOfSelection]]; List <SimulatedVehicle> list = unit.Vehicles; SpeedChart.Init.AppendAsync(dispatcher, new Point(0, unit.Top.Speed)); OffsetChart.Init.AppendAsync(dispatcher, new Point(0, unit.Top.Offset)); AccelerationChart.Init.AppendAsync(dispatcher, new Point(0, unit.Top.Acceleration)); BrakeChart.Init.AppendAsync(dispatcher, new Point(0, unit.Top.BrakePedal)); FollowChart.Init.AppendAsync(dispatcher, new Point(0, unit.Top.DistanceToNext)); SpeedChart.Init.AppendAsync(dispatcher, new Point(0, unit.Bottom.Speed)); OffsetChart.Init.AppendAsync(dispatcher, new Point(0, unit.Bottom.Offset)); AccelerationChart.Init.AppendAsync(dispatcher, new Point(0, unit.Bottom.Acceleration)); BrakeChart.Init.AppendAsync(dispatcher, new Point(0, unit.Bottom.BrakePedal)); FollowChart.Init.AppendAsync(dispatcher, new Point(0, unit.Bottom.DistanceToNext)); switch (axis) { case 0: SpeedChart.Init.AppendAsync(dispatcher, new Point(unit.Right.SimulationTime, 0)); OffsetChart.Init.AppendAsync(dispatcher, new Point(unit.Right.SimulationTime, 0)); AccelerationChart.Init.AppendAsync(dispatcher, new Point(unit.Right.SimulationTime, 0)); BrakeChart.Init.AppendAsync(dispatcher, new Point(unit.Right.SimulationTime, 0)); FollowChart.Init.AppendAsync(dispatcher, new Point(unit.Right.SimulationTime, 0)); break; case 1: SpeedChart.Init.AppendAsync(dispatcher, new Point(unit.Right.TotalDistance, 0)); OffsetChart.Init.AppendAsync(dispatcher, new Point(unit.Right.TotalDistance, 0)); AccelerationChart.Init.AppendAsync(dispatcher, new Point(unit.Right.TotalDistance, 0)); BrakeChart.Init.AppendAsync(dispatcher, new Point(unit.Right.TotalDistance, 0)); FollowChart.Init.AppendAsync(dispatcher, new Point(unit.Right.TotalDistance, 0)); break; default: return; } foreach (SimulatedVehicle vehicle in list) { float x; switch (axis) { case 0: x = vehicle.SimulationTime; break; case 1: x = vehicle.TotalDistance; break; default: return; } SpeedChart.addRealTimePoint(_mode, new Point(x, vehicle.Speed)); OffsetChart.addRealTimePoint(_mode, new Point(x, vehicle.Offset)); AccelerationChart.addRealTimePoint(_mode, new Point(x, vehicle.Acceleration)); BrakeChart.addRealTimePoint(_mode, new Point(x, vehicle.BrakePedal)); FollowChart.addRealTimePoint(_mode, new Point(x, vehicle.DistanceToNext)); } }