Esempio n. 1
0
        private void BtnOpen_Click(object sender, EventArgs e)
        {
            try
            {
                SerialPortManager.OpenConnection(cboCom.SelectedItem.ToString());
                SerialPortManager.ReceiveDataFromGRBLDelegate delegateGrbl = new SerialPortManager.ReceiveDataFromGRBLDelegate(ShowResponse);
                SerialPortManager.ReceiveDataEvent += delegateGrbl;

                feed           = !string.IsNullOrEmpty(txtFeed.Text) ? double.Parse(txtFeed.Text) : 500;
                lblStatus.Text = "Idle";
                ManageInputs(SystemEvents.Open);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                lblStatus.Text = "Error";
            }
        }