Ejemplo n.º 1
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            // изменение настроек в соответствии с элементами управления
            if (modified)
            {
                settings.Behavior = cbBehavior.ParseText <CommChannelLogic.OperatingBehaviors>();
                settings.ConnMode = (CommTcpChannelLogic.ConnectionModes)cbConnMode.GetSelectedItem(
                    new Dictionary <int, object>()
                {
                    { 0, CommTcpChannelLogic.ConnectionModes.Individual },
                    { 1, CommTcpChannelLogic.ConnectionModes.Shared }
                });
                settings.IpAddress = txtIpAddress.Text;
                settings.TcpPort   = Convert.ToInt32(numTcpPort.Value);

                settings.SetCommCnlParams(commCnlParams);
            }

            // проверка настроек
            if (settings.ConnMode == CommTcpChannelLogic.ConnectionModes.Shared &&
                string.IsNullOrWhiteSpace(settings.IpAddress))
            {
                ScadaUtils.ShowError(CommPhrases.IpAddressRequired);
            }
            else
            {
                DialogResult = DialogResult.OK;
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Установить параметры канала связи по умолчанию
 /// </summary>
 public override void SetCommCnlParamsToDefault(SortedList <string, string> commCnlParams)
 {
     CommTcpClientLogic.Settings settings = new CommTcpClientLogic.Settings();
     settings.SetCommCnlParams(commCnlParams);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Установить параметры канала связи по умолчанию
 /// </summary>
 public override void SetCommCnlParamsToDefault(SortedList<string, string> commCnlParams)
 {
     CommTcpClientLogic.Settings settings = new CommTcpClientLogic.Settings();
     settings.SetCommCnlParams(commCnlParams);
 }