Skip to content

Commit

Permalink
Merge 48e2303 into a823ed1
Browse files Browse the repository at this point in the history
  • Loading branch information
chobitsfan committed Aug 12, 2019
2 parents a823ed1 + 48e2303 commit 307b2dd
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions GCSViews/FlightData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ public FlightData()
list.Add("MISSION_START");
list.Add("PREFLIGHT_REBOOT_SHUTDOWN");
list.Add("Trigger Camera NOW");
list.Add("SYSTEM_TIME");
//DO_SET_SERVO
//DO_REPEAT_SERVO
}
Expand Down Expand Up @@ -1961,6 +1962,22 @@ private void BUTactiondo_Click(object sender, EventArgs e)
return;
}

if (CMB_action.Text == "SYSTEM_TIME")
{
var now = DateTime.UtcNow;
var epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
ulong time_unix_us = Convert.ToUInt64((now - epoch).TotalMilliseconds * 1000);
try
{
MainV2.comPort.sendPacket(new MAVLink.mavlink_system_time_t() { time_unix_usec = time_unix_us, time_boot_ms = 0 }, MainV2.comPort.sysidcurrent, MainV2.comPort.compidcurrent);
}
catch
{
CustomMessageBox.Show(Strings.CommandFailed, Strings.ERROR);
}
return;
}

if (
CustomMessageBox.Show("Are you sure you want to do " + CMB_action.Text + " ?", "Action",
MessageBoxButtons.YesNo) == (int)DialogResult.Yes)
Expand Down

0 comments on commit 307b2dd

Please sign in to comment.