Example #1
0
 public void Bebop2_OnAltitudeChanged(Bebop2 bebop, double altitude)
 {
     this.droneAltitudeLabel.Invoke(new MethodInvoker(delegate()
     {
         this.droneAltitudeLabel.Text = string.Format("{0:F2}m", altitude);
     }));
 }
Example #2
0
 public void Bebop2_OnBatteryChanged(Bebop2 bebop2, int battery)
 {
     this.batteryLabel.Invoke(new MethodInvoker(delegate()
     {
         this.batteryLabel.Text = string.Format("{0}%%", battery);
     }));
 }
Example #3
0
 public void Bebop2_OnSpeedChanged(Bebop2 bebop2, Leap.Vector speed)
 {
     this.droneSpeedLabel.Invoke(new MethodInvoker(delegate()
     {
         this.droneSpeedLabel.Text = string.Format("{0:F2}m/s", speed.MagnitudeSquared);
     }));
 }
Example #4
0
 private void Bebop2_OnRotationChanged(Bebop2 bebop2, float pitch, float yaw, float roll)
 {
     if (this.AutoFlight.IsFlying)
     {
         this.AutoFlight.Update(bebop2.GPS, bebop2.Yaw, out this._pcmd.roll, out this._pcmd.pitch);
         this._pcmd.flag = 1;
     }
 }
Example #5
0
        public Pcmd Bebop2_OnRequestPcmd(Bebop2 bebop)
        {
            this._mutex.WaitOne();
            var pcmd = new Pcmd(this._pcmd);

            this._mutex.ReleaseMutex();
            return(pcmd);
        }
Example #6
0
        private void Bebop_OnError(Bebop2 bebop, string message)
        {
            var mainform = this;

            this.Invoke(new MethodInvoker(delegate()
            {
                var dialog = new MessageDialog(message, System.Drawing.Color.Gainsboro);
                dialog.ShowDialog(mainform);
            }));
        }
Example #7
0
        public void Bebop2_OnPositionChanged(Bebop2 bebop2, double lat, double lon, double alt)
        {
            this.latLabel.Invoke(new MethodInvoker(delegate()
            {
                this.latLabel.Text = string.Format("위도 {0}", lat);
            }));

            this.lonLabel.Invoke(new MethodInvoker(delegate()
            {
                this.lonLabel.Text = string.Format("경도 {0}", lon);
            }));
        }
Example #8
0
        private void Bebop_OnPositionChanged(Bebop2 bebop2, double lat, double lon, double alt)
        {
            this.Overlayer.SetPosition(lat, lon);
            this.Overlayer.RequestAddress("self", lat, lon);
            this.GenerateDronePosition(lat, lon, alt);

            if (this.AutoFlight.IsFlying)
            {
                this.AutoFlight.Update(bebop2.GPS, bebop2.Yaw, out this._pcmd.roll, out this._pcmd.pitch);
                this._pcmd.flag = 1;
            }
        }
Example #9
0
        public void Bebop_OnConnectionChanged(Bebop2 bebop)
        {
            this.connectDroneProgressbar.Invoke(new MethodInvoker(delegate()
            {
                connectDroneProgressbar.animated = bebop.Connected;
                connectDroneProgressbar.Value    = bebop.Connected ? 15 : 0;
            }));

            this.connectionLabel.Invoke(new MethodInvoker(delegate()
            {
                this.connectionLabel.Text = bebop.Connected ? "드론과 연결되었습니다." : "드론과 연결되지 않았습니다.";
            }));

            this.takeoffSwitch.Invoke(new MethodInvoker(delegate()
            {
                this.takeoffSwitch.Enabled = bebop.Connected;
            }));
        }
Example #10
0
        public void Bebop_OnConnectionChanged(Bebop2 bebop)
        {
            try
            {
                this.SetProgressbarState(this.droneProgressbar, this.Root.Bebop2.Connected);

                this.droneProgressbar.Invoke(new MethodInvoker(delegate()
                {
                    this.droneProgressbar.Value             = this.Root.Bebop2.Connected ? 15 : 0;
                    this.droneProgressbar.ProgressBackColor = this.Root.Bebop2.Connected ? Color.Gainsboro : Color.FromArgb(255, 200, 150);
                }));

                this.droneStatePanel.Invoke(new MethodInvoker(delegate()
                {
                    this.droneConnectionLabel.Text = this.Root.Bebop2.Connected ? "연결됨" : "연결 안 됨";
                    this.droneStatePanel.Visible   = this.Root.Bebop2.Connected;
                }));
            }
            catch (Exception)
            { }
        }
Example #11
0
 public void Bebop2_OnPositionChanged(Bebop2 bebop2, double lat, double lon, double alt)
 {
     this._gmap.SetPosition(new GCS(lat, lon), true);
 }
Example #12
0
 public void Bebop2_OnWifiChanged(Bebop2 bebop2, ushort rssi)
 {
 }
Example #13
0
 public void Bebop2_OnStreaming(Bebop2 bebop, Mat frame)
 {
 }