コード例 #1
0
        //Arun Geo Thomas
        private void btnStopOpertion_Click(object sender, EventArgs e)
        {
            if (serialPortManager != null)
            {
                Object thisLock = new Object();
                lock (thisLock)
                {
                    readSerialPortData = false;
                }

                if (serialPortManager.CloseConnection())
                {
                    JSTimer.Stop();


                    lblSerialportMessages.Text = "Disconnected";
                    cbCOMPortsSelector.Enabled = true;
                    btnStartOperation.Enabled  = true;
                    serialPortManager          = null;
                }
                else
                {
                    lblSerialportMessages.Text = "Already Disconnected";
                }
            }
            else
            {
                lblSerialportMessages.Text = "No valid connection";
            }
            ClearUI();
        }
コード例 #2
0
ファイル: Main.cs プロジェクト: gmrodriguez12/cnc_sender
 private void BtnClose_Click(object sender, EventArgs e)
 {
     SerialPortManager.CloseConnection();
     ManageInputs(SystemEvents.Close);
 }