Esempio n. 1
0
		private void buttonPortSetup_Click(object sender, EventArgs e)
		{
			using (Common.Controls.SerialPortConfig serialPortConfig = new Common.Controls.SerialPortConfig(_port)) {
				if (serialPortConfig.ShowDialog() == DialogResult.OK) {
					_port = serialPortConfig.SelectedPort;
				}
			}
		}
Esempio n. 2
0
 private void buttonPortSetup_Click(object sender, EventArgs e)
 {
     using (Common.Controls.SerialPortConfig serialPortConfig = new Common.Controls.SerialPortConfig(_port)) {
         if (serialPortConfig.ShowDialog() == DialogResult.OK)
         {
             _port = serialPortConfig.SelectedPort;
         }
     }
 }
Esempio n. 3
0
		private void buttonPortSetup_Click(object sender, EventArgs e)
		{
			using (Common.Controls.SerialPortConfig serialPortConfig = new Common.Controls.SerialPortConfig(_serialPort)) {
				if (serialPortConfig.ShowDialog() == DialogResult.OK) {
					_serialPort = serialPortConfig.SelectedPort;
					buttonOK.Enabled = true;
					updateSettingLabel();
				}
			}
		}
Esempio n. 4
0
 private void buttonSerialSetup_Click(object sender, EventArgs e)
 {
     using (Common.Controls.SerialPortConfig serialSetupDialog = new Common.Controls.SerialPortConfig(_serialPort)) {
         if (serialSetupDialog.ShowDialog() == DialogResult.OK)
         {
             _serialPort = serialSetupDialog.SelectedPort;
             updateSettingLabel();
         }
     }
 }
Esempio n. 5
0
 private void btnPortSetup_Click(object sender, EventArgs e)
 {
     using (Common.Controls.SerialPortConfig serialPortConfig = new Common.Controls.SerialPortConfig(Port)) {
         if (serialPortConfig.ShowDialog() == DialogResult.OK)
         {
             Port            = serialPortConfig.SelectedPort;
             btnOkay.Enabled = true;
             updateSettingLabel();
         }
     }
 }
Esempio n. 6
0
 public override bool Setup()
 {
     using(SerialPortConfig serialPortConfig = new SerialPortConfig(_port, allowBaudEdit: false)) {
         if(serialPortConfig.ShowDialog() == DialogResult.OK) {
             SerialPort port = serialPortConfig.SelectedPort;
             if(port != null) {
                 _data.PortName = port.PortName;
                 _data.BaudRate = port.BaudRate;
                 _data.DataBits = port.DataBits;
                 _data.Parity = port.Parity;
                 _data.StopBits = port.StopBits;
                 _UpdateFromData();
                 return true;
             }
         }
     }
     return false;
 }
Esempio n. 7
0
        public override bool Setup()
        {
            using (var portConfig = new SerialPortConfig(this._serialPort)) {
                if (portConfig.ShowDialog() == DialogResult.OK) {
                    this._serialPort = portConfig.SelectedPort;
                    if (_serialPort != null) {
                        this._serialPort.Handshake = Handshake.None;
                        this._serialPort.Encoding = Encoding.UTF8;

                        // Write back to setup
                        var data = GetModuleData();
                        data.PortName = _serialPort.PortName;
                        data.BaudRate = _serialPort.BaudRate;
                        data.Partity = _serialPort.Parity;
                        data.DataBits = _serialPort.DataBits;
                        data.StopBits = _serialPort.StopBits;
                        return true;
                    }
                }

                return false;
            }
        }