private static HelicopterLogSnapshot ParseSample(XmlNode sampleNode) { var result = new HelicopterLogSnapshot { Estimated = ParsePhysicalHeliState(sampleNode, "Estimated"), BlindEstimated = ParsePhysicalHeliState(sampleNode, "BlindEstimated"), True = ParsePhysicalHeliState(sampleNode, "True"), Time = TimeSpan.FromSeconds(double.Parse(sampleNode.SelectSingleNode("Seconds").InnerText)), Accelerometer = ParseFRU(sampleNode.SelectSingleNode("Accelerometer")), GroundAltitude = float.Parse(sampleNode.SelectSingleNode("GroundAltitude").InnerText), }; var observedNode = sampleNode.SelectSingleNode("Observed"); if (observedNode != null) result.Observed = ParsePhysicalHeliState(sampleNode, "Observed"); return result; }
public void Add(HelicopterLogSnapshot snapshot) { // GPS observations only occur every 1 second, so ignore Vector3.Zero positions (not 100% safe, but close enough) // Note uncomment this to add GPS observations to live flight log window // if (snapshot.Observed.Position != Vector3.Zero) // AppendLineXZ(_observedGraph, snapshot.Observed.Position); AppendLineXZ(_estimatedGraph, snapshot.Estimated.Position); AppendLineXZ(_blindEstimatedGraph, snapshot.BlindEstimated.Position); AppendLineXZ(_trueGraph, snapshot.True.Position); double seconds = snapshot.Time.TotalSeconds; AppendLine(_helicopterHeightGraph, seconds, snapshot.True.Position.Y); AppendLine(_estimatedHelicopterHeightGraph, seconds, snapshot.Estimated.Position.Y); AppendLine(_groundHeightGraph, seconds, snapshot.GroundAltitude); AppendLine(_accelForwardGraph, seconds, snapshot.Accelerometer.Forward); AppendLine(_accelRightGraph, seconds, snapshot.Accelerometer.Right); AppendLine(_accelUpGraph, seconds, snapshot.Accelerometer.Up); AddGraphsToChartsIfNecessary(); // TODO Force area to show 500 samples of width even if we have less than 500 samples to plot // _heightChart.PlotAreaOverride = new Rect(_heightChart.P); _positionChart.RedrawPlotLines(); _heightChart.RedrawPlotLines(); _accelerometerChart.RedrawPlotLines(); }
private void AddPlot(HelicopterLogSnapshot snapshot) { double seconds = snapshot.Time.TotalSeconds; // GPS observations only occur every 1 second, so ignore Vector3.Zero positions (not 100% safe, but close enough) // Note uncomment this to add GPS observations if (snapshot.Observed.Position != Vector3.Zero) { _gpsMarkers.AddPoint(new ChartPoint("", new Point(snapshot.Observed.Position.X, snapshot.Observed.Position.Z))); _gpsMarkersAltitude.AddPoint(new ChartPoint("", new Point(seconds, snapshot.Observed.Position.Y))); } AppendLineXZ(_estimatedGraph, snapshot.Estimated.Position); AppendLineXZ(_blindEstimatedGraph, snapshot.BlindEstimated.Position); AppendLineXZ(_trueGraph, snapshot.True.Position); AppendLine(_helicopterHeightGraph, seconds, snapshot.True.Position.Y); AppendLine(_estimatedHelicopterHeightGraph, seconds, snapshot.Estimated.Position.Y); AppendLine(_groundHeightGraph, seconds, snapshot.GroundAltitude); AppendLine(_accelForwardGraph, seconds, snapshot.Accelerometer.Forward); AppendLine(_accelRightGraph, seconds, snapshot.Accelerometer.Right); AppendLine(_accelUpGraph, seconds, snapshot.Accelerometer.Up); }