Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cfa69cb

Browse files
committed
Mission Planner 1.2.75
speed tuning. fix ch3out when not connected fix dont let current be negative support andropilot logs (253 sysid) change gmapmaker to cache icon fix utmzone calc. (was central meridian, not zone) resize some images. add utm and mgrs to mouse movement. fix sort on grad click recalc grad more often. add utm grid to FP screen. add COMPASS_EXTERNAL support fix declination handeling. add overstats, and session stats support fmuv2 uploading add geoutility external lib add new coords display in FD hud performance tweak mainswitcher input validation tweak mybutton colors add new myprogressbar map marker performance tweak fix getlongest side in survey interface zedgraph symbol performance tweak split the deg, min in compass add rc9 to gimbal screen raw param performance tweak anable/disable disconnect button in terminal add map to logbrowser
1 parent c214425 commit cfa69cb

129 files changed

Lines changed: 14361 additions & 5811 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Arduino/BoardDetect.cs

Lines changed: 515 additions & 0 deletions
Large diffs are not rendered by default.

ArdupilotMega.csproj

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@
232232
<DependentUpon>Tracker.cs</DependentUpon>
233233
</Compile>
234234
<Compile Include="Arduino\IArduinoComms.cs" />
235-
<Compile Include="Arduino\ArduinoDetect.cs" />
235+
<Compile Include="Arduino\BoardDetect.cs" />
236236
<Compile Include="Arduino\ArduinoSTK.cs">
237237
<SubType>Component</SubType>
238238
</Compile>
@@ -374,6 +374,7 @@
374374
<DependentUpon>SoftwareConfig.cs</DependentUpon>
375375
</Compile>
376376
<Compile Include="Magfitrotation.cs" />
377+
<Compile Include="MagMotor.cs" />
377378
<Compile Include="Plugin\Plugin.cs" />
378379
<Compile Include="Plugin\PluginLoader.cs" />
379380
<Compile Include="Plugin\PluginUI.cs">
@@ -396,7 +397,6 @@
396397
</Compile>
397398
<Compile Include="Utilities\Firmware.cs" />
398399
<Compile Include="Utilities\ImageOverFilter.cs" />
399-
<None Include="Utilities\RSA.cs" />
400400
<Compile Include="Utilities\StringRedirectWriter.cs" />
401401
<Compile Include="Utilities\Update.cs" />
402402
<Compile Include="Wizard\1Intro.cs">
@@ -1226,6 +1226,7 @@
12261226
</EmbeddedResource>
12271227
<EmbeddedResource Include="GCSViews\ConfigurationView\ConfigAteryxSensors.resx">
12281228
<DependentUpon>ConfigAteryxSensors.cs</DependentUpon>
1229+
<SubType>Designer</SubType>
12291230
</EmbeddedResource>
12301231
<EmbeddedResource Include="GCSViews\ConfigurationView\ConfigAteryxSensors.zh-Hans.resx">
12311232
<DependentUpon>ConfigAteryxSensors.cs</DependentUpon>
@@ -2118,6 +2119,10 @@
21182119
<Project>{59129078-7B12-4198-B93E-0AA08D0BB7ED}</Project>
21192120
<Name>Core</Name>
21202121
</ProjectReference>
2122+
<ProjectReference Include="ExtLibs\GeoUtility\GeoUtility.csproj">
2123+
<Project>{7f7994ce-823f-4a04-bbea-d0a3808ff56d}</Project>
2124+
<Name>GeoUtility</Name>
2125+
</ProjectReference>
21212126
<ProjectReference Include="ExtLibs\GLControl\OpenTK.GLControl.csproj">
21222127
<Project>{A625BE88-0000-0000-0000-000000000000}</Project>
21232128
<Name>OpenTK.GLControl</Name>

ArdupilotMega.sln

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MissionPlanner.Grid", "ExtL
4848
EndProject
4949
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MissionPlanner.Stats", "ExtLibs\MissionPlanner.Stats\MissionPlanner.Stats.csproj", "{6A6F4345-0A45-413E-B6D6-FD73660DAD4C}"
5050
EndProject
51+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GeoUtility", "ExtLibs\GeoUtility\GeoUtility.csproj", "{7F7994CE-823F-4A04-BBEA-D0A3808FF56D}"
52+
EndProject
5153
Global
5254
GlobalSection(SolutionConfigurationPlatforms) = preSolution
5355
Debug|Any CPU = Debug|Any CPU
@@ -301,6 +303,16 @@ Global
301303
{6A6F4345-0A45-413E-B6D6-FD73660DAD4C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
302304
{6A6F4345-0A45-413E-B6D6-FD73660DAD4C}.Release|Mixed Platforms.Build.0 = Release|Any CPU
303305
{6A6F4345-0A45-413E-B6D6-FD73660DAD4C}.Release|x86.ActiveCfg = Release|Any CPU
306+
{7F7994CE-823F-4A04-BBEA-D0A3808FF56D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
307+
{7F7994CE-823F-4A04-BBEA-D0A3808FF56D}.Debug|Any CPU.Build.0 = Debug|Any CPU
308+
{7F7994CE-823F-4A04-BBEA-D0A3808FF56D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
309+
{7F7994CE-823F-4A04-BBEA-D0A3808FF56D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
310+
{7F7994CE-823F-4A04-BBEA-D0A3808FF56D}.Debug|x86.ActiveCfg = Debug|Any CPU
311+
{7F7994CE-823F-4A04-BBEA-D0A3808FF56D}.Release|Any CPU.ActiveCfg = Release|Any CPU
312+
{7F7994CE-823F-4A04-BBEA-D0A3808FF56D}.Release|Any CPU.Build.0 = Release|Any CPU
313+
{7F7994CE-823F-4A04-BBEA-D0A3808FF56D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
314+
{7F7994CE-823F-4A04-BBEA-D0A3808FF56D}.Release|Mixed Platforms.Build.0 = Release|Any CPU
315+
{7F7994CE-823F-4A04-BBEA-D0A3808FF56D}.Release|x86.ActiveCfg = Release|Any CPU
304316
EndGlobalSection
305317
GlobalSection(SolutionProperties) = preSolution
306318
HideSolutionNode = FALSE

ChangeLog.txt

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,35 @@
1-
* Mission Planner 1.2.74
1+
* Mission Planner 1.2.75
2+
speed tuning.
3+
fix ch3out when not connected
4+
fix dont let current be negative
5+
support andropilot logs (253 sysid)
6+
change gmapmaker to cache icon
7+
fix utmzone calc. (was central meridian, not zone)
8+
resize some images.
9+
add utm and mgrs to mouse movement.
10+
fix sort on grad click
11+
recalc grad more often.
12+
add utm grid to FP screen.
13+
add COMPASS_EXTERNAL support
14+
fix declination handeling.
15+
add overstats, and session stats
16+
support fmuv2 uploading
17+
add geoutility external lib
18+
add new coords display in FD
19+
hud performance tweak
20+
mainswitcher input validation
21+
tweak mybutton colors
22+
add new myprogressbar
23+
map marker performance tweak
24+
fix getlongest side in survey interface
25+
zedgraph symbol performance tweak
26+
split the deg, min in compass
27+
add rc9 to gimbal screen
28+
raw param performance tweak
29+
anable/disable disconnect button in terminal
30+
add map to logbrowser
31+
32+
* Mission Planner 1.2.74
233
more Grid/Survey WIP
334
fix close issue on mono
435
implement MagFitRotation from tridge

Common.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,21 +142,22 @@ public class GMapMarkerPlane : GMapMarker
142142
const float rad2deg = (float)(180 / Math.PI);
143143
const float deg2rad = (float)(1.0 / rad2deg);
144144

145-
static readonly System.Drawing.Size SizeSt = new System.Drawing.Size(global::MissionPlanner.Properties.Resources.planeicon.Width, global::MissionPlanner.Properties.Resources.planeicon.Height);
145+
private readonly Bitmap icon = global::MissionPlanner.Properties.Resources.planeicon;
146+
146147
float heading = 0;
147148
float cog = -1;
148149
float target = -1;
149150
float nav_bearing = -1;
150151
public GMapControl MainMap;
151-
152+
152153
public GMapMarkerPlane(PointLatLng p, float heading, float cog, float nav_bearing,float target, GMapControl map)
153154
: base(p)
154155
{
155156
this.heading = heading;
156157
this.cog = cog;
157158
this.target = target;
158159
this.nav_bearing = nav_bearing;
159-
Size = SizeSt;
160+
Size = icon.Size;
160161
MainMap = map;
161162
}
162163

@@ -220,7 +221,7 @@ public override void OnRender(Graphics g)
220221
try {
221222
g.RotateTransform(heading);
222223
} catch{}
223-
g.DrawImageUnscaled(global::MissionPlanner.Properties.Resources.planeicon, global::MissionPlanner.Properties.Resources.planeicon.Width / -2, global::MissionPlanner.Properties.Resources.planeicon.Height / -2);
224+
g.DrawImageUnscaled(icon, icon.Width / -2, icon.Height / -2);
224225

225226
g.Transform = temp;
226227
}
@@ -232,7 +233,8 @@ public class GMapMarkerQuad : GMapMarker
232233
const float rad2deg = (float)(180 / Math.PI);
233234
const float deg2rad = (float)(1.0 / rad2deg);
234235

235-
static readonly System.Drawing.Size SizeSt = new System.Drawing.Size(global::MissionPlanner.Properties.Resources.quadicon.Width, global::MissionPlanner.Properties.Resources.quadicon.Height);
236+
private readonly Bitmap icon = global::MissionPlanner.Properties.Resources.quadicon;
237+
236238
float heading = 0;
237239
float cog = -1;
238240
float target = -1;
@@ -243,7 +245,7 @@ public GMapMarkerQuad(PointLatLng p, float heading, float cog, float target)
243245
this.heading = heading;
244246
this.cog = cog;
245247
this.target = target;
246-
Size = SizeSt;
248+
Size = icon.Size;
247249
}
248250

249251
public override void OnRender(Graphics g)
@@ -267,7 +269,7 @@ public override void OnRender(Graphics g)
267269
g.RotateTransform(heading);
268270
}
269271
catch { }
270-
g.DrawImageUnscaled(global::MissionPlanner.Properties.Resources.quadicon, global::MissionPlanner.Properties.Resources.quadicon.Width / -2 + 2, global::MissionPlanner.Properties.Resources.quadicon.Height / -2);
272+
g.DrawImageUnscaled(icon, icon.Width / -2 + 2, icon.Height / -2);
271273

272274
g.Transform = temp;
273275
}

CurrentState.cs

Lines changed: 72 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,12 @@ public float ch3percent
167167
{
168168
if (MainV2.comPort.MAV.param.ContainsKey("RC3_MIN"))
169169
{
170-
return (int)((ch3out - float.Parse(MainV2.comPort.MAV.param["RC3_MIN"].ToString())) / (float.Parse(MainV2.comPort.MAV.param["RC3_MAX"].ToString()) - float.Parse(MainV2.comPort.MAV.param["RC3_MIN"].ToString())) * 100);
170+
return (int)(((ch3out - (float)MainV2.comPort.MAV.param["RC3_MIN"]) / ((float)MainV2.comPort.MAV.param["RC3_MAX"] - (float)MainV2.comPort.MAV.param["RC3_MIN"])) * 100);
171171
}
172172
else
173173
{
174+
if (ch3out == 0)
175+
return 0;
174176
return (int)((ch3out - 1100) / (1900 - 1100) * 100);
175177
}
176178
}
@@ -258,7 +260,7 @@ public float ch3percent
258260
public float battery_remaining { get { return _battery_remaining; } set { _battery_remaining = value; if (_battery_remaining < 0 || _battery_remaining > 100) _battery_remaining = 0; } }
259261
private float _battery_remaining;
260262
[DisplayText("Bat Current (Amps)")]
261-
public float current { get { return _current; } set { if (_lastcurrent == DateTime.MinValue) _lastcurrent = datetime; battery_usedmah += (value * 1000) * (float)(datetime - _lastcurrent).TotalHours; _current = value; _lastcurrent = datetime; } }
263+
public float current { get { return _current; } set { if (value < 0) return; if (_lastcurrent == DateTime.MinValue) _lastcurrent = datetime; battery_usedmah += (value * 1000) * (float)(datetime - _lastcurrent).TotalHours; _current = value; _lastcurrent = datetime; } }
262264
private float _current;
263265
private DateTime _lastcurrent = DateTime.MinValue;
264266
[DisplayText("Bat used EST (mah)")]
@@ -459,9 +461,14 @@ public float DistRSSIRemain {
459461
bool gotwind = false;
460462
internal bool batterymonitoring = false;
461463

464+
internal bool MONO = false;
465+
462466
public CurrentState()
463467
{
464468
ResetInternals();
469+
470+
var t = Type.GetType("Mono.Runtime");
471+
MONO = (t != null);
465472
}
466473

467474
public void ResetInternals()
@@ -701,43 +708,51 @@ enum gcs_severity {
701708
{
702709
var hb = bytearray.ByteArrayToStructure<MAVLink.mavlink_heartbeat_t>(6);
703710

704-
armed = (hb.base_mode & (byte)MAVLink.MAV_MODE_FLAG.SAFETY_ARMED) == (byte)MAVLink.MAV_MODE_FLAG.SAFETY_ARMED;
711+
if (hb.type == (byte)MAVLink.MAV_TYPE.GCS)
712+
{
713+
// skip gcs hb's
714+
// only happens on log playback - and shouldnt get them here
715+
}
716+
else
717+
{
718+
armed = (hb.base_mode & (byte)MAVLink.MAV_MODE_FLAG.SAFETY_ARMED) == (byte)MAVLink.MAV_MODE_FLAG.SAFETY_ARMED;
705719

706-
failsafe = hb.system_status == (byte)MAVLink.MAV_STATE.CRITICAL;
720+
failsafe = hb.system_status == (byte)MAVLink.MAV_STATE.CRITICAL;
707721

708-
string oldmode = mode;
722+
string oldmode = mode;
709723

710-
if ((hb.base_mode & (byte)MAVLink.MAV_MODE_FLAG.CUSTOM_MODE_ENABLED) != 0)
711-
{
712-
// prevent running thsi unless we have to
713-
if (_mode != hb.custom_mode)
724+
if ((hb.base_mode & (byte)MAVLink.MAV_MODE_FLAG.CUSTOM_MODE_ENABLED) != 0)
714725
{
715-
List<KeyValuePair<int, string>> modelist = Common.getModesList(this);
726+
// prevent running thsi unless we have to
727+
if (_mode != hb.custom_mode)
728+
{
729+
List<KeyValuePair<int, string>> modelist = Common.getModesList(this);
716730

717-
bool found = false;
731+
bool found = false;
718732

719-
foreach (KeyValuePair<int, string> pair in modelist)
720-
{
721-
if (pair.Key == hb.custom_mode)
733+
foreach (KeyValuePair<int, string> pair in modelist)
722734
{
723-
mode = pair.Value.ToString();
724-
_mode = hb.custom_mode;
725-
found = true;
726-
break;
735+
if (pair.Key == hb.custom_mode)
736+
{
737+
mode = pair.Value.ToString();
738+
_mode = hb.custom_mode;
739+
found = true;
740+
break;
741+
}
727742
}
728-
}
729743

730-
if (!found)
731-
{
732-
log.Warn("Mode not found bm:" + hb.base_mode + " cm:" + hb.custom_mode);
733-
_mode = hb.custom_mode;
744+
if (!found)
745+
{
746+
log.Warn("Mode not found bm:" + hb.base_mode + " cm:" + hb.custom_mode);
747+
_mode = hb.custom_mode;
748+
}
734749
}
735750
}
736-
}
737751

738-
if (oldmode != mode && MainV2.speechEnable && MainV2.getConfig("speechmodeenabled") == "True")
739-
{
740-
MainV2.speechEngine.SpeakAsync(Common.speechConversion(MainV2.getConfig("speechmode")));
752+
if (oldmode != mode && MainV2.speechEnable && MainV2.getConfig("speechmodeenabled") == "True")
753+
{
754+
MainV2.speechEngine.SpeakAsync(Common.speechConversion(MainV2.getConfig("speechmode")));
755+
}
741756
}
742757
}
743758

@@ -1029,16 +1044,38 @@ enum gcs_severity {
10291044
{
10301045
if (bs != null)
10311046
{
1032-
//System.Diagnostics.Debug.WriteLine(DateTime.Now.Millisecond);
1033-
// Console.Write(" "+DateTime.Now.Millisecond);
1047+
if (bs.Count > 100)
1048+
bs.Clear();
1049+
bs.Add(this);
1050+
1051+
return;
1052+
1053+
hires.Stopwatch sw = new hires.Stopwatch();
1054+
1055+
sw.Start();
10341056
bs.DataSource = this;
1035-
// Console.Write(" " + DateTime.Now.Millisecond + " 1 " + updatenow + " " + System.Threading.Thread.CurrentThread.Name);
10361057
bs.ResetBindings(false);
1037-
//bs.ResetCurrentItem();
1038-
// mono workaround - this is alot faster
1039-
//bs.Clear();
1040-
//bs.Add(this);
1041-
// Console.WriteLine(" " + DateTime.Now.Millisecond + " done ");
1058+
sw.Stop();
1059+
var elaps = sw.Elapsed;
1060+
Console.WriteLine("1 " + elaps.ToString("0.#####") + " done ");
1061+
1062+
sw.Start();
1063+
bs.SuspendBinding();
1064+
bs.Clear();
1065+
bs.ResumeBinding();
1066+
bs.Add(this);
1067+
sw.Stop();
1068+
elaps = sw.Elapsed;
1069+
Console.WriteLine("2 " + elaps.ToString("0.#####") + " done ");
1070+
1071+
sw.Start();
1072+
if (bs.Count > 100)
1073+
bs.Clear();
1074+
bs.Add(this);
1075+
sw.Stop();
1076+
elaps = sw.Elapsed;
1077+
Console.WriteLine("3 " + elaps.ToString("0.#####") + " done ");
1078+
10421079
}
10431080
}
10441081
catch { log.InfoFormat("CurrentState Binding error"); }

ExtLibs/Comms/MissionPlanner.Comms.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<DefineConstants>DEBUG;TRACE</DefineConstants>
2121
<ErrorReport>prompt</ErrorReport>
2222
<WarningLevel>4</WarningLevel>
23+
<PlatformTarget>x86</PlatformTarget>
2324
</PropertyGroup>
2425
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
2526
<DebugType>pdbonly</DebugType>

0 commit comments

Comments
 (0)