Beispiel #1
0
 private void connectButton_Click(object sender, EventArgs e)
 {
     if (!comHandler.connected)
     {
         if (comHandler.GuiOpen(Properties.Settings.Default.ComPort))
         {
             connectButton.Text = "disconnect";
         }
     }
     else
     {
         comHandler.Close();
         connectButton.Text = "connect";
     }
 }
Beispiel #2
0
        private void connect_button_Click(object sender, EventArgs e)
        {
            if (!comHandler.connected)
            {
                //Console.WriteLine(port_comboBox.SelectedItem);

                /*
                 * comHandler.onInfoReceived = infoReceived;
                 * comHandler.onParametersReceived = parametersReceived;
                 * comHandler.onPrametersSaved = parametersSaved;
                 * comHandler.onPatchtableUpdated = patchtableUpdated;
                 * comHandler.onProgressChanged = progressChanged;
                 * comHandler.onCommunicationError = onCommunicationError;
                 */

                if (comHandler.GuiOpen(port_comboBox.SelectedItem.ToString()))
                {
                    Properties.Settings.Default.ComPort = port_comboBox.SelectedItem.ToString();
                    Properties.Settings.Default.Save();
                    port_status_textBox.Text = "connected";
                    connect_button.Text      = "disconnect";
                }

                return;
            }
            else
            {
                comHandler.Close();
                port_status_textBox.Text = "not connected";
                connect_button.Text      = "connect";
            }
        }