Skip to content

Commit

Permalink
GridUI: fix cam_trig_dist if breakup starts was off ArduPilot#1181
Browse files Browse the repository at this point in the history
  • Loading branch information
meee1 committed Mar 10, 2016
1 parent 6ebdb70 commit 4234d13
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
2 changes: 2 additions & 0 deletions ExtLibs/Grid/GridUI.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 20 additions & 5 deletions ExtLibs/Grid/GridUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1473,7 +1473,9 @@ private void BUT_Accept_Click(object sender, EventArgs e)
}

int i = 0;
grid.ForEach(plla =>
bool startedtrigdist = false;
PointLatLngAlt lastplla = PointLatLngAlt.Zero;
foreach (var plla in grid)
{
// skip before start point
if (i < wpstart)
Expand Down Expand Up @@ -1502,10 +1504,12 @@ private void BUT_Accept_Click(object sender, EventArgs e)
}
else
{
AddWP(plla.Lng, plla.Lat, plla.Alt);
if (chk_stopstart.Checked)
if (plla.Lat != lastplla.Lat || plla.Lng != lastplla.Lng || plla.Alt != lastplla.Alt)
AddWP(plla.Lng, plla.Lat, plla.Alt);

if (rad_trigdist.Checked)
{
if (rad_trigdist.Checked)
if (chk_stopstart.Checked)
{
if (plla.Tag == "SM")
{
Expand All @@ -1519,15 +1523,26 @@ private void BUT_Accept_Click(object sender, EventArgs e)
0, 0, 0, 0, 0, 0);
}
}
else
{
if (!startedtrigdist)
{
plugin.Host.AddWPtoList(MAVLink.MAV_CMD.DO_SET_CAM_TRIGG_DIST,
(float) NUM_spacing.Value,
0, 0, 0, 0, 0, 0);
startedtrigdist = true;
}
}
}
}
}
else
{
AddWP(plla.Lng, plla.Lat, plla.Alt);
}
lastplla = plla;
++i;
});
}

// end
if (rad_trigdist.Checked)
Expand Down

0 comments on commit 4234d13

Please sign in to comment.