Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jump Tags - add ability to Trigger it #3101

Merged
merged 2 commits into from
Apr 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

30 changes: 30 additions & 0 deletions GCSViews/FlightData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6181,5 +6181,35 @@ 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;
}

try {
if (!MainV2.comPort.doCommand(MAVLink.MAV_CMD.DO_JUMP_TAG, tag, 0, 0, 0, 0, 0, 0))
{
CustomMessageBox.Show(Strings.CommandFailed, Strings.ERROR);
}
}
catch (Exception ex)
{
CustomMessageBox.Show(Strings.CommandFailed + ex.ToString(), 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