private void ReflashData(IMUData data) { labelData.Text = ""; labelData.Text = imuData.ToString(); if (imuData.SingleNode.Eul != null) { // attitudeIndicatorInstrumentControl1.SetAttitudeIndicatorParameters(-(double)imuData.SingleNode.Eul[1], (double)imuData.SingleNode.Eul[0]); int aircraftHeading = 0; try { aircraftHeading = Convert.ToInt16(imuData.SingleNode.Eul[2]); } catch { } // dual to headingIndicatorInstrumentControl1 error, use the negnate number aircraftHeading = -aircraftHeading; if (aircraftHeading < 0) { aircraftHeading += 360; } // headingIndicatorInstrumentControl1.SetHeadingIndicatorParameters(aircraftHeading); } // altimeterInstrumentControl1.SetAlimeterParameters(Convert.ToInt32(Pa)); // airSpeedIndicatorInstrumentControl1.SetAirSpeedIndicatorParameters(SampleCounter.SampleRate); label7.Text = "帧率: " + SampleCounter.SampleRate.ToString() + "Hz"; }
private void OnKbootDecoderDataReceived(object sender, byte[] buf, int len) { device_data = IMUData.Decode(buf, len); fmTermial.Input(device_data.ToString()); }