private void FrmCommSerialProps_Load(object sender, EventArgs e) { // перевод формы Localization.TranslateForm(this, "Scada.Comm.Channels.FrmCommSerialProps"); // инициализация настроек канала связи settings = new CommSerialLogic.Settings(); settings.Init(commCnlParams, false); // установка элементов управления в соответствии с параметрами канала связи cbPortName.Text = settings.PortName; cbBaudRate.Text = settings.BaudRate.ToString(); cbDataBits.Text = settings.DataBits.ToString(); cbParity.SelectItem(settings.Parity, new Dictionary <string, int>() { { "Even", 0 }, { "Odd", 1 }, { "None", 2 }, { "Mark", 3 }, { "Space", 4 } }); cbStopBits.SelectItem(settings.StopBits, new Dictionary <string, int>() { { "One", 0 }, { "OnePointFive", 1 }, { "Two", 2 } }); chkDtrEnable.Checked = settings.DtrEnable; chkRtsEnable.Checked = settings.RtsEnable; cbBehavior.Text = settings.Behavior.ToString(); modified = false; }
/// <summary> /// Получить информацию о свойствах канала связи /// </summary> public override string GetPropsInfo(SortedList <string, string> commCnlParams) { CommSerialLogic.Settings defSett = new CommSerialLogic.Settings(); return(BuildPropsInfo(commCnlParams, new string[] { "PortName", "BaudRate", "DataBits", "Parity", "StopBits", "DtrEnable", "RtsEnable", "Behavior" }, new object[] { defSett.PortName, defSett.BaudRate, defSett.DataBits, defSett.Parity, defSett.StopBits, defSett.DtrEnable, defSett.RtsEnable, defSett.Behavior })); }
private void FrmCommSerialProps_Load(object sender, EventArgs e) { // перевод формы Localization.TranslateForm(this, "Scada.Comm.Channels.FrmCommSerialProps"); // инициализация настроек канала связи settings = new CommSerialLogic.Settings(); settings.Init(commCnlParams, false); // установка элементов управления в соответствии с параметрами канала связи cbPortName.Text = settings.PortName; cbBaudRate.Text = settings.BaudRate.ToString(); cbDataBits.Text = settings.DataBits.ToString(); cbParity.SelectItem(settings.Parity, new Dictionary<string, int>() { { "Even", 0 }, { "Odd", 1 }, { "None", 2 }, { "Mark", 3 }, { "Space", 4 } }); cbStopBits.SelectItem(settings.StopBits, new Dictionary<string, int>() { { "One", 0 }, { "OnePointFive", 1 }, { "Two", 2 } }); chkDtrEnable.Checked = settings.DtrEnable; chkRtsEnable.Checked = settings.RtsEnable; cbBehavior.Text = settings.Behavior.ToString(); modified = false; }
/// <summary> /// Установить параметры канала связи по умолчанию /// </summary> public override void SetCommCnlParamsToDefault(SortedList <string, string> commCnlParams) { CommSerialLogic.Settings settings = new CommSerialLogic.Settings(); settings.SetCommCnlParams(commCnlParams); }
/// <summary> /// Установить параметры канала связи по умолчанию /// </summary> public override void SetCommCnlParamsToDefault(SortedList<string, string> commCnlParams) { CommSerialLogic.Settings settings = new CommSerialLogic.Settings(); settings.SetCommCnlParams(commCnlParams); }
/// <summary> /// Получить информацию о свойствах канала связи /// </summary> public override string GetPropsInfo(SortedList<string, string> commCnlParams) { CommSerialLogic.Settings defSett = new CommSerialLogic.Settings(); return BuildPropsInfo(commCnlParams, new string[] { "PortName", "BaudRate", "DataBits", "Parity", "StopBits", "DtrEnable", "RtsEnable", "Behavior" }, new object[] { defSett.PortName, defSett.BaudRate, defSett.DataBits, defSett.Parity, defSett.StopBits, defSett.DtrEnable, defSett.RtsEnable, defSett.Behavior }); }