private void e_ToolStripMenuItemportSerie_Click(object sender, EventArgs e) { formParamSerie fPS = new formParamSerie(ref _serial); if (fPS.ShowDialog() == DialogResult.OK) { _serial = new classSerial(_serial._ParamSerial); m_serialConnect(); } }
public formParamSerie(ref classSerial serial) { InitializeComponent(); _serial = serial; cBPortName.Items.AddRange(SerialPort.GetPortNames()); cBPortName.Text = _serial.PortName; cBBaudRate.Items.AddRange(new string[] { "2400", "9600", "14400", "19200", "38400", "57600", "115200" }); cBBaudRate.Text = _serial._ParamSerial.BaudRate.ToString(); cBDataBits.Items.AddRange(new string[] { "4", "5", "6", "7", "8" }); cBDataBits.Text = _serial._ParamSerial.DataBits.ToString(); cBParity.Items.AddRange(Enum.GetNames(typeof(Parity))); cBParity.Text = _serial._ParamSerial.Parity.ToString(); cBStopBit.Items.AddRange(Enum.GetNames(typeof(StopBits))); cBStopBit.Text = _serial._ParamSerial.StopBit.ToString(); }
public formMain() { InitializeComponent(); paramApplication.setFileName("parametres"); _serial = new classSerial(paramApplication.LoadFromXML <classParamSerial> (new classParamSerial())); if (_serial._ParamSerial == null) { _serial = new classSerial(new classParamSerial { PortName = "COM3", BaudRate = 9600, Parity = System.IO.Ports.Parity.None, DataBits = 8, StopBit = System.IO.Ports.StopBits.One }); } ToolStripMenuItemportSerie.Enabled = true; }
public formMain() { InitializeComponent(); paramApplication.setFileName("parametres"); _serial = new classSerial(paramApplication.LoadFromXML<classParamSerial> ( new classParamSerial())); if (_serial._ParamSerial == null) { _serial = new classSerial(new classParamSerial { PortName = "COM3", BaudRate = 9600, Parity = System.IO.Ports.Parity.None, DataBits = 8, StopBit = System.IO.Ports.StopBits.One }); } ToolStripMenuItemportSerie.Enabled = true; }