/// <summary> /// 关闭串口 /// </summary> public void ClosePort() { if (!String.IsNullOrEmpty(f.PortID.Text)) { if (MyModel.ClosePort(f.PortID.Text, f)) { MyView.FlushListBox(ref MyModel); MyView.FlushX(false); } else { MessageBox.Show("Can not close port", "Error"); } } else { MessageBox.Show("Add PortID to specific", "Inform"); } }
/// <summary> /// 打开串口 /// </summary> public void OpenPort() { //String PortID = f.PortID.Text; if (!String.IsNullOrEmpty(f.PortID.Text)) { if (MyModel.OpenPort(f.PortID.Text, f)) { MyView.FlushListBox(ref MyModel); MyView.FlushX(true); } else { MessageBox.Show("Flush error", "Error"); } } else { MessageBox.Show("Add PortID to specific", "Inform"); } }
/// <summary> /// 激活串口 /// </summary> public void ActivePort() { MyView.FlushX(false); }