15 private void InitArduinoValues()
17 int[] allowedPorts = {300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 28800, 31250, 38400, 57600, 115200};
21 foreach (
int port
in allowedPorts)
23 this.comboBoxBaudRate.Items.Add(port);
25 if (this.configuration.Arduino.BaudRate == port)
26 this.comboBoxBaudRate.SelectedIndex = i;
30 this.textBoxPort.Text = this.configuration.Arduino.Port;
32 this.comboBoxBaudRate.SelectedIndexChanged += this.comboBoxBaudRate_SelectedIndexChanged;
42 private void comboBoxBaudRate_SelectedIndexChanged(
object sender, EventArgs e)
44 this.configuration.Arduino.BaudRate =
int.Parse(this.comboBoxBaudRate.Text);
49 private void buttonLoadArduinoDefaults_Click(
object sender, EventArgs e)
51 this.DetachArduinoEvents();
52 this.comboBoxBaudRate.Items.Clear();
53 string temp = this.configuration.Arduino.Port;
55 this.configuration.Arduino.
Port = temp;
56 this.InitArduinoValues();
59 private void DetachArduinoEvents()
61 this.comboBoxBaudRate.SelectedIndexChanged -= this.comboBoxBaudRate_SelectedIndexChanged;
string Port
Gets or sets the port.
static Arduino CreateDefaultArduinoSettings()
Creates the default arduino settings.
Configuration of arduino specific values
Class for accessing the configuration.