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 button1_Click(object sender, EventArgs e)
 {
     DroneConnection.closeconnection();
 }