Exemple #1
0
        private void StatusTick_Tick(object sender, EventArgs e)
        {
            //force the API to pull the current status values in.
            DCAPI.UpdateStatus();

            //update the state and the connected text boxes
            StateBox.Text     = DCAPI.DroneNavigationState.ToString();
            ConnectedBox.Text = DCAPI.IsDroneConnected.ToString();

            //update the battery levels and progress percentages
            BatteryLevelPBLower.Value   = int.Parse(DCAPI.DroneBatteryPercentage.ToString());
            BatteryPercentageLabel.Text = DCAPI.DroneBatteryPercentage.ToString() + "%";

            //update the wireless quality and percentages.
            WifiQualityPB.Value             = int.Parse(DCAPI.DroneWIFIQuality.ToString()) * 100;
            WifiQualityPercentageLabel.Text = (int.Parse(DCAPI.DroneWIFIQuality.ToString()) * 100).ToString() + "%";

            //deal with the flight stats. Need to round off the floats to make it look good.
            MagnetoOffsetXBox.Text = Math.Round(DCAPI.DroneMagnetoOffsetX, 2).ToString();
            MagnetoOffsetYBox.Text = Math.Round(DCAPI.DroneMagnetoOffsetY, 2).ToString();
            MagnetoOffsetZBox.Text = Math.Round(DCAPI.DroneMagnetoOffsetZ, 2).ToString();

            MagnetoRectifiedXBox.Text = Math.Round(DCAPI.DroneMagnetoRectifiedX, 2).ToString();
            MagnetoRectifiedYBox.Text = Math.Round(DCAPI.DroneMagnetoRectifiedY, 2).ToString();
            MagnetoRectifiedZBox.Text = Math.Round(DCAPI.DroneMagnetoRectifiedZ, 2).ToString();

            VelocityXBox.Text = Math.Round(DCAPI.DroneVelocityX, 2).ToString();
            VelocityYBox.Text = Math.Round(DCAPI.DroneVelocityY, 2).ToString();
            VelocityZBox.Text = Math.Round(DCAPI.DroneVelocityZ, 2).ToString();

            RollBox.Text     = Math.Round(DCAPI.DroneRoll, 2).ToString();
            PitchBox.Text    = Math.Round(DCAPI.DronePitch, 2).ToString();
            AltitudeBox.Text = Math.Round(DCAPI.DroneAltitude, 2).ToString() + "M";
            YawBox.Text      = Math.Round(DCAPI.DroneYaw, 2).ToString();

            //add useless stats.
            TimeLabel.Text             = TimeSpan.FromMilliseconds((DCAPI.DroneTime / 1000)).ToString(@"hh\:mm\:ss");
            VideoFrameNumberLabel.Text = DCAPI.DroneVideoFrame.ToString();
        }
Exemple #2
0
 private void LandButton_Click(object sender, EventArgs e)
 {
     DCAPI.Land();
 }
Exemple #3
0
 private void TakeOffButton_Click(object sender, EventArgs e)
 {
     DCAPI.Takeoff();
 }
Exemple #4
0
 private void StopButton_Click(object sender, EventArgs e)
 {
     DCAPI.Stop();
 }
Exemple #5
0
 private void StartButton_Click(object sender, EventArgs e)
 {
     DCAPI.Start();
     //automatically do the flat trim on startup.
     DCAPI.FlatTrim();
 }
Exemple #6
0
 private void HoverButton_Click(object sender, EventArgs e)
 {
     DCAPI.Hover();
 }
Exemple #7
0
 private void RightButton_Click(object sender, EventArgs e)
 {
     DCAPI.Roll(false);
 }
Exemple #8
0
 private void BackwardsButton_Click(object sender, EventArgs e)
 {
     DCAPI.Pitch(false);
 }
Exemple #9
0
 private void LeftButton_Click(object sender, EventArgs e)
 {
     DCAPI.Roll();
 }
Exemple #10
0
 private void ForwardButton_Click(object sender, EventArgs e)
 {
     DCAPI.Pitch();
 }
Exemple #11
0
 private void DownButton_Click(object sender, EventArgs e)
 {
     DCAPI.Gaz(false);
 }
Exemple #12
0
 private void UpButton_Click(object sender, EventArgs e)
 {
     DCAPI.Gaz();
 }
Exemple #13
0
 private void ResetEmergencyButton_Click(object sender, EventArgs e)
 {
     DCAPI.ResetEmergency();
     //automatically redo the flat trim.
     DCAPI.FlatTrim();
 }
Exemple #14
0
 private void EmergencyButton_Click(object sender, EventArgs e)
 {
     DCAPI.Emergency();
 }