MissionPlanner.MagCalib.ProcessLog C# (CSharp) Method

ProcessLog() public static method

Self contained process tlog and save/display offsets
public static ProcessLog ( int throttleThreshold ) : void
throttleThreshold int
return void
        public static void ProcessLog(int throttleThreshold = 0)
        {
            using (OpenFileDialog openFileDialog1 = new OpenFileDialog())
            {
                openFileDialog1.Filter = "Log Files|*.tlog;*.log;*.bin";
                openFileDialog1.FilterIndex = 2;
                openFileDialog1.RestoreDirectory = true;
                openFileDialog1.Multiselect = true;
                try
                {
                    openFileDialog1.InitialDirectory = Settings.Instance.LogDir + Path.DirectorySeparatorChar;
                }
                catch
                {
                } // incase dir doesnt exist

                if (openFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    try
                    {
                        double[] ans;

                        if (openFileDialog1.FileName.ToLower().EndsWith("tlog"))
                        {
                            ans = getOffsets(openFileDialog1.FileName, throttleThreshold);
                        }
                        else
                        {
                            ans = getOffsetsLog(openFileDialog1.FileName);
                        }

                        if (ans.Length != 1)
                            SaveOffsets(ans);
                    }
                    catch (Exception ex)
                    {
                        log.Debug(ex.ToString());
                    }
                }
            }
        }

Usage Example

Exemplo n.º 1
0
 private void BUT_magfit2_Click(object sender, EventArgs e)
 {
     MagCalib.ProcessLog(0);
 }
All Usage Examples Of MissionPlanner.MagCalib::ProcessLog