APM Planner 1.0.73

add opengl and gdi+ option to hud.
fix simple mode display
fix throttle hold imax scaling.
fix drawing of bad wps in log playback
This commit is contained in:
Michael Oborne 2011-09-20 08:04:58 +08:00
parent 13e83aed2f
commit 3c7903bb41
12 changed files with 312 additions and 126 deletions

View File

@ -263,6 +263,8 @@
this.BUT_load = new ArdupilotMega.MyButton();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.BUT_compare = new ArdupilotMega.MyButton();
this.label12 = new System.Windows.Forms.Label();
this.CHK_GDIPlus = new System.Windows.Forms.CheckBox();
((System.ComponentModel.ISupportInitialize)(this.Params)).BeginInit();
this.ConfigTabs.SuspendLayout();
this.TabAPM2.SuspendLayout();
@ -1448,6 +1450,8 @@
//
// TabPlanner
//
this.TabPlanner.Controls.Add(this.label12);
this.TabPlanner.Controls.Add(this.CHK_GDIPlus);
this.TabPlanner.Controls.Add(this.label24);
this.TabPlanner.Controls.Add(this.CHK_loadwponconnect);
this.TabPlanner.Controls.Add(this.label23);
@ -1830,6 +1834,19 @@
this.BUT_compare.UseVisualStyleBackColor = true;
this.BUT_compare.Click += new System.EventHandler(this.BUT_compare_Click);
//
// label12
//
resources.ApplyResources(this.label12, "label12");
this.label12.Name = "label12";
//
// CHK_GDIPlus
//
resources.ApplyResources(this.CHK_GDIPlus, "CHK_GDIPlus");
this.CHK_GDIPlus.Name = "CHK_GDIPlus";
this.toolTip1.SetToolTip(this.CHK_GDIPlus, resources.GetString("CHK_GDIPlus.ToolTip"));
this.CHK_GDIPlus.UseVisualStyleBackColor = true;
this.CHK_GDIPlus.CheckedChanged += new System.EventHandler(this.CHK_GDIPlus_CheckedChanged);
//
// Configuration
//
resources.ApplyResources(this, "$this");
@ -2110,5 +2127,7 @@
private System.Windows.Forms.DataGridViewTextBoxColumn mavScale;
private System.Windows.Forms.DataGridViewTextBoxColumn RawValue;
private MyButton BUT_compare;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.CheckBox CHK_GDIPlus;
}
}

View File

@ -46,10 +46,13 @@ namespace ArdupilotMega.GCSViews
if (tooltips.Count == 0)
readToolTips();
this.SuspendLayout();
// prefill all fields
param = MainV2.comPort.param;
processToScreen();
this.ResumeLayout();
// enable disable relevbant hardware tabs
if (MainV2.APMFirmware == MainV2.Firmwares.ArduPlane)
@ -107,6 +110,9 @@ namespace ArdupilotMega.GCSViews
CMB_ratestatus.Text = MainV2.cs.ratestatus.ToString();
if (MainV2.config["CHK_GDIPlus"] != null)
CHK_GDIPlus.Checked = bool.Parse(MainV2.config["CHK_GDIPlus"].ToString());
//set hud color state
string hudcolor = (string)MainV2.config["hudcolor"];
@ -939,5 +945,13 @@ namespace ArdupilotMega.GCSViews
temp.ShowDialog();
}
}
private void CHK_GDIPlus_CheckedChanged(object sender, EventArgs e)
{
if (startup)
return;
MessageBox.Show("You need to restart the planner for this to take effect");
MainV2.config["CHK_GDIPlus"] = CHK_GDIPlus.Checked.ToString();
}
}
}

View File

@ -4449,6 +4449,67 @@
<data name="&gt;&gt;TabAC2.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="label12.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label12.Location" type="System.Drawing.Point, System.Drawing">
<value>30, 300</value>
</data>
<data name="label12.Size" type="System.Drawing.Size, System.Drawing">
<value>61, 13</value>
</data>
<data name="label12.TabIndex" type="System.Int32, mscorlib">
<value>39</value>
</data>
<data name="label12.Text" xml:space="preserve">
<value>HUD</value>
</data>
<data name="&gt;&gt;label12.Name" xml:space="preserve">
<value>label12</value>
</data>
<data name="&gt;&gt;label12.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label12.Parent" xml:space="preserve">
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;label12.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="CHK_GDIPlus.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="CHK_GDIPlus.Location" type="System.Drawing.Point, System.Drawing">
<value>139, 299</value>
</data>
<data name="CHK_GDIPlus.Size" type="System.Drawing.Size, System.Drawing">
<value>177, 17</value>
</data>
<data name="CHK_GDIPlus.TabIndex" type="System.Int32, mscorlib">
<value>40</value>
</data>
<data name="CHK_GDIPlus.Text" xml:space="preserve">
<value>GDI+ (old type)</value>
</data>
<data name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing">
<value>17, 17</value>
</data>
<data name="CHK_GDIPlus.ToolTip" xml:space="preserve">
<value>OpenGL = Disabled
GDI+ = Enabled</value>
</data>
<data name="&gt;&gt;CHK_GDIPlus.Name" xml:space="preserve">
<value>CHK_GDIPlus</value>
</data>
<data name="&gt;&gt;CHK_GDIPlus.Type" xml:space="preserve">
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;CHK_GDIPlus.Parent" xml:space="preserve">
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;CHK_GDIPlus.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="label24.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
@ -4474,7 +4535,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;label24.ZOrder" xml:space="preserve">
<value>0</value>
<value>2</value>
</data>
<data name="CHK_loadwponconnect.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -4501,7 +4562,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;CHK_loadwponconnect.ZOrder" xml:space="preserve">
<value>1</value>
<value>3</value>
</data>
<data name="label23.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -4528,7 +4589,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;label23.ZOrder" xml:space="preserve">
<value>2</value>
<value>4</value>
</data>
<data name="NUM_tracklength.Location" type="System.Drawing.Point, System.Drawing">
<value>139, 250</value>
@ -4539,9 +4600,6 @@
<data name="NUM_tracklength.TabIndex" type="System.Int32, mscorlib">
<value>35</value>
</data>
<data name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing">
<value>17, 17</value>
</data>
<data name="NUM_tracklength.ToolTip" xml:space="preserve">
<value>On the Flight Data Tab</value>
</data>
@ -4555,7 +4613,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;NUM_tracklength.ZOrder" xml:space="preserve">
<value>3</value>
<value>5</value>
</data>
<data name="CHK_speechaltwarning.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -4582,7 +4640,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;CHK_speechaltwarning.ZOrder" xml:space="preserve">
<value>4</value>
<value>6</value>
</data>
<data name="label108.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -4609,7 +4667,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;label108.ZOrder" xml:space="preserve">
<value>5</value>
<value>7</value>
</data>
<data name="CHK_resetapmonconnect.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -4636,7 +4694,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;CHK_resetapmonconnect.ZOrder" xml:space="preserve">
<value>6</value>
<value>8</value>
</data>
<data name="CHK_mavdebug.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Bottom, Left</value>
@ -4666,7 +4724,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;CHK_mavdebug.ZOrder" xml:space="preserve">
<value>7</value>
<value>9</value>
</data>
<data name="label107.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -4693,7 +4751,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;label107.ZOrder" xml:space="preserve">
<value>8</value>
<value>10</value>
</data>
<data name="CMB_raterc.Items" xml:space="preserve">
<value>0</value>
@ -4726,7 +4784,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;CMB_raterc.ZOrder" xml:space="preserve">
<value>9</value>
<value>11</value>
</data>
<data name="label104.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -4753,7 +4811,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;label104.ZOrder" xml:space="preserve">
<value>10</value>
<value>12</value>
</data>
<data name="label103.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -4780,7 +4838,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;label103.ZOrder" xml:space="preserve">
<value>11</value>
<value>13</value>
</data>
<data name="label102.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -4807,7 +4865,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;label102.ZOrder" xml:space="preserve">
<value>12</value>
<value>14</value>
</data>
<data name="label101.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -4834,7 +4892,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;label101.ZOrder" xml:space="preserve">
<value>13</value>
<value>15</value>
</data>
<data name="CMB_ratestatus.Items" xml:space="preserve">
<value>0</value>
@ -4867,7 +4925,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;CMB_ratestatus.ZOrder" xml:space="preserve">
<value>14</value>
<value>16</value>
</data>
<data name="CMB_rateposition.Items" xml:space="preserve">
<value>0</value>
@ -4900,7 +4958,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;CMB_rateposition.ZOrder" xml:space="preserve">
<value>15</value>
<value>17</value>
</data>
<data name="CMB_rateattitude.Items" xml:space="preserve">
<value>0</value>
@ -4933,7 +4991,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;CMB_rateattitude.ZOrder" xml:space="preserve">
<value>16</value>
<value>18</value>
</data>
<data name="label99.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -4961,7 +5019,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;label99.ZOrder" xml:space="preserve">
<value>17</value>
<value>19</value>
</data>
<data name="label98.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -4988,7 +5046,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;label98.ZOrder" xml:space="preserve">
<value>18</value>
<value>20</value>
</data>
<data name="label97.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -5015,7 +5073,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;label97.ZOrder" xml:space="preserve">
<value>19</value>
<value>21</value>
</data>
<data name="CMB_speedunits.Location" type="System.Drawing.Point, System.Drawing">
<value>139, 173</value>
@ -5036,7 +5094,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;CMB_speedunits.ZOrder" xml:space="preserve">
<value>20</value>
<value>22</value>
</data>
<data name="CMB_distunits.Location" type="System.Drawing.Point, System.Drawing">
<value>139, 146</value>
@ -5057,7 +5115,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;CMB_distunits.ZOrder" xml:space="preserve">
<value>21</value>
<value>23</value>
</data>
<data name="label96.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -5084,7 +5142,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;label96.ZOrder" xml:space="preserve">
<value>22</value>
<value>24</value>
</data>
<data name="label95.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -5111,7 +5169,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;label95.ZOrder" xml:space="preserve">
<value>23</value>
<value>25</value>
</data>
<data name="CHK_speechbattery.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -5138,7 +5196,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;CHK_speechbattery.ZOrder" xml:space="preserve">
<value>24</value>
<value>26</value>
</data>
<data name="CHK_speechcustom.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -5165,7 +5223,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;CHK_speechcustom.ZOrder" xml:space="preserve">
<value>25</value>
<value>27</value>
</data>
<data name="CHK_speechmode.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -5192,7 +5250,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;CHK_speechmode.ZOrder" xml:space="preserve">
<value>26</value>
<value>28</value>
</data>
<data name="CHK_speechwaypoint.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -5219,7 +5277,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;CHK_speechwaypoint.ZOrder" xml:space="preserve">
<value>27</value>
<value>29</value>
</data>
<data name="label94.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -5246,7 +5304,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;label94.ZOrder" xml:space="preserve">
<value>28</value>
<value>30</value>
</data>
<data name="CMB_osdcolor.Location" type="System.Drawing.Point, System.Drawing">
<value>139, 40</value>
@ -5267,7 +5325,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;CMB_osdcolor.ZOrder" xml:space="preserve">
<value>29</value>
<value>31</value>
</data>
<data name="CMB_language.Location" type="System.Drawing.Point, System.Drawing">
<value>139, 90</value>
@ -5288,7 +5346,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;CMB_language.ZOrder" xml:space="preserve">
<value>30</value>
<value>32</value>
</data>
<data name="label93.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -5315,7 +5373,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;label93.ZOrder" xml:space="preserve">
<value>31</value>
<value>33</value>
</data>
<data name="CHK_enablespeech.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -5342,7 +5400,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;CHK_enablespeech.ZOrder" xml:space="preserve">
<value>32</value>
<value>34</value>
</data>
<data name="CHK_hudshow.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -5369,7 +5427,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;CHK_hudshow.ZOrder" xml:space="preserve">
<value>33</value>
<value>35</value>
</data>
<data name="label92.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -5396,7 +5454,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;label92.ZOrder" xml:space="preserve">
<value>34</value>
<value>36</value>
</data>
<data name="CMB_videosources.Location" type="System.Drawing.Point, System.Drawing">
<value>139, 13</value>
@ -5417,7 +5475,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;CMB_videosources.ZOrder" xml:space="preserve">
<value>35</value>
<value>37</value>
</data>
<data name="BUT_Joystick.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -5444,7 +5502,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;BUT_Joystick.ZOrder" xml:space="preserve">
<value>36</value>
<value>38</value>
</data>
<data name="BUT_videostop.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -5471,7 +5529,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;BUT_videostop.ZOrder" xml:space="preserve">
<value>37</value>
<value>39</value>
</data>
<data name="BUT_videostart.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -5498,7 +5556,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;BUT_videostart.ZOrder" xml:space="preserve">
<value>38</value>
<value>40</value>
</data>
<data name="TabPlanner.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 22</value>

View File

@ -357,7 +357,7 @@ namespace ArdupilotMega.GCSViews
foreach (PointLatLngAlt plla in FlightPlanner.pointlist)
{
if (plla == null)
if (plla == null || plla.Lng == 0 || plla.Lat == 0)
break;
addpolygonmarker(plla.Tag, plla.Lng, plla.Lat, (int)plla.Alt);
}

View File

@ -261,11 +261,6 @@ namespace hud
huddrawtime += (int)(DateTime.Now - starttime).TotalMilliseconds;
if (huddrawtime > 500)
{
opengl = false;
}
if (DateTime.Now.Second != countdate.Second)
{
countdate = DateTime.Now;
@ -345,52 +340,59 @@ namespace hud
public void DrawImage(Image img, int x, int y, int width, int height)
{
if (img == null)
return;
//bitmap = new Bitmap(512,512);
using (Graphics graphics = Graphics.FromImage(bitmap))
if (opengl)
{
graphics.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighSpeed;
graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighSpeed;
//draw the image into the target bitmap
graphics.DrawImage(img, 0, 0, bitmap.Width, bitmap.Height);
}
if (img == null)
return;
//bitmap = new Bitmap(512,512);
using (Graphics graphics = Graphics.FromImage(bitmap))
{
graphics.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighSpeed;
graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighSpeed;
//draw the image into the target bitmap
graphics.DrawImage(img, 0, 0, bitmap.Width, bitmap.Height);
}
GL.DeleteTexture(texture);
GL.DeleteTexture(texture);
GL.GenTextures(1, out texture);
GL.BindTexture(TextureTarget.Texture2D, texture);
GL.GenTextures(1, out texture);
GL.BindTexture(TextureTarget.Texture2D, texture);
BitmapData data = bitmap.LockBits(new System.Drawing.Rectangle(0, 0, bitmap.Width, bitmap.Height),
ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
BitmapData data = bitmap.LockBits(new System.Drawing.Rectangle(0, 0, bitmap.Width, bitmap.Height),
ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
//Console.WriteLine("w {0} h {1}",data.Width, data.Height);
//Console.WriteLine("w {0} h {1}",data.Width, data.Height);
GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba, data.Width, data.Height, 0,
OpenTK.Graphics.OpenGL.PixelFormat.Bgra, PixelType.UnsignedByte, data.Scan0);
GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba, data.Width, data.Height, 0,
OpenTK.Graphics.OpenGL.PixelFormat.Bgra, PixelType.UnsignedByte, data.Scan0);
bitmap.UnlockBits(data);
bitmap.UnlockBits(data);
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear);
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear);
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear);
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear);
GL.Enable(EnableCap.Texture2D);
GL.Enable(EnableCap.Texture2D);
GL.BindTexture(TextureTarget.Texture2D, texture);
GL.BindTexture(TextureTarget.Texture2D, texture);
GL.Begin(BeginMode.Quads);
GL.Begin(BeginMode.Quads);
GL.TexCoord2(0.0f, 1.0f); GL.Vertex2(0, this.Height);
GL.TexCoord2(1.0f, 1.0f); GL.Vertex2(this.Width, this.Height);
GL.TexCoord2(1.0f, 0.0f); GL.Vertex2(this.Width, 0);
GL.TexCoord2(0.0f, 0.0f); GL.Vertex2(0, 0);
GL.TexCoord2(0.0f, 1.0f); GL.Vertex2(0, this.Height);
GL.TexCoord2(1.0f, 1.0f); GL.Vertex2(this.Width, this.Height);
GL.TexCoord2(1.0f, 0.0f); GL.Vertex2(this.Width, 0);
GL.TexCoord2(0.0f, 0.0f); GL.Vertex2(0, 0);
GL.End();
GL.End();
GL.Disable(EnableCap.Texture2D);
GL.Disable(EnableCap.Texture2D);
}
else
{
graphicsObjectGDIP.DrawImage(img,x,y,width,height);
}
}
public void DrawPath(Pen penn, GraphicsPath gp)
@ -1461,6 +1463,8 @@ namespace hud
this.Height = (int)(this.Width / 1.333f);
base.OnResize(e);
graphicsObjectGDIP = Graphics.FromImage(objBitmap);
charbitmaps = new Bitmap[charbitmaps.Length];
try

View File

@ -652,6 +652,10 @@ namespace ArdupilotMega
|| paramname.ToUpper().EndsWith("XTRK_ANGLE_CD") || paramname.ToUpper().EndsWith("LIM_PITCH_MAX") || paramname.ToUpper().EndsWith("LIM_PITCH_MIN")
|| paramname.ToUpper().EndsWith("LIM_ROLL_CD") || paramname.ToUpper().EndsWith("PITCH_MAX") || paramname.ToUpper().EndsWith("WP_SPEED_MAX"))
{
if (paramname.ToUpper().EndsWith("THR_HOLD_IMAX")) {
return;
}
if (fromapm)
{
value /= 100.0f;
@ -1544,7 +1548,7 @@ namespace ArdupilotMega
break;
}
System.Threading.Thread.Sleep(1);
System.Windows.Forms.Application.DoEvents();
System.Windows.Forms.Application.DoEvents(); // when connecting this is in the main thread
to++;
//Console.WriteLine("data " + 0 + " " + length + " aval " + BaseStream.BytesToRead);

View File

@ -161,6 +161,9 @@ namespace ArdupilotMega
}
catch (Exception e) { MessageBox.Show("A Major error has occured : " + e.ToString()); this.Close(); }
if (MainV2.config["CHK_GDIPlus"] != null)
GCSViews.FlightData.myhud.UseOpenGL = !bool.Parse(MainV2.config["CHK_GDIPlus"].ToString());
changeunits();
try
@ -443,6 +446,8 @@ namespace ArdupilotMega
UserControl temp = new GCSViews.Configuration();
temp.SuspendLayout();
fixtheme(temp);
temp.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
@ -456,6 +461,8 @@ namespace ArdupilotMega
temp.BackColor = Color.FromArgb(0x26, 0x27, 0x28);
MyView.Controls.Add(temp);
temp.ResumeLayout();
}
private void MenuSimulation_Click(object sender, EventArgs e)

View File

@ -34,5 +34,5 @@ using System.Resources;
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.72")]
[assembly: AssemblyFileVersion("1.0.73")]
[assembly: NeutralResourcesLanguageAttribute("")]

View File

@ -308,6 +308,15 @@ namespace ArdupilotMega.Setup
CMB_fmode4.Text = Enum.Parse(typeof(Common.ac2modes), MainV2.comPort.param["FLTMODE4"].ToString()).ToString();
CMB_fmode5.Text = Enum.Parse(typeof(Common.ac2modes), MainV2.comPort.param["FLTMODE5"].ToString()).ToString();
CMB_fmode6.Text = Enum.Parse(typeof(Common.ac2modes), MainV2.comPort.param["FLTMODE6"].ToString()).ToString();
int simple = int.Parse(MainV2.comPort.param["SIMPLE"].ToString());
CB_simple1.Checked = ((simple >> 0 & 1) == 1);
CB_simple2.Checked = ((simple >> 1 & 1) == 1);
CB_simple3.Checked = ((simple >> 2 & 1) == 1);
CB_simple4.Checked = ((simple >> 3 & 1) == 1);
CB_simple5.Checked = ((simple >> 4 & 1) == 1);
CB_simple6.Checked = ((simple >> 5 & 1) == 1);
}
catch { }
}
@ -434,7 +443,7 @@ namespace ArdupilotMega.Setup
private void TXT_battcapacity_Validating(object sender, CancelEventArgs e)
{
float ans = 0;
e.Cancel = !float.TryParse(TXT_battcapacity.Text, out ans);
e.Cancel = !float.TryParse(TXT_declination.Text, out ans);
}
private void CMB_batmontype_SelectedIndexChanged(object sender, EventArgs e)

View File

@ -2,8 +2,13 @@
<configuration>
<configSections>
</configSections>
<!--
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
<supportedRuntime version="v4.0"/>
</startup>
-->
<startup>
<supportedRuntime version="v2.0.50727"/>
</startup>
</configuration>

View File

@ -2,5 +2,13 @@
<configuration>
<configSections>
</configSections>
<startup><supportedRuntime version="v2.0.50727"/></startup>
</configuration>
<!--
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
<supportedRuntime version="v4.0"/>
</startup>
-->
<startup>
<supportedRuntime version="v2.0.50727"/>
</startup>
</configuration>

View File

@ -4449,6 +4449,67 @@
<data name="&gt;&gt;TabAC2.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="label12.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label12.Location" type="System.Drawing.Point, System.Drawing">
<value>30, 300</value>
</data>
<data name="label12.Size" type="System.Drawing.Size, System.Drawing">
<value>61, 13</value>
</data>
<data name="label12.TabIndex" type="System.Int32, mscorlib">
<value>39</value>
</data>
<data name="label12.Text" xml:space="preserve">
<value>HUD</value>
</data>
<data name="&gt;&gt;label12.Name" xml:space="preserve">
<value>label12</value>
</data>
<data name="&gt;&gt;label12.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label12.Parent" xml:space="preserve">
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;label12.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="CHK_GDIPlus.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="CHK_GDIPlus.Location" type="System.Drawing.Point, System.Drawing">
<value>139, 299</value>
</data>
<data name="CHK_GDIPlus.Size" type="System.Drawing.Size, System.Drawing">
<value>177, 17</value>
</data>
<data name="CHK_GDIPlus.TabIndex" type="System.Int32, mscorlib">
<value>40</value>
</data>
<data name="CHK_GDIPlus.Text" xml:space="preserve">
<value>GDI+ (old type)</value>
</data>
<data name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing">
<value>17, 17</value>
</data>
<data name="CHK_GDIPlus.ToolTip" xml:space="preserve">
<value>OpenGL = Disabled
GDI+ = Enabled</value>
</data>
<data name="&gt;&gt;CHK_GDIPlus.Name" xml:space="preserve">
<value>CHK_GDIPlus</value>
</data>
<data name="&gt;&gt;CHK_GDIPlus.Type" xml:space="preserve">
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;CHK_GDIPlus.Parent" xml:space="preserve">
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;CHK_GDIPlus.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="label24.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
@ -4474,7 +4535,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;label24.ZOrder" xml:space="preserve">
<value>0</value>
<value>2</value>
</data>
<data name="CHK_loadwponconnect.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -4501,7 +4562,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;CHK_loadwponconnect.ZOrder" xml:space="preserve">
<value>1</value>
<value>3</value>
</data>
<data name="label23.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -4528,7 +4589,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;label23.ZOrder" xml:space="preserve">
<value>2</value>
<value>4</value>
</data>
<data name="NUM_tracklength.Location" type="System.Drawing.Point, System.Drawing">
<value>139, 250</value>
@ -4539,9 +4600,6 @@
<data name="NUM_tracklength.TabIndex" type="System.Int32, mscorlib">
<value>35</value>
</data>
<data name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing">
<value>17, 17</value>
</data>
<data name="NUM_tracklength.ToolTip" xml:space="preserve">
<value>On the Flight Data Tab</value>
</data>
@ -4555,7 +4613,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;NUM_tracklength.ZOrder" xml:space="preserve">
<value>3</value>
<value>5</value>
</data>
<data name="CHK_speechaltwarning.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -4582,7 +4640,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;CHK_speechaltwarning.ZOrder" xml:space="preserve">
<value>4</value>
<value>6</value>
</data>
<data name="label108.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -4609,7 +4667,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;label108.ZOrder" xml:space="preserve">
<value>5</value>
<value>7</value>
</data>
<data name="CHK_resetapmonconnect.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -4636,7 +4694,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;CHK_resetapmonconnect.ZOrder" xml:space="preserve">
<value>6</value>
<value>8</value>
</data>
<data name="CHK_mavdebug.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Bottom, Left</value>
@ -4666,7 +4724,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;CHK_mavdebug.ZOrder" xml:space="preserve">
<value>7</value>
<value>9</value>
</data>
<data name="label107.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -4693,7 +4751,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;label107.ZOrder" xml:space="preserve">
<value>8</value>
<value>10</value>
</data>
<data name="CMB_raterc.Items" xml:space="preserve">
<value>0</value>
@ -4726,7 +4784,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;CMB_raterc.ZOrder" xml:space="preserve">
<value>9</value>
<value>11</value>
</data>
<data name="label104.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -4753,7 +4811,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;label104.ZOrder" xml:space="preserve">
<value>10</value>
<value>12</value>
</data>
<data name="label103.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -4780,7 +4838,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;label103.ZOrder" xml:space="preserve">
<value>11</value>
<value>13</value>
</data>
<data name="label102.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -4807,7 +4865,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;label102.ZOrder" xml:space="preserve">
<value>12</value>
<value>14</value>
</data>
<data name="label101.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -4834,7 +4892,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;label101.ZOrder" xml:space="preserve">
<value>13</value>
<value>15</value>
</data>
<data name="CMB_ratestatus.Items" xml:space="preserve">
<value>0</value>
@ -4867,7 +4925,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;CMB_ratestatus.ZOrder" xml:space="preserve">
<value>14</value>
<value>16</value>
</data>
<data name="CMB_rateposition.Items" xml:space="preserve">
<value>0</value>
@ -4900,7 +4958,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;CMB_rateposition.ZOrder" xml:space="preserve">
<value>15</value>
<value>17</value>
</data>
<data name="CMB_rateattitude.Items" xml:space="preserve">
<value>0</value>
@ -4933,7 +4991,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;CMB_rateattitude.ZOrder" xml:space="preserve">
<value>16</value>
<value>18</value>
</data>
<data name="label99.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -4961,7 +5019,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;label99.ZOrder" xml:space="preserve">
<value>17</value>
<value>19</value>
</data>
<data name="label98.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -4988,7 +5046,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;label98.ZOrder" xml:space="preserve">
<value>18</value>
<value>20</value>
</data>
<data name="label97.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -5015,7 +5073,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;label97.ZOrder" xml:space="preserve">
<value>19</value>
<value>21</value>
</data>
<data name="CMB_speedunits.Location" type="System.Drawing.Point, System.Drawing">
<value>139, 173</value>
@ -5036,7 +5094,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;CMB_speedunits.ZOrder" xml:space="preserve">
<value>20</value>
<value>22</value>
</data>
<data name="CMB_distunits.Location" type="System.Drawing.Point, System.Drawing">
<value>139, 146</value>
@ -5057,7 +5115,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;CMB_distunits.ZOrder" xml:space="preserve">
<value>21</value>
<value>23</value>
</data>
<data name="label96.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -5084,7 +5142,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;label96.ZOrder" xml:space="preserve">
<value>22</value>
<value>24</value>
</data>
<data name="label95.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -5111,7 +5169,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;label95.ZOrder" xml:space="preserve">
<value>23</value>
<value>25</value>
</data>
<data name="CHK_speechbattery.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -5138,7 +5196,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;CHK_speechbattery.ZOrder" xml:space="preserve">
<value>24</value>
<value>26</value>
</data>
<data name="CHK_speechcustom.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -5165,7 +5223,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;CHK_speechcustom.ZOrder" xml:space="preserve">
<value>25</value>
<value>27</value>
</data>
<data name="CHK_speechmode.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -5192,7 +5250,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;CHK_speechmode.ZOrder" xml:space="preserve">
<value>26</value>
<value>28</value>
</data>
<data name="CHK_speechwaypoint.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -5219,7 +5277,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;CHK_speechwaypoint.ZOrder" xml:space="preserve">
<value>27</value>
<value>29</value>
</data>
<data name="label94.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -5246,7 +5304,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;label94.ZOrder" xml:space="preserve">
<value>28</value>
<value>30</value>
</data>
<data name="CMB_osdcolor.Location" type="System.Drawing.Point, System.Drawing">
<value>139, 40</value>
@ -5267,7 +5325,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;CMB_osdcolor.ZOrder" xml:space="preserve">
<value>29</value>
<value>31</value>
</data>
<data name="CMB_language.Location" type="System.Drawing.Point, System.Drawing">
<value>139, 90</value>
@ -5288,7 +5346,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;CMB_language.ZOrder" xml:space="preserve">
<value>30</value>
<value>32</value>
</data>
<data name="label93.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -5315,7 +5373,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;label93.ZOrder" xml:space="preserve">
<value>31</value>
<value>33</value>
</data>
<data name="CHK_enablespeech.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -5342,7 +5400,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;CHK_enablespeech.ZOrder" xml:space="preserve">
<value>32</value>
<value>34</value>
</data>
<data name="CHK_hudshow.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -5369,7 +5427,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;CHK_hudshow.ZOrder" xml:space="preserve">
<value>33</value>
<value>35</value>
</data>
<data name="label92.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -5396,7 +5454,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;label92.ZOrder" xml:space="preserve">
<value>34</value>
<value>36</value>
</data>
<data name="CMB_videosources.Location" type="System.Drawing.Point, System.Drawing">
<value>139, 13</value>
@ -5417,7 +5475,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;CMB_videosources.ZOrder" xml:space="preserve">
<value>35</value>
<value>37</value>
</data>
<data name="BUT_Joystick.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -5444,7 +5502,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;BUT_Joystick.ZOrder" xml:space="preserve">
<value>36</value>
<value>38</value>
</data>
<data name="BUT_videostop.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -5471,7 +5529,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;BUT_videostop.ZOrder" xml:space="preserve">
<value>37</value>
<value>39</value>
</data>
<data name="BUT_videostart.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -5498,7 +5556,7 @@
<value>TabPlanner</value>
</data>
<data name="&gt;&gt;BUT_videostart.ZOrder" xml:space="preserve">
<value>38</value>
<value>40</value>
</data>
<data name="TabPlanner.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 22</value>