示例#1
0
        private void fillOptions()
        {
            string strRoutineName = "DNP3DNPSA:fillOptions";

            try
            {
                ucDNPSA.cmbHMACAlgo.Items.Clear();
                foreach (String ct in DNPSA.getHMACAlgo(SlaveTypes.DNP3SLAVE))
                {
                    ucDNPSA.cmbHMACAlgo.Items.Add(ct.ToString());
                }
                if (ucDNPSA.cmbHMACAlgo != null && ucDNPSA.cmbHMACAlgo.Items.Count > 0)
                {
                    ucDNPSA.cmbHMACAlgo.SelectedIndex = 0;
                }


                ucDNPSA.CmbAEC.Items.Clear();
                foreach (String ct in DNPSA.getAuthErrorEventClass(SlaveTypes.DNP3SLAVE))
                {
                    ucDNPSA.CmbAEC.Items.Add(ct.ToString());
                }
                if (ucDNPSA.CmbAEC != null && ucDNPSA.CmbAEC.Items.Count > 0)
                {
                    ucDNPSA.CmbAEC.SelectedIndex = 0;
                }
            }

            catch (Exception Ex)
            {
                MessageBox.Show(strRoutineName + ": " + "Error: " + Ex.Message.ToString(), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#2
0
        private void loadValues()
        {
            string strRoutineName = "DNP3DNPSA:loadValues";

            try
            {
                DNPSA domn = DnpsaList.ElementAt(editIndex);
                if (domn != null)
                {
                    ucDNPSA.txtART.Text               = domn.ReplyTOut;
                    ucDNPSA.txtKIT.Text               = domn.SSIVTime;
                    ucDNPSA.txtKIC.Text               = domn.SSIVCount;
                    ucDNPSA.txtAEC.Text               = domn.MaxAuthErrCount;
                    ucDNPSA.CmbAEC.SelectedIndex      = ucDNPSA.CmbAEC.FindStringExact(domn.AuthErrEventClass);
                    ucDNPSA.cmbHMACAlgo.SelectedIndex = ucDNPSA.cmbHMACAlgo.FindStringExact(domn.HMACAlgo);
                    if (domn.AggressiveM.ToLower() == "yes")
                    {
                        ucDNPSA.chkAggMode.Checked = true;
                    }
                    else
                    {
                        ucDNPSA.chkAggMode.Checked = true;
                    }

                    if (domn.AuthErrEvent.ToLower() == "yes")
                    {
                        ucDNPSA.ChkAEE.Checked = true;
                    }
                    else
                    {
                        ucDNPSA.ChkAEE.Checked = false;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(strRoutineName + ": " + "Error: " + ex.Message.ToString(), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }