diff --git a/Tools/ArdupilotMegaPlanner/3DRRadio/Config.resx b/Tools/ArdupilotMegaPlanner/3DRRadio/Config.resx index c1ca88b13b..253ddcc778 100644 --- a/Tools/ArdupilotMegaPlanner/3DRRadio/Config.resx +++ b/Tools/ArdupilotMegaPlanner/3DRRadio/Config.resx @@ -1588,7 +1588,7 @@ - 3DRRadio Config 0.8 + 3DRRadio Config 0.9 settingsToolStripMenuItem diff --git a/Tools/ArdupilotMegaPlanner/Common.cs b/Tools/ArdupilotMegaPlanner/Common.cs index 01fd6f90cf..d6f34ea45e 100644 --- a/Tools/ArdupilotMegaPlanner/Common.cs +++ b/Tools/ArdupilotMegaPlanner/Common.cs @@ -535,8 +535,8 @@ namespace ArdupilotMega [DisplayText("Land")] LAND = 9, // AUTO control OF_LOITER = 10, - [Private(true)] - APPROACH = 11 + [DisplayText("Toy")] + TOY = 11 } public enum ac2ch7modes diff --git a/Tools/ArdupilotMegaPlanner/Controls/AGauge.cs b/Tools/ArdupilotMegaPlanner/Controls/AGauge.cs index 0c405be46c..eca7341440 100644 --- a/Tools/ArdupilotMegaPlanner/Controls/AGauge.cs +++ b/Tools/ArdupilotMegaPlanner/Controls/AGauge.cs @@ -1471,6 +1471,18 @@ System.ComponentModel.Description("Enables or disables the range selected by Nee } #endregion + /// + /// this is to fix a mono off screen drawing issue + /// + /// + public bool ThisReallyVisible() + { + if (Parent != null) + return this.Bounds.IntersectsWith(Parent.ClientRectangle); + + return true; + } + #region base member overrides protected override void OnPaintBackground(PaintEventArgs pevent) { @@ -1483,6 +1495,9 @@ System.ComponentModel.Description("Enables or disables the range selected by Nee return; } + if (!ThisReallyVisible()) + return; + float scale = 1; // scale it diff --git a/Tools/ArdupilotMegaPlanner/Controls/BackstageView/BackstageViewButton.cs b/Tools/ArdupilotMegaPlanner/Controls/BackstageView/BackstageViewButton.cs index b0a2292594..c0de4128d2 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), new SolidBrush(SelectedTextColor), 20, 6); + g.DrawString(Text, new Font(FontFamily.GenericSansSerif, 10, FontStyle.Bold), new SolidBrush(SelectedTextColor), 10, 6); g.FillPolygon(arrowBrush, arrowPoints); @@ -116,7 +116,7 @@ namespace ArdupilotMega.Controls.BackstageView g.DrawLine(butPen, 0, Height - 1, Width, Height - 1); } - g.DrawString(Text, new Font(FontFamily.GenericSansSerif, 10), new SolidBrush(this.UnSelectedTextColor), 20, 6); + g.DrawString(Text, new Font(FontFamily.GenericSansSerif, 10,FontStyle.Bold), new SolidBrush(this.UnSelectedTextColor), 5, 6); } } diff --git a/Tools/ArdupilotMegaPlanner/Controls/ConnectionControl.Designer.cs b/Tools/ArdupilotMegaPlanner/Controls/ConnectionControl.Designer.cs index cf0d2f5183..480bc602ea 100644 --- a/Tools/ArdupilotMegaPlanner/Controls/ConnectionControl.Designer.cs +++ b/Tools/ArdupilotMegaPlanner/Controls/ConnectionControl.Designer.cs @@ -91,6 +91,7 @@ this.Controls.Add(this.cmb_Baud); this.Name = "ConnectionControl"; this.Size = new System.Drawing.Size(230, 76); + this.MouseClick += new System.Windows.Forms.MouseEventHandler(this.ConnectionControl_MouseClick); this.ResumeLayout(false); this.PerformLayout(); diff --git a/Tools/ArdupilotMegaPlanner/Controls/ConnectionControl.cs b/Tools/ArdupilotMegaPlanner/Controls/ConnectionControl.cs index 96f12fcc0f..252ee0b80a 100644 --- a/Tools/ArdupilotMegaPlanner/Controls/ConnectionControl.cs +++ b/Tools/ArdupilotMegaPlanner/Controls/ConnectionControl.cs @@ -37,5 +37,17 @@ namespace ArdupilotMega.Controls cmb_Baud.Enabled = !isConnected; cmb_Connection.Enabled = !isConnected; } + + private void ConnectionControl_MouseClick(object sender, MouseEventArgs e) + { + if (e.X > cmb_ConnectionType.Location.X && + e.Y > cmb_ConnectionType.Location.Y && + e.X < cmb_ConnectionType.Right && + e.Y < cmb_ConnectionType.Bottom) + { + cmb_ConnectionType.Visible = true; + } + } + } } diff --git a/Tools/ArdupilotMegaPlanner/Controls/HUD.cs b/Tools/ArdupilotMegaPlanner/Controls/HUD.cs index 25eeb4772e..c792a4cf7a 100644 --- a/Tools/ArdupilotMegaPlanner/Controls/HUD.cs +++ b/Tools/ArdupilotMegaPlanner/Controls/HUD.cs @@ -194,7 +194,7 @@ namespace ArdupilotMega.Controls { OpenTK.Graphics.GraphicsMode test = this.GraphicsMode; - log.Info(test.ToString()); + // log.Info(test.ToString()); log.Info("Vendor: " + GL.GetString(StringName.Vendor)); log.Info("Version: " + GL.GetString(StringName.Version)); log.Info("Device: " + GL.GetString(StringName.Renderer)); @@ -217,7 +217,7 @@ namespace ArdupilotMega.Controls GL.Enable(EnableCap.Blend); } - catch (Exception ex) { log.Info("HUD opengl onload " + ex.ToString()); } + catch (Exception ex) { log.Error("HUD opengl onload 1 ", ex); } try { @@ -229,7 +229,7 @@ namespace ArdupilotMega.Controls GL.Hint(HintTarget.TextureCompressionHint, HintMode.Nicest); } - catch { } + catch (Exception ex) { log.Error("HUD opengl onload 2 ", ex); } try { @@ -239,7 +239,7 @@ namespace ArdupilotMega.Controls GL.Enable(EnableCap.PolygonSmooth); } - catch { } + catch (Exception ex) { log.Error("HUD opengl onload 3 ", ex); } } started = true; @@ -252,6 +252,8 @@ namespace ArdupilotMega.Controls { //GL.Enable(EnableCap.AlphaTest) + + if (!started) return; @@ -310,7 +312,7 @@ namespace ArdupilotMega.Controls if (DateTime.Now.Second != countdate.Second) { countdate = DateTime.Now; - // Console.WriteLine("HUD " + count + " hz drawtime " + (huddrawtime / count) + " gl " + opengl); + Console.WriteLine("HUD " + count + " hz drawtime " + (huddrawtime / count) + " gl " + opengl); if ((huddrawtime / count) > 1000) opengl = false; diff --git a/Tools/ArdupilotMegaPlanner/Controls/MyLabel.cs b/Tools/ArdupilotMegaPlanner/Controls/MyLabel.cs index b2a931d4bf..2799df1b71 100644 --- a/Tools/ArdupilotMegaPlanner/Controls/MyLabel.cs +++ b/Tools/ArdupilotMegaPlanner/Controls/MyLabel.cs @@ -49,10 +49,24 @@ namespace ArdupilotMega.Controls this.Width = textSize.Width; } - this.Invalidate(); + if (this.Visible && ThisReallyVisible()) + this.Invalidate(); } } + /// + /// this is to fix a mono off screen drawing issue + /// + /// + public bool ThisReallyVisible() + { + if (Parent != null) + return this.Bounds.IntersectsWith(Parent.ClientRectangle); + + return true; + } + + SolidBrush s = new SolidBrush(Color.White); SolidBrush b = new SolidBrush(Color.Black); diff --git a/Tools/ArdupilotMegaPlanner/CurrentState.cs b/Tools/ArdupilotMegaPlanner/CurrentState.cs index 4c1150fa92..ea47821c9b 100644 --- a/Tools/ArdupilotMegaPlanner/CurrentState.cs +++ b/Tools/ArdupilotMegaPlanner/CurrentState.cs @@ -328,9 +328,9 @@ namespace ArdupilotMega messages = new List(); rateattitude = 10; rateposition = 3; - ratestatus = 3; - ratesensors = 3; - raterc = 3; + ratestatus = 2; + ratesensors = 2; + raterc = 2; datetime = DateTime.MinValue; } @@ -494,6 +494,9 @@ namespace ArdupilotMega case (byte)(Common.apmmodes.CIRCLE): mode = "Circle"; break; + case 16: + mode = "Initialising"; + break; default: mode = "Unknown"; break; diff --git a/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigCameraStab.Designer.cs b/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigCameraStab.Designer.cs index 871ab344a0..f8e6c3c7f5 100644 --- a/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigCameraStab.Designer.cs +++ b/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigCameraStab.Designer.cs @@ -81,7 +81,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView // this.pictureBox1.BackColor = System.Drawing.Color.Transparent; this.pictureBox1.BackgroundImage = global::ArdupilotMega.Properties.Resources.cameraGimalPitch1; - this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; this.pictureBox1.Location = new System.Drawing.Point(33, 52); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size(203, 112); @@ -261,7 +261,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView // pictureBox2 // this.pictureBox2.BackgroundImage = global::ArdupilotMega.Properties.Resources.cameraGimalRoll1; - this.pictureBox2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.pictureBox2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; this.pictureBox2.Location = new System.Drawing.Point(33, 207); this.pictureBox2.Name = "pictureBox2"; this.pictureBox2.Size = new System.Drawing.Size(203, 112); diff --git a/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigFriendlyParams.cs b/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigFriendlyParams.cs index f1ba4e0ac0..f853157048 100644 --- a/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigFriendlyParams.cs +++ b/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigFriendlyParams.cs @@ -190,6 +190,10 @@ namespace ArdupilotMega.GCSViews.ConfigurationView try { Utilities.ParameterMetaDataParser.GetParameterInformation(); + + _parameterMetaDataRepository.Reload(); + + SortParamList(); } catch (Exception exp) { log.Error(exp); } // just to cleanup any errors } diff --git a/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigHardwareOptions.Designer.cs b/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigHardwareOptions.Designer.cs index dedab86cf2..fa7ac3e81e 100644 --- a/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigHardwareOptions.Designer.cs +++ b/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigHardwareOptions.Designer.cs @@ -69,7 +69,8 @@ this.CMB_sonartype.Items.AddRange(new object[] { resources.GetString("CMB_sonartype.Items"), resources.GetString("CMB_sonartype.Items1"), - resources.GetString("CMB_sonartype.Items2")}); + resources.GetString("CMB_sonartype.Items2"), + resources.GetString("CMB_sonartype.Items3")}); resources.ApplyResources(this.CMB_sonartype, "CMB_sonartype"); this.CMB_sonartype.Name = "CMB_sonartype"; this.CMB_sonartype.SelectedIndexChanged += new System.EventHandler(this.CMB_sonartype_SelectedIndexChanged); diff --git a/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigHardwareOptions.resx b/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigHardwareOptions.resx index 90bbbfc64a..798b0ddf00 100644 --- a/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigHardwareOptions.resx +++ b/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigHardwareOptions.resx @@ -139,7 +139,7 @@ BUT_MagCalibrationLive - ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4517.33956, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4576.35069, Culture=neutral, PublicKeyToken=null $this @@ -183,6 +183,9 @@ XL-EZL0 + + HRLV + 243, 122 @@ -538,7 +541,7 @@ BUT_MagCalibrationLog - ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4517.33956, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4576.35069, Culture=neutral, PublicKeyToken=null $this @@ -589,6 +592,6 @@ ConfigHardwareOptions - ArdupilotMega.Controls.BackstageView.BackStageViewContentPanel, ArdupilotMegaPlanner, Version=1.1.4517.33956, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.BackstageView.BackStageViewContentPanel, ArdupilotMegaPlanner10, Version=1.1.4576.35069, Culture=neutral, PublicKeyToken=null \ No newline at end of file diff --git a/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/Setup.cs b/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/Setup.cs index 095d803820..7879a3636b 100644 --- a/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/Setup.cs +++ b/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/Setup.cs @@ -46,12 +46,13 @@ namespace ArdupilotMega.GCSViews.ConfigurationView AddBackstageViewPage(new ConfigFlightModes(), "Flight Modes"); AddBackstageViewPage(new ConfigHardwareOptions(), "Hardware Options"); AddBackstageViewPage(new ConfigBatteryMonitoring(), "Battery Monitor"); - AddBackstageViewPage(new ConfigCameraStab(), "Camera Gimbal"); /******************************HELI **************************/ if (MainV2.comPort.param["H_GYR_ENABLE"] != null) // heli { + AddBackstageViewPage(new ConfigCameraStab(), "Camera Gimbal"); + AddBackstageViewPage(new ConfigAccelerometerCalibrationQuad(), "ArduCopter Level"); AddBackstageViewPage(new ConfigTradHeli(), "Heli Setup"); @@ -65,6 +66,8 @@ namespace ArdupilotMega.GCSViews.ConfigurationView /****************************** ArduCopter **************************/ else if (MainV2.cs.firmware == MainV2.Firmwares.ArduCopter2) { + AddBackstageViewPage(new ConfigCameraStab(), "Camera Gimbal"); + AddBackstageViewPage(new ConfigAccelerometerCalibrationQuad(), "ArduCopter Level"); var configpanel = new Controls.ConfigPanel(); diff --git a/Tools/ArdupilotMegaPlanner/GCSViews/FlightData.cs b/Tools/ArdupilotMegaPlanner/GCSViews/FlightData.cs index 47b03bd69a..b1f5756470 100644 --- a/Tools/ArdupilotMegaPlanner/GCSViews/FlightData.cs +++ b/Tools/ArdupilotMegaPlanner/GCSViews/FlightData.cs @@ -837,7 +837,7 @@ namespace ArdupilotMega.GCSViews { ((Button)sender).Enabled = false; #if MAVLINK10 - comPort.doCommand((MAVLink.MAV_CMD)Enum.Parse(typeof(MAVLink.MAV_CMD), CMB_action.Text),0,0,0,0,0,0,0); + comPort.doCommand((MAVLink.MAV_CMD)Enum.Parse(typeof(MAVLink.MAV_CMD), CMB_action.Text),1,0,0,0,0,0,0); #else comPort.doAction((MAVLink.MAV_ACTION)Enum.Parse(typeof(MAVLink.MAV_ACTION), "MAV_ACTION_" + CMB_action.Text)); #endif diff --git a/Tools/ArdupilotMegaPlanner/GCSViews/FlightData.resx b/Tools/ArdupilotMegaPlanner/GCSViews/FlightData.resx index 01d02a6e6a..b8ab7b9ecc 100644 --- a/Tools/ArdupilotMegaPlanner/GCSViews/FlightData.resx +++ b/Tools/ArdupilotMegaPlanner/GCSViews/FlightData.resx @@ -226,7 +226,7 @@ hud1 - ArdupilotMega.Controls.HUD, ArdupilotMegaPlanner10, Version=1.1.4561.37648, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.HUD, ArdupilotMegaPlanner10, Version=1.1.4576.33626, Culture=neutral, PublicKeyToken=null SubMainLeft.Panel1 @@ -265,7 +265,7 @@ BUT_script - ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4561.37648, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4576.33626, Culture=neutral, PublicKeyToken=null tabActions @@ -298,7 +298,7 @@ BUT_joystick - ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4561.37648, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4576.33626, Culture=neutral, PublicKeyToken=null tabActions @@ -328,7 +328,7 @@ BUT_quickmanual - ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4561.37648, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4576.33626, Culture=neutral, PublicKeyToken=null tabActions @@ -358,7 +358,7 @@ BUT_quickrtl - ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4561.37648, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4576.33626, Culture=neutral, PublicKeyToken=null tabActions @@ -388,7 +388,7 @@ BUT_quickauto - ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4561.37648, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4576.33626, Culture=neutral, PublicKeyToken=null tabActions @@ -442,7 +442,7 @@ BUT_setwp - ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4561.37648, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4576.33626, Culture=neutral, PublicKeyToken=null tabActions @@ -493,7 +493,7 @@ BUT_setmode - ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4561.37648, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4576.33626, Culture=neutral, PublicKeyToken=null tabActions @@ -523,7 +523,7 @@ BUT_clear_track - ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4561.37648, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4576.33626, Culture=neutral, PublicKeyToken=null tabActions @@ -574,7 +574,7 @@ BUT_Homealt - ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4561.37648, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4576.33626, Culture=neutral, PublicKeyToken=null tabActions @@ -604,7 +604,7 @@ BUT_RAWSensor - ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4561.37648, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4576.33626, Culture=neutral, PublicKeyToken=null tabActions @@ -634,7 +634,7 @@ BUTrestartmission - ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4561.37648, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4576.33626, Culture=neutral, PublicKeyToken=null tabActions @@ -664,7 +664,7 @@ BUTactiondo - ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4561.37648, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4576.33626, Culture=neutral, PublicKeyToken=null tabActions @@ -718,7 +718,7 @@ Gvspeed - AGaugeApp.AGauge, ArdupilotMegaPlanner10, Version=1.1.4561.37648, Culture=neutral, PublicKeyToken=null + AGaugeApp.AGauge, ArdupilotMegaPlanner10, Version=1.1.4576.33626, Culture=neutral, PublicKeyToken=null tabGauges @@ -748,7 +748,7 @@ Gheading - ArdupilotMega.Controls.HSI, ArdupilotMegaPlanner10, Version=1.1.4561.37648, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.HSI, ArdupilotMegaPlanner10, Version=1.1.4576.33626, Culture=neutral, PublicKeyToken=null tabGauges @@ -778,7 +778,7 @@ Galt - AGaugeApp.AGauge, ArdupilotMegaPlanner10, Version=1.1.4561.37648, Culture=neutral, PublicKeyToken=null + AGaugeApp.AGauge, ArdupilotMegaPlanner10, Version=1.1.4576.33626, Culture=neutral, PublicKeyToken=null tabGauges @@ -811,7 +811,7 @@ Gspeed - AGaugeApp.AGauge, ArdupilotMegaPlanner10, Version=1.1.4561.37648, Culture=neutral, PublicKeyToken=null + AGaugeApp.AGauge, ArdupilotMegaPlanner10, Version=1.1.4576.33626, Culture=neutral, PublicKeyToken=null tabGauges @@ -895,7 +895,7 @@ lbl_playbackspeed - ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4561.37648, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4576.33626, Culture=neutral, PublicKeyToken=null tabTLogs @@ -922,7 +922,7 @@ lbl_logpercent - ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4561.37648, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4576.33626, Culture=neutral, PublicKeyToken=null tabTLogs @@ -949,7 +949,7 @@ NUM_playbackspeed - ArdupilotMega.Controls.MyTrackBar, ArdupilotMegaPlanner10, Version=1.1.4561.37648, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyTrackBar, ArdupilotMegaPlanner10, Version=1.1.4576.33626, Culture=neutral, PublicKeyToken=null tabTLogs @@ -976,7 +976,7 @@ BUT_log2kml - ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4561.37648, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4576.33626, Culture=neutral, PublicKeyToken=null tabTLogs @@ -1030,7 +1030,7 @@ BUT_playlog - ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4561.37648, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4576.33626, Culture=neutral, PublicKeyToken=null tabTLogs @@ -1057,7 +1057,7 @@ BUT_loadtelem - ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4561.37648, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4576.33626, Culture=neutral, PublicKeyToken=null tabTLogs @@ -1246,7 +1246,7 @@ lbl_hdop - ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4561.37648, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4576.33626, Culture=neutral, PublicKeyToken=null splitContainer1.Panel2 @@ -1279,7 +1279,7 @@ lbl_sats - ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4561.37648, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4576.33626, Culture=neutral, PublicKeyToken=null splitContainer1.Panel2 @@ -1309,7 +1309,7 @@ lbl_winddir - ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4561.37648, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4576.33626, Culture=neutral, PublicKeyToken=null splitContainer1.Panel2 @@ -1339,7 +1339,7 @@ lbl_windvel - ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4561.37648, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4576.33626, Culture=neutral, PublicKeyToken=null splitContainer1.Panel2 @@ -1511,7 +1511,7 @@ gMapControl1 - ArdupilotMega.Controls.myGMAP, ArdupilotMegaPlanner10, Version=1.1.4561.37648, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.myGMAP, ArdupilotMegaPlanner10, Version=1.1.4576.33626, Culture=neutral, PublicKeyToken=null splitContainer1.Panel2 @@ -1574,7 +1574,7 @@ TXT_lat - ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4561.37648, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4576.33626, Culture=neutral, PublicKeyToken=null panel1 @@ -1631,7 +1631,7 @@ label1 - ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4561.37648, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4576.33626, Culture=neutral, PublicKeyToken=null panel1 @@ -1661,7 +1661,7 @@ TXT_long - ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4561.37648, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4576.33626, Culture=neutral, PublicKeyToken=null panel1 @@ -1691,7 +1691,7 @@ TXT_alt - ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4561.37648, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4576.33626, Culture=neutral, PublicKeyToken=null panel1 @@ -1892,7 +1892,7 @@ label6 - ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4561.37648, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4576.33626, Culture=neutral, PublicKeyToken=null $this @@ -1988,6 +1988,6 @@ FlightData - System.Windows.Forms.MyUserControl, ArdupilotMegaPlanner10, Version=1.1.4561.37648, Culture=neutral, PublicKeyToken=null + System.Windows.Forms.MyUserControl, ArdupilotMegaPlanner10, Version=1.1.4576.33626, Culture=neutral, PublicKeyToken=null \ No newline at end of file diff --git a/Tools/ArdupilotMegaPlanner/GCSViews/FlightPlanner.cs b/Tools/ArdupilotMegaPlanner/GCSViews/FlightPlanner.cs index 6e8f15b418..a16b011f91 100644 --- a/Tools/ArdupilotMegaPlanner/GCSViews/FlightPlanner.cs +++ b/Tools/ArdupilotMegaPlanner/GCSViews/FlightPlanner.cs @@ -285,7 +285,7 @@ namespace ArdupilotMega.GCSViews float result; bool pass = float.TryParse(TXT_homealt.Text, out result); - if (result == 0 || pass == false) + if (pass == false) { CustomMessageBox.Show("You must have a home altitude"); return; @@ -306,8 +306,10 @@ namespace ArdupilotMega.GCSViews ans = (int)ans; if (alt != 0) // use passed in value; cell.Value = alt.ToString(); - if (ans == 0) + if (ans == 0) // default cell.Value = 50; + if (ans == 0 && MainV2.cs.firmware == MainV2.Firmwares.ArduCopter2) + cell.Value = 15; // online verify height if (isonline && CHK_geheight.Checked) { diff --git a/Tools/ArdupilotMegaPlanner/GCSViews/Terminal.cs b/Tools/ArdupilotMegaPlanner/GCSViews/Terminal.cs index d30e642502..9a868cf2de 100644 --- a/Tools/ArdupilotMegaPlanner/GCSViews/Terminal.cs +++ b/Tools/ArdupilotMegaPlanner/GCSViews/Terminal.cs @@ -36,6 +36,10 @@ namespace ArdupilotMega.GCSViews { if (!comPort.IsOpen) return; + + // if btr > 0 then this shouldnt happen + comPort.ReadTimeout = 300; + try { lock (thisLock) @@ -43,6 +47,7 @@ namespace ArdupilotMega.GCSViews System.Threading.Thread.Sleep(20); byte[] buffer = new byte[256]; int a = 0; + while (comPort.BytesToRead > 0) { byte indata = (byte)comPort.ReadByte(); @@ -60,12 +65,12 @@ namespace ArdupilotMega.GCSViews addText(ASCIIEncoding.ASCII.GetString(buffer,0,a+1)); } } - catch (Exception) { if (!threadrun) return; TXT_terminal.AppendText("Error reading com port\r\n"); } + catch (Exception ex) { Console.WriteLine(ex.ToString()); if (!threadrun) return; TXT_terminal.AppendText("Error reading com port\r\n"); } } void addText(string data) { - this.Invoke((System.Windows.Forms.MethodInvoker)delegate() + this.BeginInvoke((System.Windows.Forms.MethodInvoker)delegate() { TXT_terminal.SelectionStart = TXT_terminal.Text.Length; @@ -86,6 +91,7 @@ namespace ArdupilotMega.GCSViews } inputStartPos = TXT_terminal.SelectionStart; }); + } private void TXT_terminal_Click(object sender, EventArgs e) @@ -178,9 +184,12 @@ namespace ArdupilotMega.GCSViews } // do not change this \r is correct - no \n if (cmd == "+++") + { comPort.Write(Encoding.ASCII.GetBytes(cmd), 0, cmd.Length); - else { - comPort.Write(Encoding.ASCII.GetBytes(cmd + "\r"), 0, cmd.Length + 1); + } + else + { + comPort.Write(Encoding.ASCII.GetBytes(cmd + "\r"), 0, cmd.Length + 1); } } catch { CustomMessageBox.Show("Error writing to com port"); } @@ -198,6 +207,23 @@ namespace ArdupilotMega.GCSViews e.Handled = true;*/ } + private void readandsleep(int time) + { + DateTime start = DateTime.Now; + + while ((DateTime.Now - start).TotalMilliseconds < time) + { + try + { + if (comPort.BytesToRead > 0) + { + comPort_DataReceived((object)null, (SerialDataReceivedEventArgs)null); + } + } + catch { threadrun = false; return; } + } + } + private void Terminal_Load(object sender, EventArgs e) { try @@ -219,28 +245,18 @@ namespace ArdupilotMega.GCSViews { threadrun = true; - DateTime start = DateTime.Now; - - while ((DateTime.Now - start).TotalMilliseconds < 2000) - { - try - { - if (comPort.BytesToRead > 0) - { - comPort_DataReceived((object)null, (SerialDataReceivedEventArgs)null); - } - } - catch { threadrun = false; return; } - } + // 2 secs + readandsleep(2000); try { comPort.Write("\n\n\n"); - System.Threading.Thread.Sleep(500); + // 1 secs + readandsleep(1000); comPort.Write("\r\r\r?\r"); } - catch { return; } + catch { threadrun = false; return; } while (threadrun) { diff --git a/Tools/ArdupilotMegaPlanner/Log.cs b/Tools/ArdupilotMegaPlanner/Log.cs index 4b65e4985d..543d5162a2 100644 --- a/Tools/ArdupilotMegaPlanner/Log.cs +++ b/Tools/ArdupilotMegaPlanner/Log.cs @@ -62,6 +62,23 @@ namespace ArdupilotMega InitializeComponent(); } + private void readandsleep(int time) + { + DateTime start = DateTime.Now; + + while ((DateTime.Now - start).TotalMilliseconds < time) + { + try + { + if (comPort.BytesToRead > 0) + { + comPort_DataReceived((object)null, (SerialDataReceivedEventArgs)null); + } + } + catch { threadrun = false; return; } + } + } + private void Log_Load(object sender, EventArgs e) { status = serialstatus.Connecting; @@ -87,7 +104,7 @@ namespace ArdupilotMega threadrun = true; - System.Threading.Thread.Sleep(2000); + readandsleep(2500); try { diff --git a/Tools/ArdupilotMegaPlanner/MainV2.cs b/Tools/ArdupilotMegaPlanner/MainV2.cs index 07412d11a2..e26e68ba60 100644 --- a/Tools/ArdupilotMegaPlanner/MainV2.cs +++ b/Tools/ArdupilotMegaPlanner/MainV2.cs @@ -975,6 +975,12 @@ namespace ArdupilotMega { try { + if (MONO) + { + log.Error("Mono: closing joystick thread"); + break; + } + if (!MONO) { //joystick stuff @@ -1152,8 +1158,6 @@ namespace ArdupilotMega GCSViews.FlightData.myhud.Invalidate(); } - - GC.Collect(); } if (speechEnable && speechEngine != null && (MainV2.comPort.logreadmode || comPort.BaseStream.IsOpen)) @@ -1210,7 +1214,9 @@ namespace ArdupilotMega //Console.WriteLine(DateTime.Now.Millisecond + " " + comPort.BaseStream.BytesToRead); while (comPort.BaseStream.BytesToRead > minbytes && giveComport == false) + { comPort.readPacket(); + } } catch (Exception e) { diff --git a/Tools/ArdupilotMegaPlanner/Mavlink/MAVLink.cs b/Tools/ArdupilotMegaPlanner/Mavlink/MAVLink.cs index 152ad5dfa4..630bdd72f0 100644 --- a/Tools/ArdupilotMegaPlanner/Mavlink/MAVLink.cs +++ b/Tools/ArdupilotMegaPlanner/Mavlink/MAVLink.cs @@ -343,6 +343,8 @@ namespace ArdupilotMega mavlinkversion = hb.mavlink_version; aptype = (MAV_TYPE)hb.type; + setAPType(); + sysid = buffer[3]; compid = buffer[4]; recvpacketcount = buffer[2]; @@ -960,7 +962,7 @@ namespace ArdupilotMega if (actionid == MAV_CMD.PREFLIGHT_CALIBRATION) { retrys = 1; - timeout = 12000; + timeout = 25000; } while (true) @@ -2115,7 +2117,7 @@ namespace ArdupilotMega log.InfoFormat("MAVLINK: S wait time out btr {0} len {1}", BaseStream.BytesToRead, length); throw new Exception("Timeout"); } - System.Threading.Thread.Sleep(1); + // System.Threading.Thread.Sleep(1); } if (BaseStream.IsOpen) { diff --git a/Tools/ArdupilotMegaPlanner/Msi/installer.wxs b/Tools/ArdupilotMegaPlanner/Msi/installer.wxs index 51ef44e178..74fa01726a 100644 --- a/Tools/ArdupilotMegaPlanner/Msi/installer.wxs +++ b/Tools/ArdupilotMegaPlanner/Msi/installer.wxs @@ -2,14 +2,14 @@ - + - - + + @@ -31,7 +31,7 @@ - + @@ -106,11 +106,11 @@ - + - + @@ -121,20 +121,20 @@ - + - + - + @@ -148,7 +148,7 @@ - + @@ -160,13 +160,13 @@ - + - + @@ -177,7 +177,7 @@ - + @@ -188,33 +188,33 @@ - + - + - + - + - + - + @@ -223,28 +223,28 @@ - + - + - + - + - + diff --git a/Tools/ArdupilotMegaPlanner/Program.cs b/Tools/ArdupilotMegaPlanner/Program.cs index 4f5f588e19..34864ba0dd 100644 --- a/Tools/ArdupilotMegaPlanner/Program.cs +++ b/Tools/ArdupilotMegaPlanner/Program.cs @@ -29,7 +29,7 @@ namespace ArdupilotMega Application.ThreadException += Application_ThreadException; - Application.Idle += Application_Idle; + // Application.Idle += Application_Idle; int wt = 0, ct = 0; ThreadPool.GetMaxThreads(out wt, out ct); @@ -96,7 +96,8 @@ namespace ArdupilotMega static void Application_Idle(object sender, EventArgs e) { - // Console.Write("Idle\r"); + System.Threading.Thread.Sleep(10); + Console.Write("Idle\r"); } static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e) @@ -125,8 +126,8 @@ namespace ArdupilotMega } if (e.Exception.GetType() == typeof(FileNotFoundException) || e.Exception.GetType() == typeof(BadImageFormatException)) // i get alot of error from people who click the exe from inside a zip file. { - CustomMessageBox.Show("You are missing some DLL's. Please extract the zip file somewhere. OR Use the update feature from the menu"); - return; + CustomMessageBox.Show("You are missing some DLL's. Please extract the zip file somewhere. OR Use the update feature from the menu " + e.Exception.ToString() ); + // return; } DialogResult dr = CustomMessageBox.Show("An error has occurred\n"+ex.ToString() + "\n\nReport this Error???", "Send Error", MessageBoxButtons.YesNo); if (DialogResult.Yes == dr) diff --git a/Tools/ArdupilotMegaPlanner/Properties/AssemblyInfo.cs b/Tools/ArdupilotMegaPlanner/Properties/AssemblyInfo.cs index 9783aa9144..ce4fd18665 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.1.96")] +[assembly: AssemblyFileVersion("1.1.97")] [assembly: NeutralResourcesLanguageAttribute("")] diff --git a/Tools/ArdupilotMegaPlanner/Utilities/ParameterMetaDataRepository.cs b/Tools/ArdupilotMegaPlanner/Utilities/ParameterMetaDataRepository.cs index 898b69a37f..d91cbf2b9a 100644 --- a/Tools/ArdupilotMegaPlanner/Utilities/ParameterMetaDataRepository.cs +++ b/Tools/ArdupilotMegaPlanner/Utilities/ParameterMetaDataRepository.cs @@ -16,14 +16,19 @@ namespace ArdupilotMega.Utilities /// public ParameterMetaDataRepository() { - string paramMetaDataXMLFileName = String.Format("{0}\\{1}", Application.StartupPath, ConfigurationManager.AppSettings["ParameterMetaDataXMLFileName"]); - try - { - if (File.Exists(paramMetaDataXMLFileName)) - _parameterMetaDataXML = XDocument.Load(paramMetaDataXMLFileName); + Reload(); + } - } - catch { } // Exception System.Xml.XmlException: Root element is missing. + public void Reload() + { + string paramMetaDataXMLFileName = String.Format("{0}\\{1}", Application.StartupPath, ConfigurationManager.AppSettings["ParameterMetaDataXMLFileName"]); + try + { + if (File.Exists(paramMetaDataXMLFileName)) + _parameterMetaDataXML = XDocument.Load(paramMetaDataXMLFileName); + + } + catch { } // Exception System.Xml.XmlException: Root element is missing. } /// diff --git a/Tools/ArdupilotMegaPlanner/Utilities/ThemeManager.cs b/Tools/ArdupilotMegaPlanner/Utilities/ThemeManager.cs index 0d89857727..739a59ad92 100644 --- a/Tools/ArdupilotMegaPlanner/Utilities/ThemeManager.cs +++ b/Tools/ArdupilotMegaPlanner/Utilities/ThemeManager.cs @@ -117,7 +117,7 @@ namespace ArdupilotMega.Utilities zg1.GraphPane.Fill = new ZedGraph.Fill(Color.FromArgb(0x37, 0x37, 0x38)); foreach (ZedGraph.LineItem li in zg1.GraphPane.CurveList) - li.Line.Width = 4; + li.Line.Width = 2; zg1.GraphPane.Title.FontSpec.FontColor = TextColor; diff --git a/Tools/ArdupilotMegaPlanner/temp.Designer.cs b/Tools/ArdupilotMegaPlanner/temp.Designer.cs index 0631a2f5a2..70c251e9d1 100644 --- a/Tools/ArdupilotMegaPlanner/temp.Designer.cs +++ b/Tools/ArdupilotMegaPlanner/temp.Designer.cs @@ -31,6 +31,7 @@ this.label1 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); + this.BUT_paramgen = new ArdupilotMega.Controls.MyButton(); this.BUT_magcalib = new ArdupilotMega.Controls.MyButton(); this.BUT_ant_track = new ArdupilotMega.Controls.MyButton(); this.BUT_follow_me = new ArdupilotMega.Controls.MyButton(); @@ -48,7 +49,6 @@ this.BUT_flashdl = new ArdupilotMega.Controls.MyButton(); this.BUT_wipeeeprom = new ArdupilotMega.Controls.MyButton(); this.button1 = new ArdupilotMega.Controls.MyButton(); - this.BUT_paramgen = new ArdupilotMega.Controls.MyButton(); this.SuspendLayout(); // // label1 @@ -78,6 +78,16 @@ this.label3.TabIndex = 13; this.label3.Text = "1280 - can do full copy\'s 2560- full read, write flash only"; // + // BUT_paramgen + // + this.BUT_paramgen.Location = new System.Drawing.Point(206, 118); + this.BUT_paramgen.Name = "BUT_paramgen"; + this.BUT_paramgen.Size = new System.Drawing.Size(75, 23); + this.BUT_paramgen.TabIndex = 20; + this.BUT_paramgen.Text = "Param gen"; + this.BUT_paramgen.UseVisualStyleBackColor = true; + this.BUT_paramgen.Click += new System.EventHandler(this.BUT_paramgen_Click); + // // BUT_magcalib // this.BUT_magcalib.Location = new System.Drawing.Point(119, 164); @@ -245,21 +255,11 @@ this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.button1_Click); // - // BUT_paramgen - // - this.BUT_paramgen.Location = new System.Drawing.Point(206, 118); - this.BUT_paramgen.Name = "BUT_paramgen"; - this.BUT_paramgen.Size = new System.Drawing.Size(75, 23); - this.BUT_paramgen.TabIndex = 20; - this.BUT_paramgen.Text = "Param gen"; - this.BUT_paramgen.UseVisualStyleBackColor = true; - this.BUT_paramgen.Click += new System.EventHandler(this.BUT_paramgen_Click); - // // temp // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(731, 281); + this.ClientSize = new System.Drawing.Size(696, 288); this.Controls.Add(this.BUT_paramgen); this.Controls.Add(this.BUT_magcalib); this.Controls.Add(this.BUT_ant_track);