コード例 #1
0
 // Called if the gameobject is destroyed
 void OnDestroy()
 {
     droneClient.Land();
     droneClient.Stop();
     droneClient.Dispose();
     videoPacketDecoderWorker.Stop();
     videoPacketDecoderWorker.Dispose();
 }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: SBejga/MyoPilot
        /// <summary>
        /// Stop video processing
        /// </summary>
        private void StopVideo()
        {
            timerVideoUpdate.Enabled = false;

            videoPacketDecoderWorker.Stop();
            videoPacketDecoderWorker.Join();
            frame       = null;
            frameBitmap = null;
        }
コード例 #3
0
ファイル: MainWindow.xaml.cs プロジェクト: jmservera/IoTDrone
 private async void MainWindow_Closed(object sender, EventArgs e)
 {
     if (frameTimer != null)
     {
         frameTimer.Stop();
     }
     if (droneClient != null)
     {
         droneClient.Stop();
         droneClient.Dispose();
     }
     if (videoPacketDecoderWorker != null)
     {
         videoPacketDecoderWorker.Stop();
         videoPacketDecoderWorker.Dispose();
     }
     await closeSource();
 }
コード例 #4
0
ファイル: MainWindow.xaml.cs プロジェクト: jmservera/IoTDrone
        void configDrone()
        {
            if (droneClient != null)
            {
                droneClient.VideoPacketAcquired -= OnVideoPacketAcquired;
            }
            droneClient?.Stop();
            droneClient?.Dispose();
            iotController = null;
            autoPilot?.Stop();
            autoPilot = null;
            videoPacketDecoderWorker?.Stop();
            videoPacketDecoderWorker?.Dispose();

            Logger.LogInfo($"Configuring Drone at {config.DroneIP}");
            droneClient = new DroneClient(config.DroneIP);
            droneClient.VideoPacketAcquired += OnVideoPacketAcquired;
            videoPacketDecoderWorker         = new VideoPacketDecoderWorker(AR.Drone.Video.PixelFormat.BGR24, true, OnVideoPacketDecoded);
            videoPacketDecoderWorker.Start();

            iotController = new IoTHubController(droneClient, analyzerOutput, bitmaps);
            autoPilot     = new Pilot.Controller(droneClient, analyzerOutput, config, iotController);
        }