void droneController_OnNotifyDroneInfoMessage(object sender, DroneInfoNotificationEventArgs e) { if (!Dispatcher.CheckAccess()) { Dispatcher.BeginInvoke(new Action <object, DroneInfoNotificationEventArgs>(droneController_OnNotifyDroneInfoMessage), sender, e); } else { //handle e /*if (e.DroneConfiguration.Count != 0) * { * takeOff(); * * * droneController.SetConfiguration("control:euler_angle_max", "0.52"); * droneController.SetConfiguration("control:control_iphone_tilt", "1"); * time.Interval = TimeSpan.FromSeconds(4); * time.Tick += new EventHandler(takeOffDone); * time.Start(); * }*/ } }
private void OnNotifiedDroneInfo(DroneInfoNotificationEventArgs e) { if (OnNotifyTraceMessage != null && ConnectionStatus != ConnectionStatus.Closed) { OnNotifyDroneInfoMessage(this, e); } }
void droneController_OnNotifyDroneInfoMessage(object sender, DroneInfoNotificationEventArgs e) { if (!Dispatcher.CheckAccess()) { Dispatcher.BeginInvoke(new Action<object, DroneInfoNotificationEventArgs>(droneController_OnNotifyDroneInfoMessage), sender, e); } else { //handle e /*if (e.DroneConfiguration.Count != 0) { takeOff(); droneController.SetConfiguration("control:euler_angle_max", "0.52"); droneController.SetConfiguration("control:control_iphone_tilt", "1"); time.Interval = TimeSpan.FromSeconds(4); time.Tick += new EventHandler(takeOffDone); time.Start(); }*/ } }
/// <summary> /// Initializes a new instance of the <see cref="DroneController"/> class. /// </summary> /// <param name="droneControllerConfiguration">The drone controller configuration.</param> public DroneController(DroneControllerConfiguration droneControllerConfiguration) { ControllerConfig = droneControllerConfiguration; DroneProxy = DroneProxy.Create(); #if Video VideoImage = new VideoImage(); VideoImage.ImageComplete += new EventHandler<ImageCompleteEventArgs>(VideoImage_ImageComplete); #endif DroneInfoNotificationEventArgs = new DroneInfoNotificationEventArgs(); DroneInfoTimer = new DispatcherTimer(); DroneInfoTimer.Interval = TimeSpan.FromTicks(Constants.DroneInfoTimerInterval); DroneInfoTimer.Tick += new EventHandler(DroneInfoTimer_Elapsed); }