Ejemplo n.º 1
0
        private void Off_Click(object sender, EventArgs e)//Connect/Disconnect button
        {
            if (prcs_handler.flag == false)
            {
                prcs_handler.start_prcs();
                prcs_handler.check();
                DroneConnection.createconnection();
                Thread.Sleep(6000);
                pictureBox1.Load(@"http://localhost:8080/");
                timer1.Start();
                this.trd         = new Thread(new ThreadStart(this.ThreadTask));
                trd.IsBackground = true;
                trd.Start();
                Off.Text = "Connected";
            }

            else
            {
                DroneConnection.closeconnection();
                prcs_handler.stop_prcs();
                trd.Abort();
                timer1.Stop();
                Off.Text = "Disconnected";
            }
        }
Ejemplo n.º 2
0
 private void ThreadTask()
 {
     while (true)
     {
         DroneConnection.receiveBatteryInfo();
         this.SetText(DroneConnection.battery);
     }
 }
Ejemplo n.º 3
0
 private void toDroneToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (prcs_handler.flag == false)
     {
         prcs_handler.start_prcs();
         prcs_handler.check();
         DroneConnection.createconnection();
     }
     else
     {
         MessageBox.Show("Already connected");
     }
 }
Ejemplo n.º 4
0
 public void RightButton_Click(object sender, EventArgs e)
 {
     DroneConnection.command = "Right";
     DroneConnection.sendcommand();
 }
Ejemplo n.º 5
0
 public void manualup()//Up
 {
     DroneConnection.command = "Up";
     DroneConnection.sendcommand();
 }
Ejemplo n.º 6
0
 public void manualright()
 {
     DroneConnection.command = "Right";
     DroneConnection.sendcommand();
 }
Ejemplo n.º 7
0
 public void manualLeft()
 {
     DroneConnection.command = "Left";
     DroneConnection.sendcommand();
 }
Ejemplo n.º 8
0
 public void manualontrol_takeoff()
 {
     DroneConnection.command = "Takeoff";
     DroneConnection.sendcommand();
 }
Ejemplo n.º 9
0
 public void manualontrol_land()
 {
     DroneConnection.command = "Land";
     DroneConnection.sendcommand();
 }
Ejemplo n.º 10
0
 public void manualHover()
 {
     DroneConnection.command = "Neutral";
     DroneConnection.sendcommand();
 }
Ejemplo n.º 11
0
 public void button7_Click(object sender, EventArgs e)//Up
 {
     DroneConnection.command = "Up";
     DroneConnection.sendcommand();
 }
Ejemplo n.º 12
0
 public void Landing_Click(object sender, EventArgs e)
 {
     DroneConnection.command = "Land";
     DroneConnection.sendcommand();
 }
Ejemplo n.º 13
0
 public void Backwards_Click(object sender, EventArgs e)
 {
     DroneConnection.command = "Backward";
     DroneConnection.sendcommand();
 }
Ejemplo n.º 14
0
 public void Takeoff_Click(object sender, EventArgs e)
 {
     DroneConnection.command = "Takeoff";
     DroneConnection.sendcommand();
 }
Ejemplo n.º 15
0
 public void ClockwiseLeft_Click(object sender, EventArgs e)
 {
     DroneConnection.command = "TurnLeft";
     DroneConnection.sendcommand();
 }
Ejemplo n.º 16
0
 public void Down_Click(object sender, EventArgs e)
 {
     DroneConnection.command = "Down";
     DroneConnection.sendcommand();
 }
Ejemplo n.º 17
0
 public void button10_Click(object sender, EventArgs e)// ClockwiseRight
 {
     DroneConnection.command = "TurnRight";
     DroneConnection.sendcommand();
 }
Ejemplo n.º 18
0
 private void button1_Click(object sender, EventArgs e)
 {
     DroneConnection.closeconnection();
 }
Ejemplo n.º 19
0
 /*The below code sends commands to the server program made in node js.*/
 public void button1_Click(object sender, EventArgs e)// Forward
 {
     DroneConnection.command = "Forward";
     DroneConnection.sendcommand();
 }