Beispiel #1
0
        private void disconnect()
        {
            COMAliveTimer.Stop();
            readDone = true;
            if (serialPort1.IsOpen)
            {
                sendEndReportingCommand();  // end reporting raw values !

                portStatus.Text = "Disconnected";
                addToLog("Port " + portComboBox.Text + " is now disconnected");

                portStatus.ForeColor = Color.SlateGray;

                try
                {
                    slotNames.Items.Clear();
                    serialPort1.Close();
                }
                catch (Exception ex)
                {
                    addToLog("Error disconnecting COM Port");
                }
            }
            fabiOnline = 0;
        }
Beispiel #2
0
        public void gotID(String newLine)
        {
            addToLog("Fabi detected:" + newLine);
            fabiOnline = 1;
            slotNames.Items.Clear();
            sendStartReportingCommand();   // start reporting raw values !

            COMAliveTimer.Enabled = true;
            COMAliveTimer.Start();

            DialogResult dialogResult = MessageBox.Show("Detected " + newLine + "\nDo you want to load the slots and settings which are stored in the Fabi device ?", "Load Settings ?", MessageBoxButtons.YesNo);

            if (dialogResult == DialogResult.Yes)
            {
                loadSettingsFromFabi();
            }
        }