Skip to content
Open
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
28 changes: 17 additions & 11 deletions GCSViews/FlightData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ public enum actions
Preflight_Calibration,
Mission_Start,
Preflight_Reboot_Shutdown,
Reboot_Mass_Storage,
Trigger_Camera,
System_Time,
Battery_Reset,
Expand Down Expand Up @@ -1680,20 +1681,17 @@ private void BUT_speed1_Click(object sender, EventArgs e)
private void BUTactiondo_Click(object sender, EventArgs e)
{
// Custom action handling
if (CustomActions.TryGetValue(CMB_action.Text, out var customAction))
{
var customAction = CustomActions[CMB_action.Text];
if(customAction!=null)
try
{
try
{
customAction.Invoke(CMB_action.Text);
}
catch (Exception ex)
{
CustomMessageBox.Show(Strings.CommandFailed + "\n" + ex.ToString(), Strings.ERROR);
}
return;
customAction.Invoke(CMB_action.Text);
Comment on lines +1684 to +1688

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Fix the code for this review comment.

When a review comment includes a suggested change, apply the suggestion exactly.

Do not make changes beyond what is described in the linked review comment.

}
catch (Exception ex)
{
CustomMessageBox.Show(Strings.CommandFailed + "\n" + ex.ToString(), Strings.ERROR);
}
return;
}

if (CMB_action.Text == actions.Format_SD_Card.ToString())
Expand Down Expand Up @@ -1806,6 +1804,14 @@ private void BUTactiondo_Click(object sender, EventArgs e)
((Control) sender).Enabled = true;
return;
}
if (CMB_action.Text == actions.Reboot_Mass_Storage.ToString())
{
const float rebootToMassStorage = 5;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Fix the code for this review comment.

When a review comment includes a suggested change, apply the suggestion exactly.

Do not make changes beyond what is described in the linked review comment.

MainV2.comPort.doCommand(MainV2.comPort.MAV.sysid, MainV2.comPort.MAV.compid,
MAVLink.MAV_CMD.PREFLIGHT_REBOOT_SHUTDOWN, rebootToMassStorage, 0, 0, 0, 0, 0, 0);
((Control) sender).Enabled = true;
return;
}
if (CMB_action.Text == actions.HighLatency_Enable.ToString())
{
MainV2.comPort.doHighLatency(true);
Expand Down
Loading