Пример #1
0
 private void disconnectButton_Click(object sender, EventArgs e)
 {
     readTimer.Stop();
     messenger.Disconnect();
     UpdateButtonsAndConnectionInfo();
     UpdateButtonsAndConnectionInfo2();
 }
Пример #2
0
        private void disconnectButton_Click(object sender, EventArgs e)
        {
            // Disconnect from the Brick
            messenger.Disconnect();

            updateFormGUI();
        }
 private void btnDisconnect_Click(object sender, EventArgs e)
 {
     // Disconnect from the Brick
     messenger.Disconnect();
     isConnected = false;
     UpdateFormGUI();
 }
Пример #4
0
 private void btnConnectBouncerA_Click(object sender, EventArgs e)
 {
     if (btnConnectBouncerA.Text == "Connect")
     {
         //String port = cbbComPorts.Text.Substring(0,cbbComPorts.Text.IndexOf(' '));
         String port = cbbBouncerAComs.Text;
         if (bouncerAMessenger.Connect(port))
         {
             UpdateButtonsAndConnectionInfo();
             lbLog.Items.Clear();
             messageTimer.Start();
         }
         else
         {
             MessageBox.Show("Failed to connect to serial port '" + port + "'.\n"
                             + "Is your EV3 connected to that serial port? Or is it using another one?");
         }
     }
     else
     {
         //messageReceiveTimer.Stop();
         bouncerAMessenger.Disconnect();
         UpdateButtonsAndConnectionInfo();
     }
 }
Пример #5
0
        private void Pong_FormClosed(object sender, FormClosedEventArgs e)
        {
            ev3Messenger1.Disconnect();
            ev3Messenger2.Disconnect();
            Form Menu = new MainMenu();

            Menu.Show();
        }
Пример #6
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (!ev3Messenger.IsConnected)
     {
         ev3Messenger.Connect(comboBox1.Text.ToUpper());
         flowLayoutPanel1.BackColor = Color.Green;
     }
     else
     {
         ev3Messenger.Disconnect();
         flowLayoutPanel1.BackColor = Color.Red;
     }
 }
Пример #7
0
 private void dissconnectBtn_Click(object sender, EventArgs e)
 {
     messenger.Disconnect();
     updateFormGUI();
 }
Пример #8
0
 private void disconnectButton_Click(object sender, EventArgs e)
 {
     messenger.Disconnect();
     connectButton.BackColor = Color.SpringGreen;
     updateFormGUI();
 }
 public static void Disconnect()
 {
     messenger.Disconnect();
 }