private void OnDownloadClick(object sender, RoutedEventArgs e) { var entry = (LogEntryModel)LogFiles.SelectedItem; if (entry != null) { selectedEntry = entry.Entry; RequestLogData(entry.Entry.id, 0, uint.MaxValue); StartProgress(); DownloadStatus.Text = "downloading..."; } }
private void OnMessageReceived(object sender, MavLinkMessage e) { if (e.MsgId == MAVLINK_MSG_ID.LOG_ENTRY) { if (e.TypedPayload is mavlink_log_entry_t) { List <LogEntryModel> list = new List <LogEntryModel>(); mavlink_log_entry_t entry = (mavlink_log_entry_t)e.TypedPayload; UiDispatcher.RunOnUIThread(() => { logList.Add(new LogEntryModel(entry)); delayedActions.CancelDelayedAction("GetList"); }); } } else if (e.MsgId == MAVLINK_MSG_ID.LOG_DATA) { if (e.TypedPayload is mavlink_log_data_t) { var logdata = (mavlink_log_data_t)e.TypedPayload; if (logdata.id == selectedEntry.id) { lock (data) { lastChunkTime = Environment.TickCount; totalDownloaded += logdata.count; data.Add(logdata); } if (holes.Count > 0) { FetchNextHole(logdata); } } } } }
private static DateTime GetLogTime(mavlink_log_entry_t entry) { return(new DateTime(1970, 1, 1).AddSeconds(entry.time_utc).ToLocalTime()); }
public LogEntryModel(mavlink_log_entry_t entry) { this.entry = entry; }
private static DateTime GetLogTime(mavlink_log_entry_t entry) { return new DateTime(1970, 1, 1).AddSeconds(entry.time_utc).ToLocalTime(); }