Skip to content

Commit 0ec05b4

Browse files
EosBandimeee1
authored andcommitted
Add Format SD card command to actions dropdown
1 parent 2235c2d commit 0ec05b4

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

GCSViews/FlightData.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ public enum actions
198198
Engine_Start,
199199
Engine_Stop,
200200
Terminate_Flight,
201+
Format_SD_Card,
201202
}
202203

203204
private Dictionary<int, string> NIC_table = new Dictionary<int, string>()
@@ -1668,6 +1669,24 @@ private void BUT_speed1_Click(object sender, EventArgs e)
16681669

16691670
private void BUTactiondo_Click(object sender, EventArgs e)
16701671
{
1672+
1673+
1674+
if (CMB_action.Text == actions.Format_SD_Card.ToString())
1675+
{
1676+
try
1677+
{
1678+
//p1 and p2 must be 1 to initate SD card format
1679+
MainV2.comPort.doCommandInt(MainV2.comPort.MAV.sysid, MainV2.comPort.MAV.compid, MAVLink.MAV_CMD.STORAGE_FORMAT, 1, 1, 0, 0, 0, 0, 0);
1680+
return;
1681+
}
1682+
catch
1683+
{
1684+
CustomMessageBox.Show(Strings.CommandFailed, Strings.ERROR);
1685+
return;
1686+
}
1687+
}
1688+
1689+
16711690
try
16721691
{
16731692
if (CMB_action.Text == actions.Trigger_Camera.ToString())

0 commit comments

Comments
 (0)