Пример #1
0
        private void loadValues()
        {
            string strRoutineName = "loadValues";

            try
            {
                IEC104Slave s104 = s104List.ElementAt(editIndex);
                if (s104 != null)
                {
                    ucs104.txtSlaveNum.Text         = s104.SlaveNum;
                    ucs104.cmbLocalIP.SelectedIndex = ucs104.cmbLocalIP.FindStringExact(s104.LocalIP);
                    ucs104.txtTCPPort.Text          = s104.TcpPort;
                    ucs104.txtRemoteIP.Text         = s104.RemoteIP;
                    //Namrata: 08/12/2017
                    ucs104.txtSecRemote.Text         = s104.SecRemoteIP;
                    ucs104.txtASDUaddress.Text       = s104.ASDUAddress;
                    ucs104.cmbASDUsize.SelectedIndex = ucs104.cmbASDUsize.FindStringExact(s104.ASDUSize);
                    ucs104.cmbIOASize.SelectedIndex  = ucs104.cmbIOASize.FindStringExact(s104.IOASize);
                    ucs104.cmbCOTsize.SelectedIndex  = ucs104.cmbCOTsize.FindStringExact(s104.COTSize);
                    ucs104.txtT0.Text              = s104.T0;
                    ucs104.txtT1.Text              = s104.T1;
                    ucs104.txtT2.Text              = s104.T2;
                    ucs104.txtT3.Text              = s104.T3;
                    ucs104.txtW.Text               = s104.W;
                    ucs104.txtK.Text               = s104.K;
                    ucs104.txtCyclicInterval.Text  = s104.CyclicInterval;
                    ucs104.txtEventQSize.Text      = s104.EventQSize;
                    ucs104.txtFirmwareVersion.Text = s104.AppFirmwareVersion;
                    ucs104.cmbDebug.SelectedIndex  = ucs104.cmbDebug.FindStringExact(s104.DEBUG);
                    ucs104.cmbEnable.DataSource    = Utils.dtNetworkConfig.Tables[0];//ucmbs.cmbLocalIP.SelectedIndex
                    ucs104.cmbEnable.DisplayMember = "Enable";
                    ucs104.cmbEnable.ValueMember   = "PortNum";
                    foreach (NetworkInterface ni in Utils.getOpenProPlusHandle().getNetworkConfiguration().getNetworkInterfaces())
                    {
                        if (ni.IP == ucs104.cmbLocalIP.Text && ni.Enable == "YES")
                        {
                            ucs104.CmbPortName.Text          = ni.PortName;
                            ucs104.CmbPortName.SelectedIndex = ucs104.cmbDebug.FindStringExact(s104.PortName);
                        }
                    }
                    if (s104.EventWithoutTime.ToLower() == "yes")
                    {
                        ucs104.chkEventWithoutTime.Checked = true;
                    }
                    else
                    {
                        ucs104.chkEventWithoutTime.Checked = false;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(strRoutineName + ": " + "Error: " + ex.Message.ToString(), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #2
0
        private void fillOptions()
        {
            string strRoutineName = "fillOptions";

            try
            {
                //Fill ASDU size...
                ucs104.cmbASDUsize.Items.Clear();
                foreach (String br in IEC104Slave.getASDUsizes())
                {
                    ucs104.cmbASDUsize.Items.Add(br.ToString());
                }
                ucs104.cmbASDUsize.SelectedIndex = 0;
                //Fill IOA size...
                ucs104.cmbIOASize.Items.Clear();
                foreach (String ioa in IEC104Slave.getIOAsizes())
                {
                    ucs104.cmbIOASize.Items.Add(ioa.ToString());
                }
                ucs104.cmbIOASize.SelectedIndex = 0;
                //Fill COT size...
                ucs104.cmbCOTsize.Items.Clear();
                foreach (String db in IEC104Slave.getCOTsizes())
                {
                    ucs104.cmbCOTsize.Items.Add(db.ToString());
                }
                ucs104.cmbCOTsize.SelectedIndex = 0;

                //Fill Debug levels...
                ucs104.cmbDebug.Items.Clear();
                for (int i = 1; i <= Globals.MAX_DEBUG_LEVEL; i++)
                {
                    ucs104.cmbDebug.Items.Add(i.ToString());
                }
                ucs104.cmbDebug.SelectedIndex = 0;
            }
            catch (Exception ex)
            {
                MessageBox.Show(strRoutineName + ": " + "Error: " + ex.Message.ToString(), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }