APM Planner 1.0.87

tlog kml fix
misc fixs
This commit is contained in:
Michael Oborne 2011-10-29 11:34:38 +08:00
parent 14d27b1e4c
commit 80b2265116
17 changed files with 1885 additions and 2583 deletions

View File

@ -75,8 +75,14 @@ namespace System.IO.Ports
string dest = Port;
string host = "127.0.0.1";
ArdupilotMega.Common.InputBox("remote host", "Enter host name/ip (ensure remote end is already started)", ref host);
ArdupilotMega.Common.InputBox("remote Port", "Enter remote port", ref dest);
if (Windows.Forms.DialogResult.Cancel == ArdupilotMega.Common.InputBox("remote host", "Enter host name/ip (ensure remote end is already started)", ref host))
{
return;
}
if (Windows.Forms.DialogResult.Cancel == ArdupilotMega.Common.InputBox("remote Port", "Enter remote port", ref dest))
{
return;
}
Port = dest;
client = new TcpClient(host, int.Parse(Port));
@ -169,7 +175,7 @@ namespace System.IO.Ports
VerifyConnected();
int size = client.Available;
byte[] crap = new byte[size];
Console.WriteLine("UdpSerial DiscardInBuffer {0}",size);
Console.WriteLine("TcpSerial DiscardInBuffer {0}",size);
Read(crap, 0, size);
}

View File

@ -188,17 +188,17 @@ namespace ArdupilotMega
private DateTime lastupdate = DateTime.Now;
private DateTime lastwindcalc = DateTime.Now;
public void UpdateCurrentSettings(System.Windows.Forms.BindingSource bs)
{
UpdateCurrentSettings(bs, false, MainV2.comPort);
}
/*
public void UpdateCurrentSettings(System.Windows.Forms.BindingSource bs, bool updatenow)
{
UpdateCurrentSettings(bs, false, MainV2.comPort);
}
*/
public void UpdateCurrentSettings(System.Windows.Forms.BindingSource bs, bool updatenow, MAVLink mavinterface)
{
if (DateTime.Now > lastupdate.AddMilliseconds(19) || updatenow) // 50 hz

View File

@ -142,6 +142,7 @@
this.label52 = new System.Windows.Forms.Label();
this.TabAC2 = new System.Windows.Forms.TabPage();
this.groupBox5 = new System.Windows.Forms.GroupBox();
this.label14 = new System.Windows.Forms.Label();
this.THR_RATE_IMAX = new System.Windows.Forms.DomainUpDown();
this.THR_RATE_I = new System.Windows.Forms.DomainUpDown();
this.label20 = new System.Windows.Forms.Label();
@ -223,6 +224,7 @@
this.RATE_RLL_P = new System.Windows.Forms.DomainUpDown();
this.label91 = new System.Windows.Forms.Label();
this.TabPlanner = new System.Windows.Forms.TabPage();
this.label26 = new System.Windows.Forms.Label();
this.CMB_videoresolutions = new System.Windows.Forms.ComboBox();
this.label12 = new System.Windows.Forms.Label();
this.CHK_GDIPlus = new System.Windows.Forms.CheckBox();
@ -273,8 +275,20 @@
this.BUT_load = new ArdupilotMega.MyButton();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.BUT_compare = new ArdupilotMega.MyButton();
this.label14 = new System.Windows.Forms.Label();
this.label26 = new System.Windows.Forms.Label();
this.groupBox17 = new System.Windows.Forms.GroupBox();
this.ACRO_PIT_IMAX = new System.Windows.Forms.DomainUpDown();
this.label27 = new System.Windows.Forms.Label();
this.ACRO_PIT_I = new System.Windows.Forms.DomainUpDown();
this.label29 = new System.Windows.Forms.Label();
this.ACRO_PIT_P = new System.Windows.Forms.DomainUpDown();
this.label33 = new System.Windows.Forms.Label();
this.groupBox18 = new System.Windows.Forms.GroupBox();
this.ACRO_RLL_IMAX = new System.Windows.Forms.DomainUpDown();
this.label40 = new System.Windows.Forms.Label();
this.ACRO_RLL_I = new System.Windows.Forms.DomainUpDown();
this.label44 = new System.Windows.Forms.Label();
this.ACRO_RLL_P = new System.Windows.Forms.DomainUpDown();
this.label48 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.Params)).BeginInit();
this.ConfigTabs.SuspendLayout();
this.TabAPM2.SuspendLayout();
@ -304,6 +318,8 @@
this.groupBox25.SuspendLayout();
this.TabPlanner.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.NUM_tracklength)).BeginInit();
this.groupBox17.SuspendLayout();
this.groupBox18.SuspendLayout();
this.SuspendLayout();
//
// Params
@ -995,7 +1011,9 @@
//
// TabAC2
//
this.TabAC2.Controls.Add(this.groupBox17);
this.TabAC2.Controls.Add(this.groupBox5);
this.TabAC2.Controls.Add(this.groupBox18);
this.TabAC2.Controls.Add(this.CHK_lockrollpitch);
this.TabAC2.Controls.Add(this.groupBox4);
this.TabAC2.Controls.Add(this.groupBox6);
@ -1022,6 +1040,11 @@
this.groupBox5.Name = "groupBox5";
this.groupBox5.TabStop = false;
//
// label14
//
resources.ApplyResources(this.label14, "label14");
this.label14.Name = "label14";
//
// THR_RATE_IMAX
//
resources.ApplyResources(this.THR_RATE_IMAX, "THR_RATE_IMAX");
@ -1050,8 +1073,11 @@
// CHK_lockrollpitch
//
resources.ApplyResources(this.CHK_lockrollpitch, "CHK_lockrollpitch");
this.CHK_lockrollpitch.Checked = true;
this.CHK_lockrollpitch.CheckState = System.Windows.Forms.CheckState.Checked;
this.CHK_lockrollpitch.Name = "CHK_lockrollpitch";
this.CHK_lockrollpitch.UseVisualStyleBackColor = true;
this.CHK_lockrollpitch.CheckedChanged += new System.EventHandler(this.CHK_lockrollpitch_CheckedChanged);
//
// groupBox4
//
@ -1545,6 +1571,11 @@
resources.ApplyResources(this.TabPlanner, "TabPlanner");
this.TabPlanner.Name = "TabPlanner";
//
// label26
//
resources.ApplyResources(this.label26, "label26");
this.label26.Name = "label26";
//
// CMB_videoresolutions
//
this.CMB_videoresolutions.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
@ -1911,15 +1942,89 @@
this.BUT_compare.UseVisualStyleBackColor = true;
this.BUT_compare.Click += new System.EventHandler(this.BUT_compare_Click);
//
// label14
// groupBox17
//
resources.ApplyResources(this.label14, "label14");
this.label14.Name = "label14";
this.groupBox17.Controls.Add(this.ACRO_PIT_IMAX);
this.groupBox17.Controls.Add(this.label27);
this.groupBox17.Controls.Add(this.ACRO_PIT_I);
this.groupBox17.Controls.Add(this.label29);
this.groupBox17.Controls.Add(this.ACRO_PIT_P);
this.groupBox17.Controls.Add(this.label33);
resources.ApplyResources(this.groupBox17, "groupBox17");
this.groupBox17.Name = "groupBox17";
this.groupBox17.TabStop = false;
//
// label26
// ACRO_PIT_IMAX
//
resources.ApplyResources(this.label26, "label26");
this.label26.Name = "label26";
resources.ApplyResources(this.ACRO_PIT_IMAX, "ACRO_PIT_IMAX");
this.ACRO_PIT_IMAX.Name = "ACRO_PIT_IMAX";
//
// label27
//
resources.ApplyResources(this.label27, "label27");
this.label27.Name = "label27";
//
// ACRO_PIT_I
//
resources.ApplyResources(this.ACRO_PIT_I, "ACRO_PIT_I");
this.ACRO_PIT_I.Name = "ACRO_PIT_I";
//
// label29
//
resources.ApplyResources(this.label29, "label29");
this.label29.Name = "label29";
//
// ACRO_PIT_P
//
resources.ApplyResources(this.ACRO_PIT_P, "ACRO_PIT_P");
this.ACRO_PIT_P.Name = "ACRO_PIT_P";
//
// label33
//
resources.ApplyResources(this.label33, "label33");
this.label33.Name = "label33";
//
// groupBox18
//
this.groupBox18.Controls.Add(this.ACRO_RLL_IMAX);
this.groupBox18.Controls.Add(this.label40);
this.groupBox18.Controls.Add(this.ACRO_RLL_I);
this.groupBox18.Controls.Add(this.label44);
this.groupBox18.Controls.Add(this.ACRO_RLL_P);
this.groupBox18.Controls.Add(this.label48);
resources.ApplyResources(this.groupBox18, "groupBox18");
this.groupBox18.Name = "groupBox18";
this.groupBox18.TabStop = false;
//
// ACRO_RLL_IMAX
//
resources.ApplyResources(this.ACRO_RLL_IMAX, "ACRO_RLL_IMAX");
this.ACRO_RLL_IMAX.Name = "ACRO_RLL_IMAX";
//
// label40
//
resources.ApplyResources(this.label40, "label40");
this.label40.Name = "label40";
//
// ACRO_RLL_I
//
resources.ApplyResources(this.ACRO_RLL_I, "ACRO_RLL_I");
this.ACRO_RLL_I.Name = "ACRO_RLL_I";
//
// label44
//
resources.ApplyResources(this.label44, "label44");
this.label44.Name = "label44";
//
// ACRO_RLL_P
//
resources.ApplyResources(this.ACRO_RLL_P, "ACRO_RLL_P");
this.ACRO_RLL_P.Name = "ACRO_RLL_P";
//
// label48
//
resources.ApplyResources(this.label48, "label48");
this.label48.Name = "label48";
//
// Configuration
//
@ -1965,6 +2070,8 @@
this.groupBox25.ResumeLayout(false);
this.TabPlanner.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.NUM_tracklength)).EndInit();
this.groupBox17.ResumeLayout(false);
this.groupBox18.ResumeLayout(false);
this.ResumeLayout(false);
}
@ -2214,5 +2321,19 @@
private System.Windows.Forms.Label label109;
private System.Windows.Forms.Label label14;
private System.Windows.Forms.Label label26;
private System.Windows.Forms.GroupBox groupBox17;
private System.Windows.Forms.DomainUpDown ACRO_PIT_IMAX;
private System.Windows.Forms.Label label27;
private System.Windows.Forms.DomainUpDown ACRO_PIT_I;
private System.Windows.Forms.Label label29;
private System.Windows.Forms.DomainUpDown ACRO_PIT_P;
private System.Windows.Forms.Label label33;
private System.Windows.Forms.GroupBox groupBox18;
private System.Windows.Forms.DomainUpDown ACRO_RLL_IMAX;
private System.Windows.Forms.Label label40;
private System.Windows.Forms.DomainUpDown ACRO_RLL_I;
private System.Windows.Forms.Label label44;
private System.Windows.Forms.DomainUpDown ACRO_RLL_P;
private System.Windows.Forms.Label label48;
}
}

View File

@ -61,24 +61,6 @@ namespace ArdupilotMega.GCSViews
{
InitializeComponent();
// fix for dup name
XTRK_ANGLE_CD1.Name = "XTRK_ANGLE_CD";
}
private void Configuration_Load(object sender, EventArgs e)
{
// read tooltips
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)
{
@ -93,6 +75,20 @@ namespace ArdupilotMega.GCSViews
TabAC2.Enabled = true;
}
// read tooltips
if (tooltips.Count == 0)
readToolTips();
// prefill all fields
param = MainV2.comPort.param;
processToScreen();
// fix for dup name
XTRK_ANGLE_CD1.Name = "XTRK_ANGLE_CD";
}
private void Configuration_Load(object sender, EventArgs e)
{
// setup up camera button states
if (MainV2.cam != null)
{
@ -386,7 +382,7 @@ namespace ArdupilotMega.GCSViews
// enable roll and pitch pairing for ac2
if (CHK_lockrollpitch.Checked)
{
if (name.StartsWith("RATE_") || name.StartsWith("STB_"))
if (name.StartsWith("RATE_") || name.StartsWith("STB_") || name.StartsWith("ACRO_"))
{
if (name.Contains("_RLL_"))
{
@ -534,6 +530,8 @@ namespace ArdupilotMega.GCSViews
continue;
if (name == "WP_TOTAL")
continue;
if (name == "CMD_TOTAL")
continue;
if (row.Cells[0].Value.ToString() == name)
{
if (row.Cells[1].Value.ToString() != value.ToString())
@ -1021,6 +1019,8 @@ namespace ArdupilotMega.GCSViews
continue;
if (name == "WP_TOTAL")
continue;
if (name == "CMD_TOTAL")
continue;
param2[name] = value;
}
@ -1039,5 +1039,10 @@ namespace ArdupilotMega.GCSViews
MessageBox.Show("You need to restart the planner for this to take effect");
MainV2.config["CHK_GDIPlus"] = CHK_GDIPlus.Checked.ToString();
}
private void CHK_lockrollpitch_CheckedChanged(object sender, EventArgs e)
{
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -488,7 +488,13 @@ namespace ArdupilotMega.GCSViews
return;
}
int apmformat_version = ArduinoDetect.decodeApVar(MainV2.comportname, board);
int apmformat_version = -1; // fail continue
try
{
apmformat_version = ArduinoDetect.decodeApVar(MainV2.comportname, board);
}
catch { }
if (apmformat_version != -1 && apmformat_version != temp.k_format_version)
{
@ -678,7 +684,7 @@ namespace ArdupilotMega.GCSViews
Application.DoEvents();
System.Threading.Thread.Sleep(5000); // 5 seconds - new apvar erases eeprom on new format version, this should buy us some time.
System.Threading.Thread.Sleep(10000); // 10 seconds - new apvar erases eeprom on new format version, this should buy us some time.
}
catch (Exception ex) { lbl_status.Text = "Failed upload"; MessageBox.Show("Check port settings or Port in use? " + ex.ToString()); port.Close(); }

View File

@ -364,7 +364,7 @@ namespace ArdupilotMega.GCSViews
if (CB_tuning.Checked == false) // draw if in view
// if (CB_tuning.Checked == false) // draw if in view
{
if (MainV2.comPort.logreadmode && MainV2.comPort.logplaybackfile != null)
@ -992,9 +992,9 @@ namespace ArdupilotMega.GCSViews
CMB_setwp.Items.Add("0 (Home)");
if (MainV2.comPort.param["WP_TOTAL"] != null)
if (MainV2.comPort.param["CMD_TOTAL"] != null)
{
int wps = int.Parse(MainV2.comPort.param["WP_TOTAL"].ToString());
int wps = int.Parse(MainV2.comPort.param["CMD_TOTAL"].ToString());
for (int z = 1; z <= wps; z++)
{
CMB_setwp.Items.Add(z.ToString());

View File

@ -1573,16 +1573,14 @@ namespace ArdupilotMega.GCSViews
xScale.Max = time + xScale.MajorStep;
xScale.Min = xScale.Max - 30.0;
}
// Make sure the Y axis is rescaled to accommodate actual data
try
{
zg1.AxisChange();
}
catch { }
// Force a redraw
zg1.Invalidate();
// Make sure the Y axis is rescaled to accommodate actual data
try
{
zg1.AxisChange();
}
catch { }
// Force a redraw
zg1.Invalidate();
}
private void SaveSettings_Click(object sender, EventArgs e)

View File

@ -172,6 +172,13 @@ namespace ArdupilotMega.GCSViews
comPort.Open();
comPort.WriteLine("");
comPort.WriteLine("");
comPort.WriteLine("");
comPort.WriteLine("");
comPort.WriteLine("");
comPort.WriteLine("");
System.Threading.Thread t11 = new System.Threading.Thread(delegate()
{
threadrun = true;

View File

@ -505,9 +505,17 @@ namespace ArdupilotMega
if (MainV2.comPort.param.Count > 0)
{
min = (int)(float)(MainV2.comPort.param["RC" + chan + "_MIN"]);
max = (int)(float)(MainV2.comPort.param["RC" + chan + "_MAX"]);
trim = (int)(float)(MainV2.comPort.param["RC" + chan + "_TRIM"]);
try
{
min = (int)(float)(MainV2.comPort.param["RC" + chan + "_MIN"]);
max = (int)(float)(MainV2.comPort.param["RC" + chan + "_MAX"]);
trim = (int)(float)(MainV2.comPort.param["RC" + chan + "_TRIM"]);
}
catch {
min = 1000;
max = 2000;
trim = 1500;
}
}
else
{

View File

@ -1275,6 +1275,7 @@ namespace ArdupilotMega
if (buffer[5] == MAVLINK_MSG_ID_WAYPOINT_REQUEST && buffer[9] == 0)
{
param["WP_TOTAL"] = (float)wp_total - 1;
param["CMD_TOTAL"] = (float)wp_total - 1;
MainV2.givecomport = false;
return;
}
@ -1647,7 +1648,7 @@ namespace ArdupilotMega
if (bpstime.Second != DateTime.Now.Second && !logreadmode)
{
Console.WriteLine("bps {0} loss {1} left {2}", bps1, synclost, BaseStream.BytesToRead);
Console.WriteLine("bps {0} loss {1} left {2} mem {3}", bps1, synclost, BaseStream.BytesToRead,System.GC.GetTotalMemory(false));
bps2 = bps1; // prev sec
bps1 = 0; // current sec
bpstime = DateTime.Now;

View File

@ -468,6 +468,7 @@ namespace ArdupilotMega
private void MenuConfiguration_Click(object sender, EventArgs e)
{
MyView.SuspendLayout();
MyView.Controls.Clear();
GCSViews.Terminal.threadrun = false;
@ -486,13 +487,11 @@ namespace ArdupilotMega
UserControl temp = Configuration;
temp.SuspendLayout();
fixtheme(temp);
temp.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
//temp.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
temp.Location = new Point(0, MainMenu.Height);
temp.Location = new Point(0, 0);
temp.Dock = DockStyle.Fill;
@ -500,9 +499,11 @@ namespace ArdupilotMega
temp.BackColor = Color.FromArgb(0x26, 0x27, 0x28);
temp.ResumeLayout();
MyView.Controls.Add(temp);
temp.ResumeLayout();
MyView.ResumeLayout();
}
private void MenuSimulation_Click(object sender, EventArgs e)
@ -562,7 +563,19 @@ namespace ArdupilotMega
this.MenuConnect.BackgroundImage = global::ArdupilotMega.Properties.Resources.disconnect;
UserControl temp = new GCSViews.Terminal();
// dispose of old else memory leak
if (Terminal != null)
{
try
{
Terminal.Dispose();
}
catch { }
}
Terminal = new GCSViews.Terminal();
UserControl temp = Terminal;
fixtheme(temp);

View File

@ -332,7 +332,7 @@ namespace ArdupilotMega
cs.datetime = mine.lastlogread;
cs.UpdateCurrentSettings(null, true);
cs.UpdateCurrentSettings(null, true, mine);
try
{
@ -360,6 +360,7 @@ namespace ArdupilotMega
writeKML(logfile + ".kml");
progressBar1.Value = 100;
}
}

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.86")]
[assembly: AssemblyFileVersion("1.0.87")]
[assembly: NeutralResourcesLanguageAttribute("")]

View File

@ -135,7 +135,7 @@ namespace ArdupilotMega.Setup
System.Threading.Thread.Sleep(5);
MainV2.cs.UpdateCurrentSettings(currentStateBindingSource, true);
MainV2.cs.UpdateCurrentSettings(currentStateBindingSource, true, MainV2.comPort);
if (MainV2.cs.ch1in > 800 && MainV2.cs.ch1in < 2200)
{
@ -192,7 +192,7 @@ namespace ArdupilotMega.Setup
MessageBox.Show("Ensure all your sticks are centered, and click ok to continue");
MainV2.cs.UpdateCurrentSettings(currentStateBindingSource, true);
MainV2.cs.UpdateCurrentSettings(currentStateBindingSource, true, MainV2.comPort);
rctrim[0] = MainV2.cs.ch1in;
rctrim[1] = MainV2.cs.ch2in;

View File

@ -11,7 +11,7 @@
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<dsig:DigestValue>FgyYFBDKA+EmX+ZazsEdbI/ME7o=</dsig:DigestValue>
<dsig:DigestValue>S+dMQOC9TeJyQiYvhw37LpJxZU0=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>