private void btnAdapterConfiguration_Click(object sender, EventArgs e) { if (cbAdapterType.SelectedIndex == (int)CANBusAdapter.COMBI) { // open the config screen for additional configuration of the adapter // which ADC channels mean what // use ADC 1-5 & assign symbolname, max & min value // use thermo & assign symbolname, max & min value frmCombiAdapterConfig combiconfig = new frmCombiAdapterConfig(); combiconfig.AppSettings = m_appSettings; if (combiconfig.ShowDialog() == DialogResult.OK) { DialogResult = DialogResult.None; // nothing really.. all is saved in appsettings already ... } } else if (cbAdapterType.SelectedIndex == (int)CANBusAdapter.ELM327 || cbAdapterType.SelectedIndex == (int)CANBusAdapter.JUST4TRIONIC) { frmComportSettings comportSel = new frmComportSettings(); comportSel.Baudrate = m_appSettings.Baudrate; if (comportSel.ShowDialog() == DialogResult.OK) { m_appSettings.Baudrate = comportSel.Baudrate; } DialogResult = DialogResult.None; } }
private void btnAdapterConfiguration_Click(object sender, EventArgs e) { if (cbAdapterType.SelectedIndex == (int)CANBusAdapter.COMBI) { // open the config screen for additional configuration of the adapter // which ADC channels mean what // use ADC 1-5 & assign symbolname, max & min value // use thermo & assign symbolname, max & min value frmCombiAdapterConfig combiconfig = new frmCombiAdapterConfig(); combiconfig.AppSettings = m_appSettings; if (combiconfig.ShowDialog() == DialogResult.OK) { DialogResult = DialogResult.None; // nothing really.. all is saved in appsettings already ... } } else if (cbAdapterType.SelectedIndex == (int)CANBusAdapter.ELM327 || cbAdapterType.SelectedIndex == (int)CANBusAdapter.JUST4TRIONIC) { frmComportSettings comportSel = new frmComportSettings(); comportSel.Baudrate = m_appSettings.Baudrate; if (comportSel.ShowDialog() == DialogResult.OK) { m_appSettings.Baudrate = comportSel.Baudrate; } DialogResult = DialogResult.None; } else if (cbAdapterType.SelectedIndex == (int)CANBusAdapter.MXWIFI) { frmWifiSettings comportSel = new frmWifiSettings(); comportSel.Port = m_appSettings.WifiPort; if (comportSel.ShowDialog() == DialogResult.OK) { m_appSettings.WifiPort = comportSel.Port; } DialogResult = DialogResult.None; } }