public WriteRegisterControl(ControlContext context, SerializableMap settings) { this.context = context; InitializeComponent(); numericUpDownSlaveAddress.Value = settings.GetNumber("slaveAddress", 0); numericUpDownRegisterAddress.Value = settings.GetNumber("startAddress", 0); numericUpDownRegisterValue.Value = settings.GetNumber("registerValue", 0); if (comboBoxFunctionCode.SelectedIndex < 0) { comboBoxFunctionCode.SelectedIndex = 0; } }
public ReadFloatControl(ControlContext context, SerializableMap settings) { this.context = context; InitializeComponent(); numericUpDownSlaveAddress.Value = settings.GetNumber("slaveAddress", 0); numericUpDownRegisterAddress.Value = settings.GetNumber("startAddress", 0); comboBoxFunctionCode.Text = settings.GetString("functionCode", "3 Holding 1234"); if (comboBoxFunctionCode.SelectedIndex < 0) { comboBoxFunctionCode.SelectedIndex = 0; } }