From 27607eacbd1566cd0f54dee00002bdd4a5c72cad Mon Sep 17 00:00:00 2001 From: Michael Oborne Date: Sun, 4 Nov 2012 16:45:39 +0800 Subject: [PATCH] Mission Planner 1.2.17 add nested config page add friendly comport names add some exception handlers add new old firmware hashs remove more crom.controls stuff enabled change speed --- .../3DRRadio/3DRRadio.csproj | 1 + .../Arduino/ArduinoDetect.cs | 4 +- .../ArdupilotMegaPlanner/ArdupilotMega.csproj | 9 - .../Comms/CommsSerialPort.cs | 18 ++ .../Controls/BackstageView/BackstageView.cs | 109 ++++++- .../BackstageView/BackstageViewButton.cs | 2 +- .../Controls/ConnectionControl.Designer.cs | 3 + .../Controls/ConnectionControl.cs | 26 ++ .../Controls/MavlinkCheckBox.cs | 14 +- .../Controls/MavlinkNumericUpDown.cs | 7 +- .../GCSViews/ConfigurationView/Setup.cs | 31 +- .../ArdupilotMegaPlanner/GCSViews/Firmware.cs | 4 +- .../GCSViews/FlightData.Designer.cs | 1 + .../GCSViews/FlightData.cs | 294 +++--------------- .../GCSViews/FlightData.resx | 87 +++--- .../ArdupilotMegaPlanner/GCSViews/Terminal.cs | 7 +- Tools/ArdupilotMegaPlanner/Log.cs | 15 +- Tools/ArdupilotMegaPlanner/Mavlink/MAVLink.cs | 7 + .../Properties/AssemblyInfo.cs | 2 +- 19 files changed, 291 insertions(+), 350 deletions(-) diff --git a/Tools/ArdupilotMegaPlanner/3DRRadio/3DRRadio.csproj b/Tools/ArdupilotMegaPlanner/3DRRadio/3DRRadio.csproj index c97ac464f8..df3d0c548a 100644 --- a/Tools/ArdupilotMegaPlanner/3DRRadio/3DRRadio.csproj +++ b/Tools/ArdupilotMegaPlanner/3DRRadio/3DRRadio.csproj @@ -61,6 +61,7 @@ + diff --git a/Tools/ArdupilotMegaPlanner/Arduino/ArduinoDetect.cs b/Tools/ArdupilotMegaPlanner/Arduino/ArduinoDetect.cs index 015b015201..357d272571 100644 --- a/Tools/ArdupilotMegaPlanner/Arduino/ArduinoDetect.cs +++ b/Tools/ArdupilotMegaPlanner/Arduino/ArduinoDetect.cs @@ -177,14 +177,14 @@ namespace ArdupilotMega.Arduino // all apm 1-1.4 use a ftdi on the imu board. - /* obj2.Properties.ForEach(x => + obj2.Properties.ForEach(x => { try { log.Info(((PropertyData)x).Name.ToString() + " = " + ((PropertyData)x).Value.ToString()); } catch { } - });*/ + }); // check vid and pid if (obj2.Properties["PNPDeviceID"].Value.ToString().Contains(@"USB\VID_2341&PID_0010")) diff --git a/Tools/ArdupilotMegaPlanner/ArdupilotMega.csproj b/Tools/ArdupilotMegaPlanner/ArdupilotMega.csproj index 6cdb691c26..3ba7c16a03 100644 --- a/Tools/ArdupilotMegaPlanner/ArdupilotMega.csproj +++ b/Tools/ArdupilotMegaPlanner/ArdupilotMega.csproj @@ -391,12 +391,6 @@ ConfigFailSafe.cs - - UserControl - - - SetupFresh.cs - @@ -786,9 +780,6 @@ ConfigRawParams.cs - - SetupFresh.cs - MavlinkLog.cs diff --git a/Tools/ArdupilotMegaPlanner/Comms/CommsSerialPort.cs b/Tools/ArdupilotMegaPlanner/Comms/CommsSerialPort.cs index bf0995fbcf..2dfe9d0385 100644 --- a/Tools/ArdupilotMegaPlanner/Comms/CommsSerialPort.cs +++ b/Tools/ArdupilotMegaPlanner/Comms/CommsSerialPort.cs @@ -4,6 +4,8 @@ using System.Text; using System.IO.Ports; using System.IO; using System.Linq; +using System.Management; +using ArdupilotMega.Utilities; namespace ArdupilotMega.Comms { @@ -64,6 +66,22 @@ namespace ArdupilotMega.Comms return allPorts.ToArray(); } + internal static string GetNiceName(string port) + { + try + { + ObjectQuery query = new ObjectQuery("SELECT * FROM Win32_SerialPort"); // Win32_USBControllerDevice + ManagementObjectSearcher searcher = new ManagementObjectSearcher(query); + foreach (ManagementObject obj2 in searcher.Get()) + { + //DeviceID + if (obj2.Properties["DeviceID"].Value.ToString().ToUpper() == port.ToUpper()) + return obj2.Properties["Name"].Value.ToString(); + } + } + catch { } + return ""; + } // .NET bug: sometimes bluetooth ports are enumerated with bogus characters // eg 'COM10' becomes 'COM10c' - one workaround is to remove the non numeric diff --git a/Tools/ArdupilotMegaPlanner/Controls/BackstageView/BackstageView.cs b/Tools/ArdupilotMegaPlanner/Controls/BackstageView/BackstageView.cs index 2fbb2c241f..1efdc68cca 100644 --- a/Tools/ArdupilotMegaPlanner/Controls/BackstageView/BackstageView.cs +++ b/Tools/ArdupilotMegaPlanner/Controls/BackstageView/BackstageView.cs @@ -35,6 +35,8 @@ namespace ArdupilotMega.Controls.BackstageView private BackstageViewPage popoutPage = null; + private int ButtonTopPos = 0; + public BackstageView() { InitializeComponent(); @@ -159,7 +161,8 @@ namespace ArdupilotMega.Controls.BackstageView _items.Add(page); - CreateLinkButton(page); + //CreateLinkButton(page); + DrawMenu(page); page.Page.Visible = false; @@ -184,13 +187,25 @@ namespace ArdupilotMega.Controls.BackstageView _items.Add(new BackstageViewSpacer(spacerheight)); } - private void CreateLinkButton(BackstageViewPage page) + private void CreateLinkButton(BackstageViewPage page,bool haschild = false, bool child = false) { + string label = page.LinkText; + + if (haschild) + { + label = "> " + label; + } + if (child) + { + label = "+ " + label; + } + var lnkButton = new BackstageViewButton { - Text = page.LinkText, + Text = label, Tag = page, - Top = _items.TakeWhile(i => i != page).Sum(i => i.Spacing), + Top = ButtonTopPos, + // Top = _items.TakeWhile(i => i != page).Sum(i => i.Spacing), Width = this.pnlMenu.Width, Height = ButtonHeight, ContentPageColor = this.BackColor, @@ -199,12 +214,86 @@ namespace ArdupilotMega.Controls.BackstageView UnSelectedTextColor = _unSelectedTextColor, HighlightColor1 = _highlightColor1, HighlightColor2 = _highlightColor2, - // Dock = DockStyle.Bottom + //Dock = DockStyle.Bottom }; pnlMenu.Controls.Add(lnkButton); lnkButton.Click += this.ButtonClick; lnkButton.DoubleClick += lnkButton_DoubleClick; + + ButtonTopPos += lnkButton.Height; + } + + private void DrawMenu(BackstageViewPage CurrentPage) + { + pnlMenu.Visible = false; + pnlMenu.SuspendLayout(); + + pnlMenu.Controls.Clear(); + + // reset back to 0 + ButtonTopPos = 0; + + foreach (BackstageViewItem page in _items) + { + if (page.GetType() == typeof(BackstageViewPage)) + { + // its a base item. we want it + if (((BackstageViewPage)page).Parent == null) + { + bool children = PageHasChildren(page); + + CreateLinkButton((BackstageViewPage)page, children); + + // check for children + foreach (BackstageViewItem parentpage in _items) + { + if (parentpage.GetType() == typeof(BackstageViewPage)) + { + if (((BackstageViewPage)parentpage).Parent == ((BackstageViewPage)page)) + { + // draw all the siblings + if (((BackstageViewPage)parentpage).Parent == CurrentPage) + { + CreateLinkButton((BackstageViewPage)parentpage,false,true); + } + if (((BackstageViewPage)parentpage).Parent == CurrentPage.Parent) + { + CreateLinkButton((BackstageViewPage)parentpage,false,true); + } + } + } + } + continue; + } + + } + else + { + ButtonTopPos += page.Spacing; + } + } + + pnlMenu.ResumeLayout(false); + pnlMenu.PerformLayout(); + pnlMenu.Visible = true; + } + + private bool PageHasChildren(BackstageViewItem parent) + { + // check for children + foreach (BackstageViewItem child in _items) + { + if (child.GetType() == typeof(BackstageViewPage)) + { + if (((BackstageViewPage)child).Parent == parent) + { + return true; + } + } + } + + return false; } private void UpdateButtonAppearance() @@ -282,6 +371,8 @@ namespace ArdupilotMega.Controls.BackstageView public void ActivatePage(BackstageViewPage associatedPage) { + DrawMenu(associatedPage); + // Deactivate old page if (_activePage.Page is IDeactivate) { @@ -296,8 +387,12 @@ namespace ArdupilotMega.Controls.BackstageView // deactivate button _activePage.Page.Visible = false; - var oldButton = this.pnlMenu.Controls.OfType().Single(b => b.Tag == _activePage); - oldButton.IsSelected = false; + try + { // if the button was on an expanded tab. when we leave it no longer exits + var oldButton = this.pnlMenu.Controls.OfType().Single(b => b.Tag == _activePage); + oldButton.IsSelected = false; + } + catch { } // ensure fields have been init - obsolete way of notifying activation //associatedPage.Page.DoLoad(new EventArgs()); diff --git a/Tools/ArdupilotMegaPlanner/Controls/BackstageView/BackstageViewButton.cs b/Tools/ArdupilotMegaPlanner/Controls/BackstageView/BackstageViewButton.cs index 471c701595..33377c103e 100644 --- a/Tools/ArdupilotMegaPlanner/Controls/BackstageView/BackstageViewButton.cs +++ b/Tools/ArdupilotMegaPlanner/Controls/BackstageView/BackstageViewButton.cs @@ -92,7 +92,7 @@ namespace ArdupilotMega.Controls.BackstageView new Point(Width, midheight - arSize) }; - g.DrawString(Text, new Font(FontFamily.GenericSansSerif, 10, FontStyle.Bold), new SolidBrush(SelectedTextColor), 10, 6); + g.DrawString(Text, new Font(FontFamily.GenericSansSerif, 10, FontStyle.Bold), new SolidBrush(SelectedTextColor), 5, 6); var pencilBrush = new Pen(this.PencilBorderColor); diff --git a/Tools/ArdupilotMegaPlanner/Controls/ConnectionControl.Designer.cs b/Tools/ArdupilotMegaPlanner/Controls/ConnectionControl.Designer.cs index a5ab90d018..c48af32d88 100644 --- a/Tools/ArdupilotMegaPlanner/Controls/ConnectionControl.Designer.cs +++ b/Tools/ArdupilotMegaPlanner/Controls/ConnectionControl.Designer.cs @@ -62,11 +62,14 @@ // // cmb_Connection // + this.cmb_Connection.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; + this.cmb_Connection.DropDownWidth = 200; this.cmb_Connection.FormattingEnabled = true; this.cmb_Connection.Location = new System.Drawing.Point(3, 4); this.cmb_Connection.Name = "cmb_Connection"; this.cmb_Connection.Size = new System.Drawing.Size(121, 21); this.cmb_Connection.TabIndex = 2; + this.cmb_Connection.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.cmb_Connection_DrawItem); // // linkLabel1 // diff --git a/Tools/ArdupilotMegaPlanner/Controls/ConnectionControl.cs b/Tools/ArdupilotMegaPlanner/Controls/ConnectionControl.cs index 252ee0b80a..36b04a2d45 100644 --- a/Tools/ArdupilotMegaPlanner/Controls/ConnectionControl.cs +++ b/Tools/ArdupilotMegaPlanner/Controls/ConnectionControl.cs @@ -49,5 +49,31 @@ namespace ArdupilotMega.Controls } } + private void cmb_Connection_DrawItem(object sender, DrawItemEventArgs e) + { + if (e.Index < 0) + return; + + ComboBox combo = sender as ComboBox; + if ((e.State & DrawItemState.Selected) == DrawItemState.Selected) + e.Graphics.FillRectangle(new SolidBrush(SystemColors.Highlight), + e.Bounds); + else + e.Graphics.FillRectangle(new SolidBrush(combo.BackColor), + e.Bounds); + + string text = combo.Items[e.Index].ToString(); + if (!MainV2.MONO) + { + text = text + " "+ ArdupilotMega.Comms.SerialPort.GetNiceName(text); + } + + e.Graphics.DrawString(text, e.Font, + new SolidBrush(combo.ForeColor), + new Point(e.Bounds.X, e.Bounds.Y)); + + e.DrawFocusRectangle(); + } + } } diff --git a/Tools/ArdupilotMegaPlanner/Controls/MavlinkCheckBox.cs b/Tools/ArdupilotMegaPlanner/Controls/MavlinkCheckBox.cs index 920c5fbb01..2b2e562204 100644 --- a/Tools/ArdupilotMegaPlanner/Controls/MavlinkCheckBox.cs +++ b/Tools/ArdupilotMegaPlanner/Controls/MavlinkCheckBox.cs @@ -85,18 +85,24 @@ namespace ArdupilotMega.Controls if (this.Checked) { enableControl(true); - if (!MainV2.comPort.setParam(ParamName, OnValue)) + try { - CustomMessageBox.Show("Set "+ParamName + " Failed!"); + bool ans = MainV2.comPort.setParam(ParamName, OnValue); + if (ans == false) + CustomMessageBox.Show("Set " + ParamName + " Failed 1!"); } + catch { CustomMessageBox.Show("Set " + ParamName + " Failed 2!"); } } else { enableControl(false); - if (!MainV2.comPort.setParam(ParamName, OffValue)) + try { - CustomMessageBox.Show("Set " + ParamName + " Failed!"); + bool ans = MainV2.comPort.setParam(ParamName, OffValue); + if (ans == false) + CustomMessageBox.Show("Set " + ParamName + " Failed 1!"); } + catch { CustomMessageBox.Show("Set " + ParamName + " Failed 2!"); } } } diff --git a/Tools/ArdupilotMegaPlanner/Controls/MavlinkNumericUpDown.cs b/Tools/ArdupilotMegaPlanner/Controls/MavlinkNumericUpDown.cs index 6b8c1fcb4e..ccc81a6281 100644 --- a/Tools/ArdupilotMegaPlanner/Controls/MavlinkNumericUpDown.cs +++ b/Tools/ArdupilotMegaPlanner/Controls/MavlinkNumericUpDown.cs @@ -67,10 +67,13 @@ namespace ArdupilotMega.Controls void MavlinkNumericUpDown_ValueChanged(object sender, EventArgs e) { - if (!MainV2.comPort.setParam(ParamName, (float)this.Value * _scale)) + try { - CustomMessageBox.Show("Set " + ParamName + " Failed!"); + bool ans = MainV2.comPort.setParam(ParamName, (float)this.Value * _scale); + if (ans == false) + CustomMessageBox.Show("Set " + ParamName + " Failed 1!"); } + catch { CustomMessageBox.Show("Set " + ParamName + " Failed 2!"); } } } diff --git a/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/Setup.cs b/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/Setup.cs index d91a26e455..08b547ecac 100644 --- a/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/Setup.cs +++ b/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/Setup.cs @@ -16,6 +16,8 @@ namespace ArdupilotMega.GCSViews.ConfigurationView // remember the last page accessed static string lastpagename = ""; + BackstageView.BackstageViewPage hardware; + public Setup() { InitializeComponent(); @@ -24,6 +26,8 @@ namespace ArdupilotMega.GCSViews.ConfigurationView private void Setup_Load(object sender, EventArgs e) { + this.SuspendLayout(); + if (MainV2.comPort.BaseStream.IsOpen) { AddPagesForConnectedState(); @@ -31,9 +35,9 @@ namespace ArdupilotMega.GCSViews.ConfigurationView } // These pages work when not connected to an APM - AddBackstageViewPage(new ArdupilotMega._3DRradio(), "3DR Radio"); + AddBackstageViewPage(new ArdupilotMega._3DRradio(), "3DR Radio", hardware); AddBackstageViewPage(new ArdupilotMega.Antenna.Tracker(), "Antenna Tracker"); - backstageView.AddSpacer(5); + backstageView.AddSpacer(10); AddBackstageViewPage(new ConfigPlanner(), "Planner"); // remeber last page accessed @@ -45,7 +49,6 @@ namespace ArdupilotMega.GCSViews.ConfigurationView } } - //this.backstageView.ActivatePage(backstageView.Pages[0]); ThemeManager.ApplyThemeTo(this); @@ -55,6 +58,8 @@ namespace ArdupilotMega.GCSViews.ConfigurationView Common.MessageShowAgain("Config Connect", @"Please connect (click Connect Button) before using setup. If you are just setting up 3DR radios, you may continue without connecting."); } + + this.ResumeLayout(); } @@ -66,9 +71,12 @@ If you are just setting up 3DR radios, you may continue without connecting."); AddBackstageViewPage(new ConfigRadioInput(), "Radio Calibration"); AddBackstageViewPage(new ConfigFlightModes(), "Flight Modes"); AddBackstageViewPage(new ConfigFailSafe(), "FailSafe"); - BackstageView.BackstageViewPage hardware = AddBackstageViewPage(new ConfigHardwareOptions(), "Hardware Options"); + hardware = AddBackstageViewPage(new ConfigHardwareOptions(), "Hardware Options"); AddBackstageViewPage(new ConfigBatteryMonitoring(), "Battery Monitor", hardware); + BackstageView.BackstageViewPage tunningpage = AddBackstageViewPage(new ConfigFriendlyParams { ParameterMode = ParameterMetaDataConstants.Standard }, "Standard Params"); + AddBackstageViewPage(new ConfigFriendlyParams { ParameterMode = ParameterMetaDataConstants.Advanced }, "Advanced Params", tunningpage); + AddBackstageViewPage(new ConfigRawParams(), "Adv Parameter List", tunningpage); /******************************HELI **************************/ if (MainV2.comPort.param["H_GYR_ENABLE"] != null) // heli @@ -80,9 +88,9 @@ If you are just setting up 3DR radios, you may continue without connecting."); AddBackstageViewPage(new ConfigTradHeli(), "Heli Setup"); var configpanel = new Controls.ConfigPanel(Application.StartupPath + System.IO.Path.DirectorySeparatorChar + "ArduCopterConfig.xml"); - AddBackstageViewPage(configpanel, "ArduCopter Pids"); + AddBackstageViewPage(configpanel, "ArduCopter Pids", tunningpage); - AddBackstageViewPage(new ConfigArducopter(), "ArduCopter Config"); + AddBackstageViewPage(new ConfigArducopter(), "ArduCopter Config", tunningpage); // AddBackstageViewPage(new ConfigAP_Limits(), "GeoFence"); } /****************************** ArduCopter **************************/ @@ -93,9 +101,9 @@ If you are just setting up 3DR radios, you may continue without connecting."); AddBackstageViewPage(new ConfigAccelerometerCalibrationQuad(), "ArduCopter Level"); var configpanel = new Controls.ConfigPanel(Application.StartupPath + System.IO.Path.DirectorySeparatorChar + "ArduCopterConfig.xml"); - AddBackstageViewPage(configpanel, "ArduCopter Pids"); + AddBackstageViewPage(configpanel, "ArduCopter Pids", tunningpage); - AddBackstageViewPage(new ConfigArducopter(), "ArduCopter Config"); + AddBackstageViewPage(new ConfigArducopter(), "ArduCopter Config", tunningpage); // AddBackstageViewPage(new ConfigAP_Limits(), "GeoFence"); } /****************************** ArduPlane **************************/ @@ -104,18 +112,15 @@ If you are just setting up 3DR radios, you may continue without connecting."); AddBackstageViewPage(new ConfigMount(), "Camera Gimbal", hardware); AddBackstageViewPage(new ConfigAccelerometerCalibrationPlane(), "ArduPlane Level"); - AddBackstageViewPage(new ConfigArduplane(), "ArduPlane Pids"); + AddBackstageViewPage(new ConfigArduplane(), "ArduPlane Pids", tunningpage); } /****************************** ArduRover **************************/ else if (MainV2.cs.firmware == MainV2.Firmwares.ArduRover) { //AddBackstageViewPage(new ConfigAccelerometerCalibrationPlane(), "ArduRover Level")); - AddBackstageViewPage(new ConfigArdurover(), "ArduRover Pids"); + AddBackstageViewPage(new ConfigArdurover(), "ArduRover Pids", tunningpage); } - AddBackstageViewPage(new ConfigFriendlyParams { ParameterMode = ParameterMetaDataConstants.Standard }, "Standard Params"); - AddBackstageViewPage(new ConfigFriendlyParams { ParameterMode = ParameterMetaDataConstants.Advanced }, "Advanced Params"); - AddBackstageViewPage(new ConfigRawParams(), "Adv Parameter List"); } private BackstageView.BackstageViewPage AddBackstageViewPage(UserControl userControl, string headerText, BackstageView.BackstageViewPage Parent = null) diff --git a/Tools/ArdupilotMegaPlanner/GCSViews/Firmware.cs b/Tools/ArdupilotMegaPlanner/GCSViews/Firmware.cs index 3f798609ec..223219032b 100644 --- a/Tools/ArdupilotMegaPlanner/GCSViews/Firmware.cs +++ b/Tools/ArdupilotMegaPlanner/GCSViews/Firmware.cs @@ -34,7 +34,7 @@ namespace ArdupilotMega.GCSViews //"http://meee146-planner.googlecode.com/git/Tools/ArdupilotMegaPlanner/Firmware/AC2-Y6-1280.hex" readonly string oldurl = ("https://meee146-planner.googlecode.com/git-history/!Hash!/Tools/ArdupilotMegaPlanner/Firmware/firmware2.xml"); readonly string oldfirmwareurl = ("https://meee146-planner.googlecode.com/git-history/!Hash!/Tools/ArdupilotMegaPlanner/Firmware/!Firmware!"); - string[] oldurls = new string[] {"abe930ce723267697542388ef181328f00371f40", "26305d5790333f730cd396afcd08c165cde33ed7", "bc1f26ca40b076e3d06f173adad772fb25aa6512", "dfc5737c5efc1e7b78e908829a097624c273d9d7", "682065db449b6c79d89717908ed8beea1ed6a03a", "b21116847d35472b9ab770408cbeb88ed2ed0a95", "511e00bc89a554aea8768a274bff28af532cd335", "1da56714aa1ed88dcdb078a90d33bcef4eb4315f", "8aa4c7a1ed07648f31335926cc6bcc06c87dc536" }; + string[] oldurls = new string[] { "55ec5eaf662a56044ea25c894d235d17185f0660", "cb5b736976c7ed791ea45675c31f588ecb8228d4", "bcd5239322df38db011f183e48d596f215803838", "8709cc418e00326295abc562530413c0089807a7", "06a64192df594b0f81233dfb1f0214aab2cb2603", "7853ef3fad98e5053f228b7c1748c76858c4d282", "abe930ce723267697542388ef181328f00371f40", "26305d5790333f730cd396afcd08c165cde33ed7", "bc1f26ca40b076e3d06f173adad772fb25aa6512", "dfc5737c5efc1e7b78e908829a097624c273d9d7", "682065db449b6c79d89717908ed8beea1ed6a03a", "b21116847d35472b9ab770408cbeb88ed2ed0a95", "511e00bc89a554aea8768a274bff28af532cd335", "1da56714aa1ed88dcdb078a90d33bcef4eb4315f", "8aa4c7a1ed07648f31335926cc6bcc06c87dc536" }; List softwares = new List(); bool flashing = false; @@ -702,7 +702,7 @@ namespace ArdupilotMega.GCSViews private void BUT_setup_Click(object sender, EventArgs e) { Form temp = new Form(); - MyUserControl configview = new GCSViews.ConfigurationView.SetupFresh(); + MyUserControl configview = new GCSViews.ConfigurationView.Setup(); temp.Controls.Add(configview); ThemeManager.ApplyThemeTo(temp); // fix title diff --git a/Tools/ArdupilotMegaPlanner/GCSViews/FlightData.Designer.cs b/Tools/ArdupilotMegaPlanner/GCSViews/FlightData.Designer.cs index 36a9d93a7d..da3fb59f0e 100644 --- a/Tools/ArdupilotMegaPlanner/GCSViews/FlightData.Designer.cs +++ b/Tools/ArdupilotMegaPlanner/GCSViews/FlightData.Designer.cs @@ -425,6 +425,7 @@ 0, 0}); this.modifyandSetSpeed.Click += new System.EventHandler(this.modifyandSetSpeed_Click); + this.modifyandSetSpeed.ParentChanged += new System.EventHandler(this.modifyandSetSpeed_ParentChanged); // // modifyandSetAlt // diff --git a/Tools/ArdupilotMegaPlanner/GCSViews/FlightData.cs b/Tools/ArdupilotMegaPlanner/GCSViews/FlightData.cs index e1eb57762f..502538cc4f 100644 --- a/Tools/ArdupilotMegaPlanner/GCSViews/FlightData.cs +++ b/Tools/ArdupilotMegaPlanner/GCSViews/FlightData.cs @@ -241,261 +241,8 @@ namespace ArdupilotMega.GCSViews } catch { } - if (true || MainV2.MONO) - { - // MainH.Dock = DockStyle.Fill; - // MainH.Visible = true; - } - else - { - /* log.Info("1-"+ DateTime.Now); - //SetupDocking(); - log.Info("2-" + DateTime.Now); - if (File.Exists(_serializer.SavePath) == true ) - { - FileInfo fi = new FileInfo(_serializer.SavePath); - - if (fi.Length > 500) - { - try - { - _serializer.Load(true, GetFormFromGuid); - log.Info("3-" + DateTime.Now); - } - catch (Exception ex) - { - log.Info(ex); - try - { - //SetupDocking(); - } - catch (Exception ex2) - { - log.Info(ex2); - } - } - } - } - log.Info("D-" + DateTime.Now); - * */ - } - } - /* - void SetupDocking() - { - this.SuspendLayout(); - - DockableFormInfo dockhud = CreateFormAndGuid(dockContainer1, hud1, "fd_hud_guid"); - DockableFormInfo dockmap = CreateFormAndGuid(dockContainer1, tableMap, "fd_map_guid"); - DockableFormInfo dockquick = CreateFormAndGuid(dockContainer1, tabQuick, "fd_quick_guid"); - DockableFormInfo dockactions = CreateFormAndGuid(dockContainer1, tabActions, "fd_actions_guid"); - DockableFormInfo dockguages = CreateFormAndGuid(dockContainer1, tabGauges, "fd_guages_guid"); - DockableFormInfo dockstatus = CreateFormAndGuid(dockContainer1, tabStatus, "fd_status_guid"); - DockableFormInfo docktlogs = CreateFormAndGuid(dockContainer1, tabTLogs, "fd_tlogs_guid"); - - dockContainer1.DockForm(dockmap, DockStyle.Fill, zDockMode.Outer); - dockContainer1.DockForm(dockquick, DockStyle.Right, zDockMode.Outer); - dockContainer1.DockForm(dockhud, DockStyle.Left, zDockMode.Outer); - - dockContainer1.DockForm(dockactions, dockhud, DockStyle.Bottom, zDockMode.Outer); - dockContainer1.DockForm(dockguages, dockactions, DockStyle.Fill, zDockMode.Inner); - dockContainer1.DockForm(dockstatus, dockactions, DockStyle.Fill, zDockMode.Inner); - dockContainer1.DockForm(docktlogs, dockactions, DockStyle.Fill, zDockMode.Inner); - - dockactions.IsSelected = true; - - if (MainV2.config["FlightSplitter"] != null) - { - dockContainer1.SetWidth(dockhud, int.Parse(MainV2.config["FlightSplitter"].ToString())); - } - - dockContainer1.SetHeight(dockhud, hud1.Height); - - dockContainer1.SetWidth(dockguages, 110); - - this.ResumeLayout(); - } - - void cleanupDocks() - { - // cleanup from load - for (int a = 0; a < dockContainer1.Count; a++) - { - DockableFormInfo info = dockContainer1.GetFormInfoAt(a); - - info.ShowCloseButton = false; - - info.ShowContextMenuButton = false; - } - } - - void SaveWindowLayout() - { - XmlTextWriter xmlwriter = new XmlTextWriter(Path.GetDirectoryName(Application.ExecutablePath) + Path.DirectorySeparatorChar + @"FDLayout.xml", Encoding.ASCII); - xmlwriter.Formatting = Formatting.Indented; - - xmlwriter.WriteStartDocument(); - - xmlwriter.WriteStartElement("ScreenLayout"); - - //xmlwriter.WriteElementString("comport", comPortName); - - - for (int a = 0; a < dockContainer1.Count; a++) - { - DockableFormInfo info = dockContainer1.GetFormInfoAt(a); - - xmlwriter.WriteStartElement("Form"); - - object thisBoxed = info; - Type test = thisBoxed.GetType(); - - foreach (var field in test.GetProperties()) - { - // field.Name has the field's name. - object fieldValue; - try - { - fieldValue = field.GetValue(thisBoxed, null); // Get value - } - catch { continue; } - - // Get the TypeCode enumeration. Multiple types get mapped to a common typecode. - TypeCode typeCode = Type.GetTypeCode(fieldValue.GetType()); - - xmlwriter.WriteElementString(field.Name, fieldValue.ToString()); - } - - thisBoxed = info.DockableForm; - test = thisBoxed.GetType(); - - foreach (var field in test.GetProperties()) - { - // field.Name has the field's name. - object fieldValue; - try - { - fieldValue = field.GetValue(thisBoxed, null); // Get value - - - // Get the TypeCode enumeration. Multiple types get mapped to a common typecode. - TypeCode typeCode = Type.GetTypeCode(fieldValue.GetType()); - - xmlwriter.WriteElementString(field.Name, fieldValue.ToString()); - } - catch { continue; } - } - - // DockableContainer dockcont = info as DockableContainer; - - // dockContainer1. - - xmlwriter.WriteEndElement(); - } - - xmlwriter.WriteEndElement(); - - xmlwriter.WriteEndDocument(); - xmlwriter.Close(); - } - - DockableFormInfo CreateFormAndGuid(DockContainer dock, Control ctl, string configguidref) - { - Guid gu = GetOrCreateGuid(configguidref); - Form frm; - - if (formguids.ContainsKey(gu) && !formguids[gu].IsDisposed) - { - frm = formguids[gu]; - } - else - { - frm = CreateFormFromControl(ctl); - frm.AutoScroll = true; - formguids[gu] = frm; - } - - frm.FormBorderStyle = FormBorderStyle.SizableToolWindow; - frm.TopLevel = false; - - DockableFormInfo answer = dock.Add(frm, Crom.Controls.Docking.zAllowedDock.All, gu); - - answer.ShowCloseButton = false; - - answer.ShowContextMenuButton = false; - - return answer; } - - - Guid GetOrCreateGuid(string configname) - { - if (!MainV2.config.ContainsKey(configname)) - { - MainV2.config[configname] = Guid.NewGuid().ToString(); - } - - return new Guid(MainV2.config[configname].ToString()); - } - - Form GetFormFromGuid(Guid id) - { - return formguids[id]; - } - - Form CreateFormFromControl(Control ctl) - { - ctl.Dock = DockStyle.Fill; - Form newform = new Form(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainV2)); - newform.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - try - { - if (ctl is TabPage) - { - TabPage tp = ctl as TabPage; - newform.Text = ctl.Text; - while (tp.Controls.Count > 0) - { - newform.Controls.Add(tp.Controls[0]); - } - if (tp == tabQuick) - { - newform.Resize += tabQuick_Resize; - } - if (tp == tabStatus) - { - newform.Resize += tabStatus_Resize; - newform.Load += tabStatus_Resize; - //newform.Resize += tab1 - } - if (tp == tabGauges) - { - newform.Resize += tabPage1_Resize; - } - } - else if (ctl is Form) - { - return (Form)ctl; - } - else - { - newform.Text = ctl.Text; - newform.Controls.Add(ctl); - if (ctl is HUD) - { - newform.Text = "Hud"; - } - if (ctl is myGMAP) - { - newform.Text = "Map"; - } - } - } - catch { } - return newform; - } - */ + void tabStatus_Resize(object sender, EventArgs e) { // localise it @@ -760,7 +507,11 @@ namespace ArdupilotMega.GCSViews if (comPort.BaseStream.IsOpen) { MainV2.comPort.logreadmode = false; - MainV2.comPort.logplaybackfile.Close(); + try + { + MainV2.comPort.logplaybackfile.Close(); + } + catch { } MainV2.comPort.logplaybackfile = null; } @@ -1551,6 +1302,25 @@ namespace ArdupilotMega.GCSViews { MainV2.cam.camimage += new WebCamService.CamImage(cam_camimage); } + + // QUAD + if (MainV2.comPort.param.ContainsKey("WP_SPEED_MAX")) + { + modifyandSetSpeed.Value = (decimal)(float)MainV2.comPort.param["WP_SPEED_MAX"]; + } // plane with airspeed + else if (MainV2.comPort.param.ContainsKey("TRIM_ARSPD_CM") && MainV2.comPort.param.ContainsKey("ARSPD_ENABLE") + && MainV2.comPort.param.ContainsKey("ARSPD_USE") && (float)MainV2.comPort.param["ARSPD_ENABLE"] == 1 + && (float)MainV2.comPort.param["ARSPD_USE"] == 1) + { + modifyandSetSpeed.Value = (decimal)(float)MainV2.comPort.param["TRIM_ARSPD_CM"]; + } // plane without airspeed + else if (MainV2.comPort.param.ContainsKey("TRIM_THROTTLE") && MainV2.comPort.param.ContainsKey("ARSPD_USE") + && (float)MainV2.comPort.param["ARSPD_USE"] == 0) + { + modifyandSetSpeed.Value = (decimal)(float)MainV2.comPort.param["TRIM_THROTTLE"]; + } + + comPort.ParamListChanged += FlightData_ParentChanged; } void cam_camimage(Image camimage) @@ -2712,7 +2482,14 @@ print 'Roll complete' return; // arm the MAV - bool ans = MainV2.comPort.doARM(MainV2.cs.armed); + try + { + bool ans = MainV2.comPort.doARM(MainV2.cs.armed); + if (ans == false) + CustomMessageBox.Show("Error: Arm message rejected by MAV"); + } + catch { CustomMessageBox.Show("Error: No responce from MAV"); } + } @@ -2753,5 +2530,10 @@ print 'Roll complete' MainV2.comPort.setParam("TRIM_THROTTLE", (float)modifyandSetSpeed.Value); } } + + private void modifyandSetSpeed_ParentChanged(object sender, EventArgs e) + { + + } } } diff --git a/Tools/ArdupilotMegaPlanner/GCSViews/FlightData.resx b/Tools/ArdupilotMegaPlanner/GCSViews/FlightData.resx index b21803c919..6ddcb1392e 100644 --- a/Tools/ArdupilotMegaPlanner/GCSViews/FlightData.resx +++ b/Tools/ArdupilotMegaPlanner/GCSViews/FlightData.resx @@ -244,7 +244,7 @@ hud1 - ArdupilotMega.Controls.HUD, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.HUD, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null SubMainLeft.Panel1 @@ -283,7 +283,7 @@ quickView6 - ArdupilotMega.Controls.QuickView, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.QuickView, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null tabQuick @@ -307,7 +307,7 @@ quickView5 - ArdupilotMega.Controls.QuickView, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.QuickView, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null tabQuick @@ -331,7 +331,7 @@ quickView4 - ArdupilotMega.Controls.QuickView, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.QuickView, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null tabQuick @@ -355,7 +355,7 @@ quickView3 - ArdupilotMega.Controls.QuickView, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.QuickView, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null tabQuick @@ -379,7 +379,7 @@ quickView2 - ArdupilotMega.Controls.QuickView, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.QuickView, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null tabQuick @@ -409,7 +409,7 @@ quickView1 - ArdupilotMega.Controls.QuickView, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.QuickView, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null tabQuick @@ -444,9 +444,6 @@ 0 - - False - 275, 35 @@ -460,7 +457,7 @@ modifyandSetSpeed - ArdupilotMega.Controls.ModifyandSet, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.ModifyandSet, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null tabActions @@ -481,7 +478,7 @@ modifyandSetAlt - ArdupilotMega.Controls.ModifyandSet, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.ModifyandSet, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null tabActions @@ -514,7 +511,7 @@ BUT_ARM - ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null tabActions @@ -541,7 +538,7 @@ BUT_script - ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null tabActions @@ -571,7 +568,7 @@ BUT_joystick - ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null tabActions @@ -601,7 +598,7 @@ BUT_quickmanual - ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null tabActions @@ -631,7 +628,7 @@ BUT_quickrtl - ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null tabActions @@ -661,7 +658,7 @@ BUT_quickauto - ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null tabActions @@ -715,7 +712,7 @@ BUT_setwp - ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null tabActions @@ -766,7 +763,7 @@ BUT_setmode - ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null tabActions @@ -796,7 +793,7 @@ BUT_clear_track - ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null tabActions @@ -847,7 +844,7 @@ BUT_Homealt - ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null tabActions @@ -877,7 +874,7 @@ BUT_RAWSensor - ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null tabActions @@ -907,7 +904,7 @@ BUTrestartmission - ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null tabActions @@ -937,7 +934,7 @@ BUTactiondo - ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null tabActions @@ -991,7 +988,7 @@ Gvspeed - AGaugeApp.AGauge, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + AGaugeApp.AGauge, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null tabGauges @@ -1021,7 +1018,7 @@ Gheading - ArdupilotMega.Controls.HSI, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.HSI, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null tabGauges @@ -1051,7 +1048,7 @@ Galt - AGaugeApp.AGauge, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + AGaugeApp.AGauge, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null tabGauges @@ -1084,7 +1081,7 @@ Gspeed - AGaugeApp.AGauge, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + AGaugeApp.AGauge, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null tabGauges @@ -1168,7 +1165,7 @@ lbl_playbackspeed - ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null tabTLogs @@ -1195,7 +1192,7 @@ lbl_logpercent - ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null tabTLogs @@ -1222,7 +1219,7 @@ NUM_playbackspeed - ArdupilotMega.Controls.MyTrackBar, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyTrackBar, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null tabTLogs @@ -1249,7 +1246,7 @@ BUT_log2kml - ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null tabTLogs @@ -1303,7 +1300,7 @@ BUT_playlog - ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null tabTLogs @@ -1330,7 +1327,7 @@ BUT_loadtelem - ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null tabTLogs @@ -1516,7 +1513,7 @@ lbl_winddir - ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null splitContainer1.Panel2 @@ -1546,7 +1543,7 @@ lbl_windvel - ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null splitContainer1.Panel2 @@ -1579,7 +1576,7 @@ lbl_hdop - ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null splitContainer1.Panel2 @@ -1612,7 +1609,7 @@ lbl_sats - ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null splitContainer1.Panel2 @@ -1784,7 +1781,7 @@ gMapControl1 - ArdupilotMega.Controls.myGMAP, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.myGMAP, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null splitContainer1.Panel2 @@ -1847,7 +1844,7 @@ TXT_lat - ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null panel1 @@ -1904,7 +1901,7 @@ label1 - ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null panel1 @@ -1934,7 +1931,7 @@ TXT_long - ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null panel1 @@ -1964,7 +1961,7 @@ TXT_alt - ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null panel1 @@ -2279,6 +2276,6 @@ FlightData - System.Windows.Forms.MyUserControl, ArdupilotMegaPlanner10, Version=1.1.4688.31829, Culture=neutral, PublicKeyToken=null + System.Windows.Forms.MyUserControl, ArdupilotMegaPlanner10, Version=1.1.4691.24648, Culture=neutral, PublicKeyToken=null \ No newline at end of file diff --git a/Tools/ArdupilotMegaPlanner/GCSViews/Terminal.cs b/Tools/ArdupilotMegaPlanner/GCSViews/Terminal.cs index 039c91e28f..fedee1f109 100644 --- a/Tools/ArdupilotMegaPlanner/GCSViews/Terminal.cs +++ b/Tools/ArdupilotMegaPlanner/GCSViews/Terminal.cs @@ -306,8 +306,11 @@ namespace ArdupilotMega.GCSViews threadrun = false; comPort.DtrEnable = false; - - comPort.Close(); + try + { + comPort.Close(); + } + catch { } Console.WriteLine("Comport thread close"); }); diff --git a/Tools/ArdupilotMegaPlanner/Log.cs b/Tools/ArdupilotMegaPlanner/Log.cs index 46bf9ac45b..1a83223b41 100644 --- a/Tools/ArdupilotMegaPlanner/Log.cs +++ b/Tools/ArdupilotMegaPlanner/Log.cs @@ -843,15 +843,18 @@ namespace ArdupilotMega { TXT_seriallog.AppendText("\n\nProcessing " + logfile + "\n"); this.Refresh(); + try + { + TextReader tr = new StreamReader(logfile); - TextReader tr = new StreamReader(logfile); + while (tr.Peek() != -1) + { + processLine(tr.ReadLine()); + } - while (tr.Peek() != -1) - { - processLine(tr.ReadLine()); + tr.Close(); } - - tr.Close(); + catch (Exception ex) { CustomMessageBox.Show("Error processing file. Make sure the file is not in use.\n"+ex.ToString()); } writeKML(logfile + ".kml"); diff --git a/Tools/ArdupilotMegaPlanner/Mavlink/MAVLink.cs b/Tools/ArdupilotMegaPlanner/Mavlink/MAVLink.cs index ddee4c1d14..4fbceead88 100644 --- a/Tools/ArdupilotMegaPlanner/Mavlink/MAVLink.cs +++ b/Tools/ArdupilotMegaPlanner/Mavlink/MAVLink.cs @@ -228,6 +228,11 @@ namespace ArdupilotMega ThemeManager.ApplyThemeTo(frmProgressReporter); frmProgressReporter.RunBackgroundOperationAsync(); + + if (ParamListChanged != null) + { + ParamListChanged(this,null); + } } void FrmProgressReporterDoWorkAndParams(object sender, ProgressWorkerEventArgs e) @@ -381,7 +386,9 @@ namespace ArdupilotMega frmProgressReporter.UpdateProgressAndStatus(0, "Getting Params.. (sysid " + sysid + " compid " + compid + ") "); if (getparams) + { getParamListBG(); + } if (frmProgressReporter.doWorkArgs.CancelAcknowledged == true) { diff --git a/Tools/ArdupilotMegaPlanner/Properties/AssemblyInfo.cs b/Tools/ArdupilotMegaPlanner/Properties/AssemblyInfo.cs index 399f97b6ea..ce2714c5ae 100644 --- a/Tools/ArdupilotMegaPlanner/Properties/AssemblyInfo.cs +++ b/Tools/ArdupilotMegaPlanner/Properties/AssemblyInfo.cs @@ -34,5 +34,5 @@ using System.Resources; // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.1.*")] -[assembly: AssemblyFileVersion("1.2.16")] +[assembly: AssemblyFileVersion("1.2.17")] [assembly: NeutralResourcesLanguageAttribute("")]