From c4433b6944896a6e8822d5f91a981fe58c16c614 Mon Sep 17 00:00:00 2001 From: Michael Oborne Date: Fri, 6 Jul 2012 07:27:42 +0800 Subject: [PATCH] APM Planner 1.1.96 Fix camera stab reverse boxs add better param data duplicate handling add rfd900a tweak terminal settings --- .../3DRRadio/ChangeLog.txt | 3 +- .../ArdupilotMegaPlanner/ArdupilotMega.csproj | 1 + Tools/ArdupilotMegaPlanner/ChangeLog.txt | 107 ++++++- Tools/ArdupilotMegaPlanner/Delta.cs | 39 +++ .../ArdupilotMegaPlanner/GCSViews/Terminal.cs | 12 +- Tools/ArdupilotMegaPlanner/Msi/installer.wxs | 267 +++++++++--------- .../Presenter/ConfigCameraStabPresenter.cs | 2 +- Tools/ArdupilotMegaPlanner/Program.cs | 6 + .../Properties/AssemblyInfo.cs | 2 +- Tools/ArdupilotMegaPlanner/Radio/3DRradio.cs | 6 +- Tools/ArdupilotMegaPlanner/Radio/Uploader.cs | 5 +- .../Utilities/ParameterMetaDataParser.cs | 3 +- Tools/ArdupilotMegaPlanner/temp.Designer.cs | 13 + Tools/ArdupilotMegaPlanner/temp.cs | 5 + 14 files changed, 323 insertions(+), 148 deletions(-) create mode 100644 Tools/ArdupilotMegaPlanner/Delta.cs diff --git a/Tools/ArdupilotMegaPlanner/3DRRadio/ChangeLog.txt b/Tools/ArdupilotMegaPlanner/3DRRadio/ChangeLog.txt index f3252770c0..5520a2a8ea 100644 --- a/Tools/ArdupilotMegaPlanner/3DRRadio/ChangeLog.txt +++ b/Tools/ArdupilotMegaPlanner/3DRRadio/ChangeLog.txt @@ -1,4 +1,5 @@ -0.8 - fix settings saving. +0.9 - added rfd900a +0.8 - fix settings saving. 0.7 - fix typos - log rssi screen to log as well 0.6 - add terminal logging to file, fix remote radio config 0.5 - add terminal diff --git a/Tools/ArdupilotMegaPlanner/ArdupilotMega.csproj b/Tools/ArdupilotMegaPlanner/ArdupilotMega.csproj index 4e0f6fab5f..8ec9135bc3 100644 --- a/Tools/ArdupilotMegaPlanner/ArdupilotMega.csproj +++ b/Tools/ArdupilotMegaPlanner/ArdupilotMega.csproj @@ -245,6 +245,7 @@ + UserControl diff --git a/Tools/ArdupilotMegaPlanner/ChangeLog.txt b/Tools/ArdupilotMegaPlanner/ChangeLog.txt index 43d3bbc6f1..96de363d3f 100644 --- a/Tools/ArdupilotMegaPlanner/ChangeLog.txt +++ b/Tools/ArdupilotMegaPlanner/ChangeLog.txt @@ -1,6 +1,14 @@ - -##### 1.1.94 +* APM Planner 1.1.95 +fix config panel value change detection +add loiter_ to AC config screen +Add praram name to Friendly param, and exception ignoring. +fix param file note line +intergrate andrews gimbal config. +fix any possible log appending issues +remove old cli planner on connect +modify speech to not crash on windows mono +* APM Planner 1.1.94 Fix Issue 668 - typo Fix issue 666 - now defaults to mav 1.0 planner Fix Issue 665 - mavlink 1.0 is now default @@ -18,3 +26,98 @@ Fix NOTE param file line Add APMRover hidden firmware upload (control-R) on firmware screen. fix possible speach engine exception add dataflashlog for apmrover + +* APM Planner 1.1.93 +fix armed/disarmed message + +* APM Planner 1.1.92 +add dump -1 option to log dump +fix terminal issue with logs +fix mavlink 1.0 manual/stablaize Mode +fix config screen showing incorrect tab + +* APM Planner 1.1.91 +fix datasource binding exception. + +* APM Planner 1.1.90 +3drradio save settings fix +fix mavlink10 hil scaling +fix some exceptions + +* APM Planner 1.1.89 +add mjpeg video source +add 16x9 hud +conform to http/1.1 specs for mjpeg + +* APM Planner 1.1.88 +fix updater + +* APM Planner 1.1.87 +add popouts in config/setup +add more text to hud heading nw,ne,sw,se +add 5 m filter to antenna tracker +add refresh param buttons +remove the word old, as people still want it. +modify telem playback interface with slider bars +add posible fix to bad grid spacing +move mavlink code. + +* APM Planner 1.1.86 +add ArduRover +simplify connect +modify hardware screen +fix mono terminal issue +modify 3drradio screen +modify updater + +* APM Planner 1.1.85 +work on opengltest +fix last missing param +fix com port selection on connecting to bad comport +add convert to csv. entire log +add log caching to image georef. for tlog and logs +add srtm data caching + +* APM Planner 1.1.84 +3dr radio fix's + rfd900 +other misc fixs + +* APM Planner 1.1.83 +fix null exception. if connect and not view the link stats, an exception is thrown on disconnect. + +* APM Planner 1.1.82 +modify 3dr radio packet size 64 > 32 +add andrews link status Mod - thanks +add hw voltage to status +add generic logbrowse pid class "pid-*" > "pid-1" + +* APM Planner 1.1.81 +mavlink 1.0 fixs +simulation hil fix for lorenz +modify default att rate to 10 hz + +* APM Planner 1.1.80 +hazy's lang mod +more hud mods - shorten lines +msi work + uploader + +* APM Planner 1.1.79 +modify hud +modify apm1 vs apm2 detector + +* APM Planner 1.1.78 +recommit + +* APM Planner 1.1.77 +fix param xml namespace issue +prevent sending unchanged params + +* APM Planner 1.1.76 +Modify Hud center +add 3dr snr's and snr based distance estimate +display current frame type +fix disapearing window +add base xml level to param xml (xml standard) +add georef kml refrence +this includes adams new dynamic params + diff --git a/Tools/ArdupilotMegaPlanner/Delta.cs b/Tools/ArdupilotMegaPlanner/Delta.cs new file mode 100644 index 0000000000..3d33e6b2c6 --- /dev/null +++ b/Tools/ArdupilotMegaPlanner/Delta.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace ArdupilotMega +{ + class Delta + { + public static void +delta_encode(ref char[] buffer) + { + int length = buffer.Length; + char delta = (char)0; + char original; + uint i; + for (i = 0; i < length; ++i) + { + original = buffer[i]; + buffer[i] = (char)(byte)(buffer[i] - delta); + delta = original; + } + } + + public static void + delta_decode(ref char[] buffer) + { + int length = buffer.Length; + char delta = (char)0; + uint i; + for (i = 0; i < length; ++i) + { + buffer[i] = (char)(byte)(buffer[i] + delta); + delta = buffer[i]; + } + } + + } +} \ No newline at end of file diff --git a/Tools/ArdupilotMegaPlanner/GCSViews/Terminal.cs b/Tools/ArdupilotMegaPlanner/GCSViews/Terminal.cs index 4d0ca21159..d30e642502 100644 --- a/Tools/ArdupilotMegaPlanner/GCSViews/Terminal.cs +++ b/Tools/ArdupilotMegaPlanner/GCSViews/Terminal.cs @@ -77,7 +77,7 @@ namespace ArdupilotMega.GCSViews data = data.Replace("'`",""); data = data.TrimEnd('\r'); // else added \n all by itself - data = data.Replace("\0", " "); + data = data.Replace("\0", ""); TXT_terminal.AppendText(data); if (data.Contains("\b")) { @@ -230,7 +230,7 @@ namespace ArdupilotMega.GCSViews comPort_DataReceived((object)null, (SerialDataReceivedEventArgs)null); } } - catch { return; } + catch { threadrun = false; return; } } try { @@ -259,12 +259,12 @@ namespace ArdupilotMega.GCSViews catch { } } + threadrun = false; + comPort.DtrEnable = false; - if (threadrun == false) - { - comPort.Close(); - } + comPort.Close(); + Console.WriteLine("Comport thread close"); }); t11.IsBackground = true; diff --git a/Tools/ArdupilotMegaPlanner/Msi/installer.wxs b/Tools/ArdupilotMegaPlanner/Msi/installer.wxs index 35868b1fd6..51ef44e178 100644 --- a/Tools/ArdupilotMegaPlanner/Msi/installer.wxs +++ b/Tools/ArdupilotMegaPlanner/Msi/installer.wxs @@ -2,14 +2,14 @@ - + - - + + @@ -31,7 +31,7 @@ - + @@ -97,154 +97,155 @@ - - - - - - + + + + + + + - - - + + + - - - - - - - - - - + + + + + + + + + + - - - - - + + + + + - - - - + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - + + + + - - - - - - - - - + + + + + + + + + - - - - - - - + + + + + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - - + + + + - - - - - - - + + + + + + + - - - + + + - - - - + + + + - - - + + + - - - + + + - - - + + + @@ -288,26 +289,26 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + diff --git a/Tools/ArdupilotMegaPlanner/Presenter/ConfigCameraStabPresenter.cs b/Tools/ArdupilotMegaPlanner/Presenter/ConfigCameraStabPresenter.cs index 270f1af4c9..19a44f0993 100644 --- a/Tools/ArdupilotMegaPlanner/Presenter/ConfigCameraStabPresenter.cs +++ b/Tools/ArdupilotMegaPlanner/Presenter/ConfigCameraStabPresenter.cs @@ -250,7 +250,7 @@ namespace ArdupilotMega.Presenter // handle boolean if (val.GetType() == typeof(Boolean)) { - if (!_mavlink.setParam(p.ApmPropertyName, ((Boolean)val) ? 1 : 0)) + if (!_mavlink.setParam(p.ApmPropertyName, ((Boolean)val) ? 1 : -1)) log.Error("Error setting Camstab parameter"); } else diff --git a/Tools/ArdupilotMegaPlanner/Program.cs b/Tools/ArdupilotMegaPlanner/Program.cs index 4d028762a2..4f5f588e19 100644 --- a/Tools/ArdupilotMegaPlanner/Program.cs +++ b/Tools/ArdupilotMegaPlanner/Program.cs @@ -67,6 +67,12 @@ namespace ArdupilotMega return; */ + char[] line = "testtesttesttesttest".ToCharArray(); + + Delta.delta_encode(ref line); + + Delta.delta_decode(ref line); + if (System.Diagnostics.Debugger.IsAttached) { // testing diff --git a/Tools/ArdupilotMegaPlanner/Properties/AssemblyInfo.cs b/Tools/ArdupilotMegaPlanner/Properties/AssemblyInfo.cs index f736252c1d..9783aa9144 100644 --- a/Tools/ArdupilotMegaPlanner/Properties/AssemblyInfo.cs +++ b/Tools/ArdupilotMegaPlanner/Properties/AssemblyInfo.cs @@ -34,5 +34,5 @@ using System.Resources; // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.1.*")] -[assembly: AssemblyFileVersion("1.1.95")] +[assembly: AssemblyFileVersion("1.1.96")] [assembly: NeutralResourcesLanguageAttribute("")] diff --git a/Tools/ArdupilotMegaPlanner/Radio/3DRradio.cs b/Tools/ArdupilotMegaPlanner/Radio/3DRradio.cs index 7ff0c7169e..a9d474bb8e 100644 --- a/Tools/ArdupilotMegaPlanner/Radio/3DRradio.cs +++ b/Tools/ArdupilotMegaPlanner/Radio/3DRradio.cs @@ -51,7 +51,11 @@ namespace ArdupilotMega } else if (device == uploader.Uploader.Code.DEVICE_ID_RFD900) { - return Common.getFilefromNet("http://www.samba.org/tridge/UAV/3DR/radio.rfd900.hex", firmwarefile); + return Common.getFilefromNet("http://rfdesign.com.au/firmware/radio.rfd900.hex", firmwarefile); + } + else if (device == uploader.Uploader.Code.DEVICE_ID_RFD900A) + { + return Common.getFilefromNet("http://rfdesign.com.au/firmware/radio.rfd900a.hex", firmwarefile); } else { diff --git a/Tools/ArdupilotMegaPlanner/Radio/Uploader.cs b/Tools/ArdupilotMegaPlanner/Radio/Uploader.cs index bc71d364d1..68218a053b 100644 --- a/Tools/ArdupilotMegaPlanner/Radio/Uploader.cs +++ b/Tools/ArdupilotMegaPlanner/Radio/Uploader.cs @@ -39,7 +39,8 @@ namespace uploader // device IDs XXX should come with the firmware image... DEVICE_ID_RF50 = 0x4d, DEVICE_ID_HM_TRP= 0x4e, - DEVICE_ID_RFD900= 0X42, + DEVICE_ID_RFD900 = 0X42, + DEVICE_ID_RFD900A = 0X43, // frequency code bytes XXX should come with the firmware image... FREQ_NONE = 0xf0, @@ -322,7 +323,7 @@ namespace uploader freq = (Code)recv (); // XXX should be getting valid board/frequency data from firmware file - if ((id != Code.DEVICE_ID_HM_TRP) && (id != Code.DEVICE_ID_RF50) && (id != Code.DEVICE_ID_RFD900)) + if ((id != Code.DEVICE_ID_HM_TRP) && (id != Code.DEVICE_ID_RF50) && (id != Code.DEVICE_ID_RFD900) && (id != Code.DEVICE_ID_RFD900A)) throw new Exception ("bootloader device ID mismatch - device:" + id.ToString()); getSync (); diff --git a/Tools/ArdupilotMegaPlanner/Utilities/ParameterMetaDataParser.cs b/Tools/ArdupilotMegaPlanner/Utilities/ParameterMetaDataParser.cs index fd6f5e81fc..adce15298b 100644 --- a/Tools/ArdupilotMegaPlanner/Utilities/ParameterMetaDataParser.cs +++ b/Tools/ArdupilotMegaPlanner/Utilities/ParameterMetaDataParser.cs @@ -237,7 +237,8 @@ namespace ArdupilotMega.Utilities } } } - returnDict.Add(key, metaDict); + if (!returnDict.ContainsKey(key)) + returnDict.Add(key, metaDict); } } } diff --git a/Tools/ArdupilotMegaPlanner/temp.Designer.cs b/Tools/ArdupilotMegaPlanner/temp.Designer.cs index 2db99918b4..0631a2f5a2 100644 --- a/Tools/ArdupilotMegaPlanner/temp.Designer.cs +++ b/Tools/ArdupilotMegaPlanner/temp.Designer.cs @@ -48,6 +48,7 @@ this.BUT_flashdl = new ArdupilotMega.Controls.MyButton(); this.BUT_wipeeeprom = new ArdupilotMega.Controls.MyButton(); this.button1 = new ArdupilotMega.Controls.MyButton(); + this.BUT_paramgen = new ArdupilotMega.Controls.MyButton(); this.SuspendLayout(); // // label1 @@ -244,11 +245,22 @@ this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.button1_Click); // + // BUT_paramgen + // + this.BUT_paramgen.Location = new System.Drawing.Point(206, 118); + this.BUT_paramgen.Name = "BUT_paramgen"; + this.BUT_paramgen.Size = new System.Drawing.Size(75, 23); + this.BUT_paramgen.TabIndex = 20; + this.BUT_paramgen.Text = "Param gen"; + this.BUT_paramgen.UseVisualStyleBackColor = true; + this.BUT_paramgen.Click += new System.EventHandler(this.BUT_paramgen_Click); + // // temp // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(731, 281); + this.Controls.Add(this.BUT_paramgen); this.Controls.Add(this.BUT_magcalib); this.Controls.Add(this.BUT_ant_track); this.Controls.Add(this.BUT_follow_me); @@ -299,5 +311,6 @@ private ArdupilotMega.Controls.MyButton BUT_follow_me; private ArdupilotMega.Controls.MyButton BUT_ant_track; private ArdupilotMega.Controls.MyButton BUT_magcalib; + private Controls.MyButton BUT_paramgen; } } \ No newline at end of file diff --git a/Tools/ArdupilotMegaPlanner/temp.cs b/Tools/ArdupilotMegaPlanner/temp.cs index cd00c72b34..f8170db65b 100644 --- a/Tools/ArdupilotMegaPlanner/temp.cs +++ b/Tools/ArdupilotMegaPlanner/temp.cs @@ -904,5 +904,10 @@ namespace ArdupilotMega { MagCalib.ProcessLog(); } + + private void BUT_paramgen_Click(object sender, EventArgs e) + { + ParameterMetaDataParser.GetParameterInformation(); + } } }