Example #1
0
        static void readmessage(object item)
        {
            ConfigAccelerometerCalibrationQuad local = (ConfigAccelerometerCalibrationQuad)item;

            // clean up history
            MainV2.comPort.MAV.cs.messages.Clear();

            while (!(MainV2.comPort.MAV.cs.message.ToLower().Contains("calibration successful") || MainV2.comPort.MAV.cs.message.ToLower().Contains("calibration failed")))
            {
                try
                {
                    System.Threading.Thread.Sleep(10);
                    // read the message
                    MainV2.comPort.readPacket();
                    // update cs with the message
                    MainV2.comPort.MAV.cs.UpdateCurrentSettings(null);
                    // update user display
                    local.UpdateUserMessage();
                }
                catch { break; }
            }

            MainV2.comPort.giveComport = false;

            try
            {
                local.Invoke((MethodInvoker) delegate()
                {
                    local.BUT_calib_accell.Text    = "Done";
                    local.BUT_calib_accell.Enabled = false;
                });
            }
            catch { }
        }
Example #2
0
        static void readmessage(object item)
        {
            ConfigAccelerometerCalibrationQuad local = (ConfigAccelerometerCalibrationQuad)item;

            while (!(MainV2.cs.message.Contains("Calibration successful") || MainV2.cs.message.Contains("Calibration failed")))
            {
                System.Threading.Thread.Sleep(10);
                // read the message
                MainV2.comPort.readPacket();
                // update cs with the message
                MainV2.cs.UpdateCurrentSettings(null);
                // update user display
                local.UpdateUserMessage();
            }

            MainV2.giveComport = false;

            local.Invoke((MethodInvoker) delegate()
            {
                local.BUT_calib_accell.Text = "Done";
            });
        }