diff --git a/Tools/ArdupilotMegaPlanner/Arduino/ArduinoDetect.cs b/Tools/ArdupilotMegaPlanner/Arduino/ArduinoDetect.cs index ad59c49534..3c85f9008c 100644 --- a/Tools/ArdupilotMegaPlanner/Arduino/ArduinoDetect.cs +++ b/Tools/ArdupilotMegaPlanner/Arduino/ArduinoDetect.cs @@ -30,6 +30,8 @@ namespace ArdupilotMega.Arduino serialPort.BaudRate = 57600; serialPort.Open(); + serialPort.toggleDTR(); + Thread.Sleep(100); int a = 0; @@ -65,6 +67,8 @@ namespace ArdupilotMega.Arduino serialPort.BaudRate = 115200; serialPort.Open(); + serialPort.toggleDTR(); + Thread.Sleep(100); a = 0; diff --git a/Tools/ArdupilotMegaPlanner/ArdupilotMega.csproj b/Tools/ArdupilotMegaPlanner/ArdupilotMega.csproj index 41212902c1..4e0f6fab5f 100644 --- a/Tools/ArdupilotMegaPlanner/ArdupilotMega.csproj +++ b/Tools/ArdupilotMegaPlanner/ArdupilotMega.csproj @@ -219,6 +219,9 @@ False + + Lib\Transitions.dll + False @@ -242,6 +245,7 @@ + UserControl @@ -249,9 +253,23 @@ HSI.cs + + Component + UserControl + + Component + + + + + UserControl + + + ConfigCameraStab.cs + UserControl @@ -276,6 +294,7 @@ ConfigArdurover.cs + @@ -675,6 +694,9 @@ ConfigBatteryMonitoring.cs + + ConfigCameraStab.cs + ConfigFlightModes.cs @@ -1131,6 +1153,7 @@ Always + Always @@ -1162,6 +1185,10 @@ + + + + diff --git a/Tools/ArdupilotMegaPlanner/ChangeLog.txt b/Tools/ArdupilotMegaPlanner/ChangeLog.txt index d33b4ffca8..43d3bbc6f1 100644 --- a/Tools/ArdupilotMegaPlanner/ChangeLog.txt +++ b/Tools/ArdupilotMegaPlanner/ChangeLog.txt @@ -9,4 +9,12 @@ Fix Issue 662 - now reads sat count for mav 1.0 Partial Issue 654 - added current to status, hud still wip Fix Issue 648 - add validation to value Fix Issue 638 - add delay -Fix Issue 636 - check for version.txt in app directory \ No newline at end of file +Fix Issue 636 - check for version.txt in app directory +Fix config panel null bug +Add more Ardurover config options +Add Exceptions handling to video format selection +Add FORMAT_VERSION to param file ignore list +Fix NOTE param file line +Add APMRover hidden firmware upload (control-R) on firmware screen. +fix possible speach engine exception +add dataflashlog for apmrover diff --git a/Tools/ArdupilotMegaPlanner/Comms/CommsSerialInterface.cs b/Tools/ArdupilotMegaPlanner/Comms/CommsSerialInterface.cs index aee48f0402..49d17b59f7 100644 --- a/Tools/ArdupilotMegaPlanner/Comms/CommsSerialInterface.cs +++ b/Tools/ArdupilotMegaPlanner/Comms/CommsSerialInterface.cs @@ -50,7 +50,6 @@ namespace ArdupilotMega.Comms string PortName { get; set; } int ReadBufferSize { get; set; } int ReadTimeout { get; set; } - int ReceivedBytesThreshold { get; set; } bool RtsEnable { get; set; } StopBits StopBits { get; set; } int WriteBufferSize { get; set; } diff --git a/Tools/ArdupilotMegaPlanner/Comms/CommsTCPSerial.cs b/Tools/ArdupilotMegaPlanner/Comms/CommsTCPSerial.cs index 435e3f46ed..31703b3741 100644 --- a/Tools/ArdupilotMegaPlanner/Comms/CommsTCPSerial.cs +++ b/Tools/ArdupilotMegaPlanner/Comms/CommsTCPSerial.cs @@ -23,7 +23,6 @@ namespace ArdupilotMega.Comms public int WriteBufferSize { get; set; } public int WriteTimeout { get; set; } - public int ReceivedBytesThreshold { get; set; } public bool RtsEnable { get; set; } ~TcpSerial() diff --git a/Tools/ArdupilotMegaPlanner/Comms/CommsUdpSerial.cs b/Tools/ArdupilotMegaPlanner/Comms/CommsUdpSerial.cs index 8aa8bd72c1..5ab324bde1 100644 --- a/Tools/ArdupilotMegaPlanner/Comms/CommsUdpSerial.cs +++ b/Tools/ArdupilotMegaPlanner/Comms/CommsUdpSerial.cs @@ -20,7 +20,6 @@ namespace ArdupilotMega.Comms public int WriteBufferSize { get; set; } public int WriteTimeout { get; set; } - public int ReceivedBytesThreshold { get; set; } public bool RtsEnable { get; set; } ~UdpSerial() diff --git a/Tools/ArdupilotMegaPlanner/Controls/ConfigPanel.cs b/Tools/ArdupilotMegaPlanner/Controls/ConfigPanel.cs index 6056922e75..9aeb5289ca 100644 --- a/Tools/ArdupilotMegaPlanner/Controls/ConfigPanel.cs +++ b/Tools/ArdupilotMegaPlanner/Controls/ConfigPanel.cs @@ -46,6 +46,7 @@ namespace ArdupilotMega.Controls thisctl.Value = (decimal)(float)MainV2.comPort.param[value]; thisctl.Enabled = true; thisctl.Validated += new EventHandler(thisctl_Validated); + thisctl.ValueChanged += thisctl_Validated; } catch (Exception ex) { Console.WriteLine(ex.ToString()); } } diff --git a/Tools/ArdupilotMegaPlanner/Controls/ConnectionStats.Designer.cs b/Tools/ArdupilotMegaPlanner/Controls/ConnectionStats.Designer.cs index 333656539b..f3e8c44272 100644 --- a/Tools/ArdupilotMegaPlanner/Controls/ConnectionStats.Designer.cs +++ b/Tools/ArdupilotMegaPlanner/Controls/ConnectionStats.Designer.cs @@ -222,7 +222,7 @@ // label10 // this.label10.AutoSize = true; - this.label10.Location = new System.Drawing.Point(22, 96); + this.label10.Location = new System.Drawing.Point(13, 96); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(156, 13); this.label10.TabIndex = 16; diff --git a/Tools/ArdupilotMegaPlanner/Controls/LabelWithPseudoOpacity.cs b/Tools/ArdupilotMegaPlanner/Controls/LabelWithPseudoOpacity.cs new file mode 100644 index 0000000000..6b25ba319d --- /dev/null +++ b/Tools/ArdupilotMegaPlanner/Controls/LabelWithPseudoOpacity.cs @@ -0,0 +1,53 @@ +using System; +using System.ComponentModel; +using System.Windows.Forms; + +namespace ArdupilotMega.Controls +{ + /// + /// Label which uses a painting trick to simulate opacity + /// + /// + /// On Paint will put a rectangle with the same color as the background overtop + /// of the imapge. The Alpha of the rectangle's color is adjusted according to the + /// (new) Opacity property. + /// For this to appear as translucency, the background property must be set to the + /// same color as the background of the form. + /// + public class LabelWithPseudoOpacity : Label + { + private float _opacity = 1.0F; + + /// + /// The (simulated) Opacity. 0 is fully transparent, 1.0 is normal + /// + [Description("(Simulated) Opacity of the image"), Category("Appearance")] + [DefaultValue(typeof(float), "1.0")] + public float Opacity + { + get { return _opacity; } + set + { + if (_opacity == value) + return; + + if (value > 1.0F || value < 0.0F) + throw new ArgumentOutOfRangeException(); + + _opacity = value; + Console.WriteLine("Opacity:" + _opacity); + Invalidate(); + Invalidate(); + Invalidate(); + Invalidate(); + + } + } + + protected override void OnPaint(PaintEventArgs pe) + { + base.OnPaint(pe); + this.CoverWithRect(pe.Graphics, Opacity); + } + } +} \ No newline at end of file diff --git a/Tools/ArdupilotMegaPlanner/Controls/PictureBoxWithPseudoOpacity.cs b/Tools/ArdupilotMegaPlanner/Controls/PictureBoxWithPseudoOpacity.cs new file mode 100644 index 0000000000..cfc39b1fcf --- /dev/null +++ b/Tools/ArdupilotMegaPlanner/Controls/PictureBoxWithPseudoOpacity.cs @@ -0,0 +1,49 @@ +using System; +using System.ComponentModel; +using System.Windows.Forms; + +namespace ArdupilotMega.Controls +{ + /// + /// Picture Box which uses a painting trick to simulate opacity + /// + /// + /// On Paint will put a rectangle with the same color as the background overtop + /// of the imapge. The Alpha of the rectangle's color is adjusted according to the + /// (new) Opacity property. + /// For this to appear as translucency, the background property must be set to the + /// same color as the background of the form. + /// + public class PictureBoxWithPseudoOpacity : PictureBox + { + private float _opacity = 1.0F; + + + /// + /// The (simulated) Opacity. 0 is fully transparent, 1.0 is normal + /// + [Description("(Simulated) Opacity of the image"), Category("Appearance")] + [DefaultValue(typeof(float), "1.0")] + public float Opacity + { + get { return _opacity; } + set + { + if (_opacity == value) + return; + + if (value > 1.0F || value < 0.0F) + throw new ArgumentOutOfRangeException(); + + _opacity = value; + Invalidate(); + } + } + + protected override void OnPaint(PaintEventArgs pe) + { + base.OnPaint(pe); + this.CoverWithRect(pe.Graphics, Opacity); + } + } +} \ No newline at end of file diff --git a/Tools/ArdupilotMegaPlanner/Controls/PseudoOpacityHelper.cs b/Tools/ArdupilotMegaPlanner/Controls/PseudoOpacityHelper.cs new file mode 100644 index 0000000000..bc3230ce08 --- /dev/null +++ b/Tools/ArdupilotMegaPlanner/Controls/PseudoOpacityHelper.cs @@ -0,0 +1,24 @@ +using System; +using System.Drawing; +using System.Windows.Forms; + +namespace ArdupilotMega.Controls +{ + internal static class PseudoOpacityHelper + { + public static void CoverWithRect(this Control c, Graphics g, float opacity) + { + var bgcolor = c.BackColor; + int alpha = 255 - ((int)(opacity * 255)); + + Console.WriteLine("Alpha:" + alpha); + + + var opacityColor = Color.FromArgb(alpha, bgcolor.R, bgcolor.G, bgcolor.B); + using (var brush = new SolidBrush(opacityColor)) + { + g.FillRectangle(brush, 0, 0, c.Width, c.Height); + } + } + } +} \ No newline at end of file diff --git a/Tools/ArdupilotMegaPlanner/Controls/RangeControl.Designer.cs b/Tools/ArdupilotMegaPlanner/Controls/RangeControl.Designer.cs index 75772de327..59307b12b4 100644 --- a/Tools/ArdupilotMegaPlanner/Controls/RangeControl.Designer.cs +++ b/Tools/ArdupilotMegaPlanner/Controls/RangeControl.Designer.cs @@ -28,98 +28,98 @@ /// private void InitializeComponent() { - this.trackBar1 = new System.Windows.Forms.TrackBar(); - this.label1 = new System.Windows.Forms.Label(); - this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); - this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); - this.numericUpDown1 = new System.Windows.Forms.NumericUpDown(); - this.myLabel1 = new ArdupilotMega.Controls.MyLabel(); - ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).BeginInit(); - this.tableLayoutPanel1.SuspendLayout(); - this.tableLayoutPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit(); - this.SuspendLayout(); - // - // trackBar1 - // - this.trackBar1.Location = new System.Drawing.Point(77, 3); - this.trackBar1.Name = "trackBar1"; - this.trackBar1.Size = new System.Drawing.Size(179, 30); - this.trackBar1.TabIndex = 3; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(3, 5); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(35, 13); - this.label1.TabIndex = 4; - this.label1.Text = "label1"; - // - // tableLayoutPanel1 - // - this.tableLayoutPanel1.AutoSize = true; - this.tableLayoutPanel1.ColumnCount = 1; - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0); - this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel2, 0, 1); - this.tableLayoutPanel1.Location = new System.Drawing.Point(4, 33); - this.tableLayoutPanel1.Name = "tableLayoutPanel1"; - this.tableLayoutPanel1.Padding = new System.Windows.Forms.Padding(0, 5, 0, 10); - this.tableLayoutPanel1.RowCount = 2; - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel1.Size = new System.Drawing.Size(471, 70); - this.tableLayoutPanel1.TabIndex = 5; - // - // tableLayoutPanel2 - // - this.tableLayoutPanel2.ColumnCount = 2; - this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F)); - this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 75F)); - this.tableLayoutPanel2.Controls.Add(this.trackBar1, 1, 0); - this.tableLayoutPanel2.Controls.Add(this.numericUpDown1, 0, 0); - this.tableLayoutPanel2.Location = new System.Drawing.Point(3, 21); - this.tableLayoutPanel2.Name = "tableLayoutPanel2"; - this.tableLayoutPanel2.RowCount = 1; - this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel2.Size = new System.Drawing.Size(298, 36); - this.tableLayoutPanel2.TabIndex = 5; - // - // numericUpDown1 - // - this.numericUpDown1.Location = new System.Drawing.Point(3, 3); - this.numericUpDown1.Name = "numericUpDown1"; - this.numericUpDown1.Size = new System.Drawing.Size(47, 20); - this.numericUpDown1.TabIndex = 4; - // - // myLabel1 - // - this.myLabel1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.myLabel1.Location = new System.Drawing.Point(4, 4); - this.myLabel1.Name = "myLabel1"; - this.myLabel1.resize = false; - this.myLabel1.Size = new System.Drawing.Size(227, 23); - this.myLabel1.TabIndex = 0; - this.myLabel1.Text = "myLabel1"; - // - // RangeControl - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.AutoSize = true; - this.Controls.Add(this.tableLayoutPanel1); - this.Controls.Add(this.myLabel1); - this.Name = "RangeControl"; - this.Size = new System.Drawing.Size(478, 106); - ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).EndInit(); - this.tableLayoutPanel1.ResumeLayout(false); - this.tableLayoutPanel1.PerformLayout(); - this.tableLayoutPanel2.ResumeLayout(false); - this.tableLayoutPanel2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); + this.trackBar1 = new System.Windows.Forms.TrackBar(); + this.label1 = new System.Windows.Forms.Label(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); + this.numericUpDown1 = new System.Windows.Forms.NumericUpDown(); + this.myLabel1 = new ArdupilotMega.Controls.MyLabel(); + ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).BeginInit(); + this.tableLayoutPanel1.SuspendLayout(); + this.tableLayoutPanel2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit(); + this.SuspendLayout(); + // + // trackBar1 + // + this.trackBar1.Location = new System.Drawing.Point(77, 3); + this.trackBar1.Name = "trackBar1"; + this.trackBar1.Size = new System.Drawing.Size(179, 30); + this.trackBar1.TabIndex = 3; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(3, 5); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(35, 13); + this.label1.TabIndex = 4; + this.label1.Text = "label1"; + // + // tableLayoutPanel1 + // + this.tableLayoutPanel1.AutoSize = true; + this.tableLayoutPanel1.ColumnCount = 1; + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel2, 0, 1); + this.tableLayoutPanel1.Location = new System.Drawing.Point(4, 33); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + this.tableLayoutPanel1.Padding = new System.Windows.Forms.Padding(0, 5, 0, 10); + this.tableLayoutPanel1.RowCount = 2; + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.Size = new System.Drawing.Size(471, 70); + this.tableLayoutPanel1.TabIndex = 5; + // + // tableLayoutPanel2 + // + this.tableLayoutPanel2.ColumnCount = 2; + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F)); + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 75F)); + this.tableLayoutPanel2.Controls.Add(this.trackBar1, 1, 0); + this.tableLayoutPanel2.Controls.Add(this.numericUpDown1, 0, 0); + this.tableLayoutPanel2.Location = new System.Drawing.Point(3, 21); + this.tableLayoutPanel2.Name = "tableLayoutPanel2"; + this.tableLayoutPanel2.RowCount = 1; + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel2.Size = new System.Drawing.Size(298, 36); + this.tableLayoutPanel2.TabIndex = 5; + // + // numericUpDown1 + // + this.numericUpDown1.Location = new System.Drawing.Point(3, 3); + this.numericUpDown1.Name = "numericUpDown1"; + this.numericUpDown1.Size = new System.Drawing.Size(47, 20); + this.numericUpDown1.TabIndex = 4; + // + // myLabel1 + // + this.myLabel1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.myLabel1.Location = new System.Drawing.Point(4, 4); + this.myLabel1.Name = "myLabel1"; + this.myLabel1.resize = false; + this.myLabel1.Size = new System.Drawing.Size(301, 23); + this.myLabel1.TabIndex = 0; + this.myLabel1.Text = "myLabel1"; + // + // RangeControl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.AutoSize = true; + this.Controls.Add(this.tableLayoutPanel1); + this.Controls.Add(this.myLabel1); + this.Name = "RangeControl"; + this.Size = new System.Drawing.Size(478, 106); + ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).EndInit(); + this.tableLayoutPanel1.ResumeLayout(false); + this.tableLayoutPanel1.PerformLayout(); + this.tableLayoutPanel2.ResumeLayout(false); + this.tableLayoutPanel2.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); } diff --git a/Tools/ArdupilotMegaPlanner/CurrentState.cs b/Tools/ArdupilotMegaPlanner/CurrentState.cs index 880a2a1a0d..4c1150fa92 100644 --- a/Tools/ArdupilotMegaPlanner/CurrentState.cs +++ b/Tools/ArdupilotMegaPlanner/CurrentState.cs @@ -280,6 +280,10 @@ namespace ArdupilotMega get { float work = 0; + if (localsnrdb == 0) + { + return 0; + } if (localsnrdb > remotesnrdb) { // remote diff --git a/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigArducopter.Designer.cs b/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigArducopter.Designer.cs index 88faabb310..b1247dc95a 100644 --- a/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigArducopter.Designer.cs +++ b/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigArducopter.Designer.cs @@ -128,6 +128,15 @@ this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); this.BUT_writePIDS = new ArdupilotMega.Controls.MyButton(); this.BUT_rerequestparams = new ArdupilotMega.Controls.MyButton(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.LOITER_LAT_D = new System.Windows.Forms.NumericUpDown(); + this.label1 = new System.Windows.Forms.Label(); + this.LOITER_LAT_IMAX = new System.Windows.Forms.NumericUpDown(); + this.label2 = new System.Windows.Forms.Label(); + this.LOITER_LAT_I = new System.Windows.Forms.NumericUpDown(); + this.label3 = new System.Windows.Forms.Label(); + this.LOITER_LAT_P = new System.Windows.Forms.NumericUpDown(); + this.label4 = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.TUNE_LOW)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.TUNE_HIGH)).BeginInit(); this.groupBox5.SuspendLayout(); @@ -179,6 +188,11 @@ ((System.ComponentModel.ISupportInitialize)(this.RATE_RLL_IMAX)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.RATE_RLL_I)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.RATE_RLL_P)).BeginInit(); + this.groupBox1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.LOITER_LAT_D)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.LOITER_LAT_IMAX)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.LOITER_LAT_I)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.LOITER_LAT_P)).BeginInit(); this.SuspendLayout(); // // myLabel3 @@ -801,10 +815,65 @@ this.BUT_rerequestparams.UseVisualStyleBackColor = true; this.BUT_rerequestparams.Click += new System.EventHandler(this.BUT_rerequestparams_Click); // + // groupBox1 + // + this.groupBox1.Controls.Add(this.LOITER_LAT_D); + this.groupBox1.Controls.Add(this.label1); + this.groupBox1.Controls.Add(this.LOITER_LAT_IMAX); + this.groupBox1.Controls.Add(this.label2); + this.groupBox1.Controls.Add(this.LOITER_LAT_I); + this.groupBox1.Controls.Add(this.label3); + this.groupBox1.Controls.Add(this.LOITER_LAT_P); + this.groupBox1.Controls.Add(this.label4); + resources.ApplyResources(this.groupBox1, "groupBox1"); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.TabStop = false; + // + // LOITER_LAT_D + // + resources.ApplyResources(this.LOITER_LAT_D, "LOITER_LAT_D"); + this.LOITER_LAT_D.Name = "LOITER_LAT_D"; + // + // label1 + // + resources.ApplyResources(this.label1, "label1"); + this.label1.Name = "label1"; + // + // LOITER_LAT_IMAX + // + resources.ApplyResources(this.LOITER_LAT_IMAX, "LOITER_LAT_IMAX"); + this.LOITER_LAT_IMAX.Name = "LOITER_LAT_IMAX"; + // + // label2 + // + resources.ApplyResources(this.label2, "label2"); + this.label2.Name = "label2"; + // + // LOITER_LAT_I + // + resources.ApplyResources(this.LOITER_LAT_I, "LOITER_LAT_I"); + this.LOITER_LAT_I.Name = "LOITER_LAT_I"; + // + // label3 + // + resources.ApplyResources(this.label3, "label3"); + this.label3.Name = "label3"; + // + // LOITER_LAT_P + // + resources.ApplyResources(this.LOITER_LAT_P, "LOITER_LAT_P"); + this.LOITER_LAT_P.Name = "LOITER_LAT_P"; + // + // label4 + // + resources.ApplyResources(this.label4, "label4"); + this.label4.Name = "label4"; + // // ConfigArducopter // resources.ApplyResources(this, "$this"); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.groupBox1); this.Controls.Add(this.BUT_rerequestparams); this.Controls.Add(this.BUT_writePIDS); this.Controls.Add(this.myLabel3); @@ -879,6 +948,11 @@ ((System.ComponentModel.ISupportInitialize)(this.RATE_RLL_IMAX)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.RATE_RLL_I)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.RATE_RLL_P)).EndInit(); + this.groupBox1.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.LOITER_LAT_D)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.LOITER_LAT_IMAX)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.LOITER_LAT_I)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.LOITER_LAT_P)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -984,5 +1058,14 @@ private System.Windows.Forms.ToolTip toolTip1; private Controls.MyButton BUT_writePIDS; private Controls.MyButton BUT_rerequestparams; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.NumericUpDown LOITER_LAT_D; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.NumericUpDown LOITER_LAT_IMAX; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.NumericUpDown LOITER_LAT_I; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.NumericUpDown LOITER_LAT_P; + private System.Windows.Forms.Label label4; } } diff --git a/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigArducopter.cs b/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigArducopter.cs index 0f64de4203..b0ccea8669 100644 --- a/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigArducopter.cs +++ b/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigArducopter.cs @@ -326,6 +326,19 @@ namespace ArdupilotMega.GCSViews.ConfigurationView arr[0].BackColor = Color.Green; } } + // keep loiter_lat and loiter_lon paired + if (name.Contains("LOITER_LAT_")) + { + string newname = name.Replace("LOITER_LAT_", "LOITER_LON_"); + Control[] arr = this.Controls.Find(newname, true); + changes[newname] = float.Parse(((Control)sender).Text); + + if (arr.Length > 0) + { + arr[0].Text = ((Control)sender).Text; + arr[0].BackColor = Color.Green; + } + } // keep nav_lat and nav_lon paired if (name.Contains("HLD_LAT_")) { diff --git a/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigArducopter.resx b/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigArducopter.resx index 81c07eaaa4..c155d19dff 100644 --- a/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigArducopter.resx +++ b/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigArducopter.resx @@ -119,7 +119,7 @@ - 540, 302 + 364, 321 29, 23 @@ -135,16 +135,16 @@ myLabel3 - ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4523.24267, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4564.20854, Culture=neutral, PublicKeyToken=null $this - 2 + 3 - 575, 305 + 399, 324 51, 20 @@ -162,10 +162,10 @@ $this - 3 + 4 - 665, 305 + 489, 324 46, 20 @@ -183,10 +183,10 @@ $this - 4 + 5 - 540, 277 + 364, 296 53, 23 @@ -201,13 +201,13 @@ myLabel2 - ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4523.24267, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4564.20854, Culture=neutral, PublicKeyToken=null $this - 5 + 6 CH6_NONE @@ -276,7 +276,7 @@ CH6_RATE_KD - 599, 277 + 423, 296 112, 21 @@ -294,10 +294,10 @@ $this - 6 + 7 - 540, 329 + 364, 348 53, 23 @@ -312,13 +312,13 @@ myLabel1 - ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4523.24267, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4564.20854, Culture=neutral, PublicKeyToken=null $this - 7 + 8 Do Nothing @@ -345,7 +345,7 @@ Save WP - 599, 329 + 423, 348 112, 21 @@ -363,7 +363,7 @@ $this - 8 + 9 80, 60 @@ -559,7 +559,7 @@ 7 - 12, 267 + 12, 247 170, 110 @@ -580,7 +580,7 @@ $this - 9 + 10 True @@ -589,7 +589,7 @@ NoControl - 9, 247 + 12, 112 154, 17 @@ -610,7 +610,7 @@ $this - 10 + 11 80, 60 @@ -853,7 +853,7 @@ 9 - 540, 133 + 541, 247 170, 131 @@ -874,7 +874,7 @@ $this - 11 + 12 80, 13 @@ -925,7 +925,7 @@ 1 - 364, 267 + 364, 247 170, 43 @@ -946,7 +946,7 @@ $this - 12 + 13 80, 63 @@ -1093,7 +1093,7 @@ 5 - 188, 267 + 188, 247 170, 110 @@ -1114,7 +1114,7 @@ $this - 13 + 14 80, 61 @@ -1270,7 +1270,7 @@ 27 - Loiter + Loiter Speed groupBox19 @@ -1282,7 +1282,7 @@ $this - 14 + 15 80, 63 @@ -1450,7 +1450,7 @@ $this - 15 + 16 80, 88 @@ -1666,7 +1666,7 @@ $this - 16 + 17 80, 63 @@ -1834,7 +1834,7 @@ $this - 17 + 18 80, 60 @@ -2050,7 +2050,7 @@ $this - 18 + 19 80, 60 @@ -2266,7 +2266,7 @@ $this - 19 + 20 80, 60 @@ -2482,7 +2482,7 @@ $this - 20 + 21 17, 17 @@ -2506,13 +2506,13 @@ BUT_writePIDS - ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4523.24267, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4564.20854, Culture=neutral, PublicKeyToken=null $this - 1 + 2 NoControl @@ -2536,12 +2536,228 @@ BUT_rerequestparams - ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4523.24267, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4564.20854, Culture=neutral, PublicKeyToken=null $this + 1 + + + 80, 60 + + + 78, 20 + + + 8 + + + LOITER_LAT_D + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 0 + + + NoControl + + + 6, 63 + + + 10, 13 + + + 9 + + + D + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 1 + + + 80, 84 + + + 78, 20 + + + 0 + + + LOITER_LAT_IMAX + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 2 + + + NoControl + + + 6, 87 + + + 65, 13 + + + 1 + + + IMAX + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 3 + + + 80, 37 + + + 78, 20 + + + 4 + + + LOITER_LAT_I + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 4 + + + NoControl + + + 6, 40 + + + 10, 13 + + + 5 + + + I + + + label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 5 + + + 80, 13 + + + 78, 20 + + + 6 + + + LOITER_LAT_P + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 6 + + + NoControl + + + 6, 16 + + + 14, 13 + + + 7 + + + P + + + label4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 7 + + + 537, 133 + + + 170, 108 + + + 32 + + + Rate Loiter + + + groupBox1 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + 0 @@ -2566,6 +2782,6 @@ ConfigArducopter - ArdupilotMega.Controls.BackstageView.BackStageViewContentPanel, ArdupilotMegaPlanner, Version=1.1.4523.24267, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.BackstageView.BackStageViewContentPanel, ArdupilotMegaPlanner10, Version=1.1.4564.20854, Culture=neutral, PublicKeyToken=null \ No newline at end of file diff --git a/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigBatteryMonitoring.resx b/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigBatteryMonitoring.resx index ba6578891f..34d2e7f1d5 100644 --- a/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigBatteryMonitoring.resx +++ b/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigBatteryMonitoring.resx @@ -117,152 +117,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - label31 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox4 - - - 0 - - - label32 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox4 - - - 1 - - - label33 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox4 - - - 2 - - - TXT_ampspervolt - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox4 - - - 3 - - - label34 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox4 - - - 4 - - - TXT_divider - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox4 - - - 5 - - - label35 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox4 - - - 6 - - - TXT_voltage - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox4 - - - 7 - - - TXT_inputvoltage - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox4 - - - 8 - - - TXT_measuredvoltage - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox4 - - - 9 - - - - 14, 172 - - - 238, 131 - - - 50 - - - Calibration - - - groupBox4 - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 0 - True @@ -270,6 +125,7 @@ NoControl + 5, 16 @@ -364,7 +220,7 @@ 2 - 149, 100 + 157, 100 2, 2, 2, 2 @@ -421,7 +277,7 @@ 4 - 149, 78 + 157, 78 2, 2, 2, 2 @@ -478,7 +334,7 @@ 6 - 149, 57 + 157, 57 2, 2, 2, 2 @@ -502,7 +358,7 @@ 7 - 149, 13 + 157, 13 2, 2, 2, 2 @@ -526,7 +382,7 @@ 8 - 149, 35 + 157, 35 2, 2, 2, 2 @@ -549,6 +405,30 @@ 9 + + 14, 172 + + + 238, 131 + + + 50 + + + Calibration + + + groupBox4 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + NoControl @@ -802,6 +682,6 @@ Then subtract 0.3v from that value and enter it in field #1 at left. ConfigBatteryMonitoring - ArdupilotMega.Controls.BackstageView.BackStageViewContentPanel, ArdupilotMegaPlanner, Version=1.1.4531.12462, Culture=neutral, PublicKeyToken=null + ArdupilotMega.Controls.BackstageView.BackStageViewContentPanel, ArdupilotMegaPlanner10, Version=1.1.4564.19603, Culture=neutral, PublicKeyToken=null \ No newline at end of file diff --git a/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigCameraStab.Designer.cs b/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigCameraStab.Designer.cs new file mode 100644 index 0000000000..871ab344a0 --- /dev/null +++ b/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigCameraStab.Designer.cs @@ -0,0 +1,630 @@ +using ArdupilotMega.Controls; +using ArdupilotMega.Presenter; + +namespace ArdupilotMega.GCSViews.ConfigurationView +{ + partial class ConfigCameraStab + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// pi + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.numericUpDown1 = new System.Windows.Forms.NumericUpDown(); + this.presenterBindingSource = new System.Windows.Forms.BindingSource(this.components); + this.checkBox1 = new System.Windows.Forms.CheckBox(); + this.numericUpDown2 = new System.Windows.Forms.NumericUpDown(); + this.numericUpDown3 = new System.Windows.Forms.NumericUpDown(); + this.numericUpDown4 = new System.Windows.Forms.NumericUpDown(); + this.BUT_WriteValues = new ArdupilotMega.Controls.MyButton(); + this.BUT_SetDefaults = new ArdupilotMega.Controls.MyButton(); + this.BUT_Refresh = new ArdupilotMega.Controls.MyButton(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.pictureBox2 = new System.Windows.Forms.PictureBox(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.label8 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.label10 = new System.Windows.Forms.Label(); + this.numericUpDown5 = new System.Windows.Forms.NumericUpDown(); + this.numericUpDown6 = new System.Windows.Forms.NumericUpDown(); + this.numericUpDown7 = new System.Windows.Forms.NumericUpDown(); + this.checkBox2 = new System.Windows.Forms.CheckBox(); + this.numericUpDown8 = new System.Windows.Forms.NumericUpDown(); + this.PBOX_WarningIcon = new ArdupilotMega.Controls.PictureBoxWithPseudoOpacity(); + this.LBL_Error = new ArdupilotMega.Controls.LabelWithPseudoOpacity(); + this.LNK_wiki = new System.Windows.Forms.LinkLabel(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.presenterBindingSource)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown3)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown4)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown5)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown6)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown7)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown8)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.PBOX_WarningIcon)).BeginInit(); + this.SuspendLayout(); + // + // pictureBox1 + // + 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.Location = new System.Drawing.Point(33, 52); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(203, 112); + this.pictureBox1.TabIndex = 0; + this.pictureBox1.TabStop = false; + // + // numericUpDown1 + // + this.numericUpDown1.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.presenterBindingSource, "CameraPitchGain", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); + this.numericUpDown1.DecimalPlaces = 2; + this.numericUpDown1.Increment = new decimal(new int[] { + 5, + 0, + 0, + 131072}); + this.numericUpDown1.Location = new System.Drawing.Point(376, 77); + this.numericUpDown1.Maximum = new decimal(new int[] { + 5, + 0, + 0, + 0}); + this.numericUpDown1.Name = "numericUpDown1"; + this.numericUpDown1.Size = new System.Drawing.Size(55, 20); + this.numericUpDown1.TabIndex = 4; + this.numericUpDown1.Value = new decimal(new int[] { + 10, + 0, + 0, + 65536}); + // + // presenterBindingSource + // + this.presenterBindingSource.DataSource = typeof(ArdupilotMega.Presenter.ConfigCameraStabPresenter); + // + // checkBox1 + // + this.checkBox1.AutoSize = true; + this.checkBox1.DataBindings.Add(new System.Windows.Forms.Binding("Checked", this.presenterBindingSource, "CameraPitchReverse", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); + this.checkBox1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); + this.checkBox1.Location = new System.Drawing.Point(365, 129); + this.checkBox1.Name = "checkBox1"; + this.checkBox1.Size = new System.Drawing.Size(66, 17); + this.checkBox1.TabIndex = 5; + this.checkBox1.Text = "Reverse"; + this.checkBox1.UseVisualStyleBackColor = true; + // + // numericUpDown2 + // + this.numericUpDown2.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.presenterBindingSource, "CameraPitchMax", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); + this.numericUpDown2.Increment = new decimal(new int[] { + 10, + 0, + 0, + 0}); + this.numericUpDown2.Location = new System.Drawing.Point(273, 129); + this.numericUpDown2.Maximum = new decimal(new int[] { + 2200, + 0, + 0, + 0}); + this.numericUpDown2.Minimum = new decimal(new int[] { + 800, + 0, + 0, + 0}); + this.numericUpDown2.Name = "numericUpDown2"; + this.numericUpDown2.Size = new System.Drawing.Size(59, 20); + this.numericUpDown2.TabIndex = 6; + this.numericUpDown2.Value = new decimal(new int[] { + 2000, + 0, + 0, + 0}); + // + // numericUpDown3 + // + this.numericUpDown3.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.presenterBindingSource, "CameraPitchTrim", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); + this.numericUpDown3.Increment = new decimal(new int[] { + 10, + 0, + 0, + 0}); + this.numericUpDown3.Location = new System.Drawing.Point(273, 103); + this.numericUpDown3.Maximum = new decimal(new int[] { + 2200, + 0, + 0, + 0}); + this.numericUpDown3.Minimum = new decimal(new int[] { + 800, + 0, + 0, + 0}); + this.numericUpDown3.Name = "numericUpDown3"; + this.numericUpDown3.Size = new System.Drawing.Size(59, 20); + this.numericUpDown3.TabIndex = 7; + this.numericUpDown3.Value = new decimal(new int[] { + 1500, + 0, + 0, + 0}); + // + // numericUpDown4 + // + this.numericUpDown4.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.presenterBindingSource, "CameraPitchMin", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); + this.numericUpDown4.Increment = new decimal(new int[] { + 10, + 0, + 0, + 0}); + this.numericUpDown4.Location = new System.Drawing.Point(273, 77); + this.numericUpDown4.Maximum = new decimal(new int[] { + 2200, + 0, + 0, + 0}); + this.numericUpDown4.Minimum = new decimal(new int[] { + 800, + 0, + 0, + 0}); + this.numericUpDown4.Name = "numericUpDown4"; + this.numericUpDown4.Size = new System.Drawing.Size(59, 20); + this.numericUpDown4.TabIndex = 8; + this.numericUpDown4.Value = new decimal(new int[] { + 1000, + 0, + 0, + 0}); + // + // BUT_WriteValues + // + this.BUT_WriteValues.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.BUT_WriteValues.DataBindings.Add(new System.Windows.Forms.Binding("Tag", this.presenterBindingSource, "WriteValuesCommand", true)); + this.BUT_WriteValues.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.BUT_WriteValues.Location = new System.Drawing.Point(568, 383); + this.BUT_WriteValues.Name = "BUT_WriteValues"; + this.BUT_WriteValues.Size = new System.Drawing.Size(94, 37); + this.BUT_WriteValues.TabIndex = 49; + this.BUT_WriteValues.Text = "Write"; + this.BUT_WriteValues.UseVisualStyleBackColor = true; + // + // BUT_SetDefaults + // + this.BUT_SetDefaults.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.BUT_SetDefaults.DataBindings.Add(new System.Windows.Forms.Binding("Tag", this.presenterBindingSource, "SetDefaultsCommand", true, System.Windows.Forms.DataSourceUpdateMode.Never)); + this.BUT_SetDefaults.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.BUT_SetDefaults.Location = new System.Drawing.Point(30, 397); + this.BUT_SetDefaults.Name = "BUT_SetDefaults"; + this.BUT_SetDefaults.Size = new System.Drawing.Size(78, 23); + this.BUT_SetDefaults.TabIndex = 50; + this.BUT_SetDefaults.Text = "Set Defaults"; + this.BUT_SetDefaults.UseVisualStyleBackColor = true; + // + // BUT_Refresh + // + this.BUT_Refresh.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.BUT_Refresh.DataBindings.Add(new System.Windows.Forms.Binding("Tag", this.presenterBindingSource, "RefreshValuesCommand", true)); + this.BUT_Refresh.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.BUT_Refresh.Location = new System.Drawing.Point(114, 397); + this.BUT_Refresh.Name = "BUT_Refresh"; + this.BUT_Refresh.Size = new System.Drawing.Size(78, 23); + this.BUT_Refresh.TabIndex = 51; + this.BUT_Refresh.Text = "Refresh"; + this.BUT_Refresh.UseVisualStyleBackColor = true; + // + // groupBox1 + // + this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox1.Location = new System.Drawing.Point(17, 216); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(635, 5); + this.groupBox1.TabIndex = 52; + this.groupBox1.TabStop = false; + // + // pictureBox2 + // + this.pictureBox2.BackgroundImage = global::ArdupilotMega.Properties.Resources.cameraGimalRoll1; + this.pictureBox2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.pictureBox2.Location = new System.Drawing.Point(33, 207); + this.pictureBox2.Name = "pictureBox2"; + this.pictureBox2.Size = new System.Drawing.Size(203, 112); + this.pictureBox2.TabIndex = 53; + this.pictureBox2.TabStop = false; + // + // groupBox2 + // + this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox2.Location = new System.Drawing.Point(17, 59); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(635, 5); + this.groupBox2.TabIndex = 59; + this.groupBox2.TabStop = false; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.ForeColor = System.Drawing.Color.WhiteSmoke; + this.label1.Location = new System.Drawing.Point(243, 79); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(24, 13); + this.label1.TabIndex = 60; + this.label1.Text = "Min"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.ForeColor = System.Drawing.Color.WhiteSmoke; + this.label2.Location = new System.Drawing.Point(243, 105); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(27, 13); + this.label2.TabIndex = 61; + this.label2.Text = "Trim"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.ForeColor = System.Drawing.Color.WhiteSmoke; + this.label3.Location = new System.Drawing.Point(243, 133); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(27, 13); + this.label3.TabIndex = 62; + this.label3.Text = "Max"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.ForeColor = System.Drawing.Color.WhiteSmoke; + this.label4.Location = new System.Drawing.Point(346, 79); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(29, 13); + this.label4.TabIndex = 63; + this.label4.Text = "Gain"; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label5.ForeColor = System.Drawing.Color.WhiteSmoke; + this.label5.Location = new System.Drawing.Point(21, 40); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(44, 20); + this.label5.TabIndex = 64; + this.label5.Text = "Pitch"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label6.ForeColor = System.Drawing.Color.WhiteSmoke; + this.label6.Location = new System.Drawing.Point(20, 198); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(36, 20); + this.label6.TabIndex = 65; + this.label6.Text = "Roll"; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.ForeColor = System.Drawing.Color.WhiteSmoke; + this.label7.Location = new System.Drawing.Point(346, 237); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(29, 13); + this.label7.TabIndex = 74; + this.label7.Text = "Gain"; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.ForeColor = System.Drawing.Color.WhiteSmoke; + this.label8.Location = new System.Drawing.Point(243, 291); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(27, 13); + this.label8.TabIndex = 73; + this.label8.Text = "Max"; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.ForeColor = System.Drawing.Color.WhiteSmoke; + this.label9.Location = new System.Drawing.Point(243, 263); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(27, 13); + this.label9.TabIndex = 72; + this.label9.Text = "Trim"; + // + // label10 + // + this.label10.AutoSize = true; + this.label10.ForeColor = System.Drawing.Color.WhiteSmoke; + this.label10.Location = new System.Drawing.Point(243, 237); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(24, 13); + this.label10.TabIndex = 71; + this.label10.Text = "Min"; + // + // numericUpDown5 + // + this.numericUpDown5.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.presenterBindingSource, "CameraRollMin", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); + this.numericUpDown5.Increment = new decimal(new int[] { + 10, + 0, + 0, + 0}); + this.numericUpDown5.Location = new System.Drawing.Point(273, 235); + this.numericUpDown5.Maximum = new decimal(new int[] { + 2200, + 0, + 0, + 0}); + this.numericUpDown5.Minimum = new decimal(new int[] { + 800, + 0, + 0, + 0}); + this.numericUpDown5.Name = "numericUpDown5"; + this.numericUpDown5.Size = new System.Drawing.Size(59, 20); + this.numericUpDown5.TabIndex = 70; + this.numericUpDown5.Value = new decimal(new int[] { + 1000, + 0, + 0, + 0}); + // + // numericUpDown6 + // + this.numericUpDown6.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.presenterBindingSource, "CameraRollTrim", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); + this.numericUpDown6.Increment = new decimal(new int[] { + 10, + 0, + 0, + 0}); + this.numericUpDown6.Location = new System.Drawing.Point(273, 261); + this.numericUpDown6.Maximum = new decimal(new int[] { + 2200, + 0, + 0, + 0}); + this.numericUpDown6.Minimum = new decimal(new int[] { + 800, + 0, + 0, + 0}); + this.numericUpDown6.Name = "numericUpDown6"; + this.numericUpDown6.Size = new System.Drawing.Size(59, 20); + this.numericUpDown6.TabIndex = 69; + this.numericUpDown6.Value = new decimal(new int[] { + 1500, + 0, + 0, + 0}); + // + // numericUpDown7 + // + this.numericUpDown7.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.presenterBindingSource, "CameraRollMax", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); + this.numericUpDown7.Increment = new decimal(new int[] { + 10, + 0, + 0, + 0}); + this.numericUpDown7.Location = new System.Drawing.Point(273, 287); + this.numericUpDown7.Maximum = new decimal(new int[] { + 2200, + 0, + 0, + 0}); + this.numericUpDown7.Minimum = new decimal(new int[] { + 800, + 0, + 0, + 0}); + this.numericUpDown7.Name = "numericUpDown7"; + this.numericUpDown7.Size = new System.Drawing.Size(59, 20); + this.numericUpDown7.TabIndex = 68; + this.numericUpDown7.Value = new decimal(new int[] { + 2000, + 0, + 0, + 0}); + // + // checkBox2 + // + this.checkBox2.AutoSize = true; + this.checkBox2.DataBindings.Add(new System.Windows.Forms.Binding("Checked", this.presenterBindingSource, "CameraRollReverse", true)); + this.checkBox2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); + this.checkBox2.Location = new System.Drawing.Point(365, 287); + this.checkBox2.Name = "checkBox2"; + this.checkBox2.Size = new System.Drawing.Size(66, 17); + this.checkBox2.TabIndex = 67; + this.checkBox2.Text = "Reverse"; + this.checkBox2.UseVisualStyleBackColor = true; + // + // numericUpDown8 + // + this.numericUpDown8.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.presenterBindingSource, "CameraRollGain", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); + this.numericUpDown8.DecimalPlaces = 2; + this.numericUpDown8.Increment = new decimal(new int[] { + 5, + 0, + 0, + 131072}); + this.numericUpDown8.Location = new System.Drawing.Point(376, 235); + this.numericUpDown8.Maximum = new decimal(new int[] { + 5, + 0, + 0, + 0}); + this.numericUpDown8.Name = "numericUpDown8"; + this.numericUpDown8.Size = new System.Drawing.Size(55, 20); + this.numericUpDown8.TabIndex = 66; + this.numericUpDown8.Value = new decimal(new int[] { + 10, + 0, + 0, + 65536}); + // + // PBOX_WarningIcon + // + this.PBOX_WarningIcon.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.PBOX_WarningIcon.Image = global::ArdupilotMega.Properties.Resources.iconWarning32; + this.PBOX_WarningIcon.Location = new System.Drawing.Point(264, 389); + this.PBOX_WarningIcon.Name = "PBOX_WarningIcon"; + this.PBOX_WarningIcon.Opacity = 0.5F; + this.PBOX_WarningIcon.Size = new System.Drawing.Size(32, 32); + this.PBOX_WarningIcon.TabIndex = 75; + this.PBOX_WarningIcon.TabStop = false; + // + // LBL_Error + // + this.LBL_Error.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.LBL_Error.AutoSize = true; + this.LBL_Error.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.presenterBindingSource, "Error", true)); + this.LBL_Error.ForeColor = System.Drawing.Color.WhiteSmoke; + this.LBL_Error.Location = new System.Drawing.Point(303, 402); + this.LBL_Error.Name = "LBL_Error"; + this.LBL_Error.Size = new System.Drawing.Size(138, 13); + this.LBL_Error.TabIndex = 76; + this.LBL_Error.Text = "Error Message of some kind"; + // + // LNK_wiki + // + this.LNK_wiki.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.LNK_wiki.AutoSize = true; + this.LNK_wiki.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline; + this.LNK_wiki.LinkColor = System.Drawing.Color.CornflowerBlue; + this.LNK_wiki.Location = new System.Drawing.Point(624, 9); + this.LNK_wiki.Name = "LNK_wiki"; + this.LNK_wiki.Size = new System.Drawing.Size(28, 13); + this.LNK_wiki.TabIndex = 77; + this.LNK_wiki.TabStop = true; + this.LNK_wiki.Text = "Wiki"; + this.LNK_wiki.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LNK_Wiki_Clicked); + // + // ConfigCameraStab + // + this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(38)))), ((int)(((byte)(39)))), ((int)(((byte)(40))))); + this.Controls.Add(this.LNK_wiki); + this.Controls.Add(this.LBL_Error); + this.Controls.Add(this.PBOX_WarningIcon); + this.Controls.Add(this.label7); + this.Controls.Add(this.label8); + this.Controls.Add(this.label9); + this.Controls.Add(this.label10); + this.Controls.Add(this.numericUpDown5); + this.Controls.Add(this.numericUpDown6); + this.Controls.Add(this.numericUpDown7); + this.Controls.Add(this.checkBox2); + this.Controls.Add(this.numericUpDown8); + this.Controls.Add(this.label6); + this.Controls.Add(this.label5); + this.Controls.Add(this.label4); + this.Controls.Add(this.label3); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); + this.Controls.Add(this.groupBox2); + this.Controls.Add(this.groupBox1); + this.Controls.Add(this.BUT_Refresh); + this.Controls.Add(this.BUT_SetDefaults); + this.Controls.Add(this.BUT_WriteValues); + this.Controls.Add(this.numericUpDown4); + this.Controls.Add(this.numericUpDown3); + this.Controls.Add(this.numericUpDown2); + this.Controls.Add(this.checkBox1); + this.Controls.Add(this.numericUpDown1); + this.Controls.Add(this.pictureBox2); + this.Controls.Add(this.pictureBox1); + this.Name = "ConfigCameraStab"; + this.Size = new System.Drawing.Size(674, 432); + this.Load += new System.EventHandler(this.ConfigCameraStab_Load); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.presenterBindingSource)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown3)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown4)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown5)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown6)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown7)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown8)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.PBOX_WarningIcon)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.PictureBox pictureBox1; + private System.Windows.Forms.NumericUpDown numericUpDown1; + private System.Windows.Forms.CheckBox checkBox1; + private System.Windows.Forms.NumericUpDown numericUpDown2; + private System.Windows.Forms.NumericUpDown numericUpDown3; + private System.Windows.Forms.NumericUpDown numericUpDown4; + private Controls.MyButton BUT_WriteValues; + private Controls.MyButton BUT_SetDefaults; + private Controls.MyButton BUT_Refresh; + private System.Windows.Forms.PictureBox pictureBox2; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.NumericUpDown numericUpDown5; + private System.Windows.Forms.NumericUpDown numericUpDown6; + private System.Windows.Forms.NumericUpDown numericUpDown7; + private System.Windows.Forms.CheckBox checkBox2; + private System.Windows.Forms.NumericUpDown numericUpDown8; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.BindingSource presenterBindingSource; + private PictureBoxWithPseudoOpacity PBOX_WarningIcon; + private LabelWithPseudoOpacity LBL_Error; + private System.Windows.Forms.LinkLabel LNK_wiki; + + } +} diff --git a/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigCameraStab.cs b/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigCameraStab.cs new file mode 100644 index 0000000000..ca3a0f5cfc --- /dev/null +++ b/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigCameraStab.cs @@ -0,0 +1,126 @@ +using System; +using System.ComponentModel; +using System.Diagnostics; +using System.Drawing; +using System.Linq; +using System.Windows.Forms; +using ArdupilotMega.Controls.BackstageView; +using ArdupilotMega.Presenter; +using Transitions; + +namespace ArdupilotMega.GCSViews.ConfigurationView +{ + public partial class ConfigCameraStab : BackStageViewContentPanel + { + private ConfigCameraStabPresenter _presenter; + private Transition[] _ErrorTransition; + private Transition _NoErrorTransition; + + public ConfigCameraStab() + { + InitializeComponent(); + PBOX_WarningIcon.Opacity = 0.0F; + LBL_Error.Opacity = 0.0F; + } + + private void ConfigCameraStab_Load(object sender, EventArgs ev) + { + _presenter = new ConfigCameraStabPresenter(MainV2.comPort); + presenterBindingSource.DataSource = _presenter; + + var delay = new Transition(new TransitionType_Linear(2000)); + var fadeIn = new Transition(new TransitionType_Linear(800)); + fadeIn.add(PBOX_WarningIcon, "Opacity", 1.0F); + fadeIn.add(LBL_Error, "Opacity", 1.0F); + + _ErrorTransition = new[] { delay, fadeIn }; + + _NoErrorTransition = new Transition(new TransitionType_Linear(10)); + _NoErrorTransition.add(PBOX_WarningIcon, "Opacity", 0.0F); + _NoErrorTransition.add(LBL_Error, "Opacity", 0.0F); + + //setup button actions + foreach (var btn in Controls.Cast().OfType