Skip to content

Commit

Permalink
FlightData: add Jump-To-Tag to map context menu
Browse files Browse the repository at this point in the history
  • Loading branch information
magicrub committed Apr 25, 2023
1 parent 8260593 commit 6557e22
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 2 deletions.
11 changes: 10 additions & 1 deletion GCSViews/FlightData.Designer.cs

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

24 changes: 24 additions & 0 deletions GCSViews/FlightData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6181,5 +6181,29 @@ private void multiLineToolStripMenuItem_Click(object sender, EventArgs e)
tabControlactions.Multiline = !tabControlactions.Multiline;
Settings.Instance["tabControlactions_Multiline"] = tabControlactions.Multiline.ToString();
}

private void jumpToTagToolStripMenuItem_Click(object sender, EventArgs e)
{
string tag_str = "";
if (InputBox.Show("Jump to Tag", "Tag Id:", ref tag_str) != DialogResult.OK)
{
return;
}

UInt16 tag;
if (!UInt16.TryParse(tag_str, out tag) || tag < 0 || tag > 0xFFFF)
{
CustomMessageBox.Show("Invalid Tag. Must be a number from 0 to 65535");
// NOTE: This is recursive to automatically re-pop up the dialog box
// on input error for as many times as you try to enter an invalid number.
jumpToTagToolStripMenuItem_Click(null, null);
return;
}

if (!MainV2.comPort.doCommand(MAVLink.MAV_CMD.DO_JUMP_TAG, tag, 0, 0, 0, 0, 0, 0))
{
CustomMessageBox.Show(Strings.CommandFailed, Strings.ERROR);
}
}
}
}
14 changes: 13 additions & 1 deletion GCSViews/FlightData.resx
Original file line number Diff line number Diff line change
Expand Up @@ -5239,8 +5239,14 @@
<data name="onOffCameraOverlapToolStripMenuItem.Text" xml:space="preserve">
<value>Camera Overlap</value>
</data>
<data name="jumpToTagToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>187, 22</value>
</data>
<data name="jumpToTagToolStripMenuItem.Text" xml:space="preserve">
<value>Jump To Tag</value>
</data>
<data name="contextMenuStripMap.Size" type="System.Drawing.Size, System.Drawing">
<value>188, 246</value>
<value>188, 290</value>
</data>
<data name="&gt;&gt;contextMenuStripMap.Name" xml:space="preserve">
<value>contextMenuStripMap</value>
Expand Down Expand Up @@ -6172,6 +6178,12 @@
<data name="&gt;&gt;bindingSourceStatusTab.Type" xml:space="preserve">
<value>System.Windows.Forms.BindingSource, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;jumpToTagToolStripMenuItem.Name" xml:space="preserve">
<value>jumpToTagToolStripMenuItem</value>
</data>
<data name="&gt;&gt;jumpToTagToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>FlightData</value>
</data>
Expand Down

0 comments on commit 6557e22

Please sign in to comment.