Exemplo n.º 1
0
        protected override void OnNavigatedFrom(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedFrom(e);

            _droneController.Disconnect();

            if (_compass != null)
            {
                _compass.Stop();
            }

            if (_accelerometer != null && UseAccelerometer)
            {
                _accelerometer.Stop();
            }

            //if (UseLocationService)
            //{
            //    GeoCoordinateWatcher.Stop();
            //}
        }
Exemplo n.º 2
0
 private void Connect_OnClick(object sender, RoutedEventArgs routedEventArgs)
 {
     if (DroneController.Connected)
     {
         DroneController.Disconnect();
     }
     else
     {
         try
         {
             DroneController.Connect();
         }
         catch
         {
             var dialog =
                 new MessageDialog(
                     "Could not connect to AR Drone. Please verify you are connected to the drone's WIFI and that you are the only device connected. If necessary, restart the drone.",
                     "Unable to connect.");
             dialog.ShowAsync();
         }
     }
 }
Exemplo n.º 3
0
 protected override void OnNavigatedFrom(Windows.UI.Xaml.Navigation.NavigationEventArgs e)
 {
     base.OnNavigatedFrom(e);
     DroneController.Disconnect();
     SettingsPane.GetForCurrentView().CommandsRequested -= OnCommandsRequested;
 }