Exemplo n.º 1
0
        private void loadValues()
        {
            string strRoutineName = "loadValues";

            try
            {
                IEC101Slave s101 = s101List.ElementAt(editIndex);
                if (s101 != null)
                {
                    ucs101.txtSlaveNum.Text             = s101.SlaveNum;
                    ucs101.cmbPortNo.SelectedIndex      = ucs101.cmbPortNo.FindStringExact(s101.PortNum);
                    ucs101.txtASDUaddress.Text          = s101.ASDUAddress;
                    ucs101.cmbASDUsize.SelectedIndex    = ucs101.cmbASDUsize.FindStringExact(s101.ASDUSize);
                    ucs101.cmbIOASize.SelectedIndex     = ucs101.cmbIOASize.FindStringExact(s101.IOASize);
                    ucs101.cmbCOTsize.SelectedIndex     = ucs101.cmbCOTsize.FindStringExact(s101.COTSize);
                    ucs101.txtCyclicInterval.Text       = s101.CyclicInterval;
                    ucs101.txtEventQSize.Text           = s101.EventQSize;
                    ucs101.txtFirmwareVersion.Text      = s101.AppFirmwareVersion;
                    ucs101.cmbDebug.SelectedIndex       = ucs101.cmbDebug.FindStringExact(s101.DEBUG);
                    ucs101.txtLinkAdd.Text              = s101.LinkAddress;
                    ucs101.CmbLinkAddSize.SelectedIndex = ucs101.CmbLinkAddSize.FindStringExact(s101.LinkAddressSize);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(strRoutineName + ": " + "Error: " + ex.Message.ToString(), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 2
0
        private void fillOptions()
        {
            string strRoutineName = "fillOptions";

            try
            {
                ucs101.cmbPortNo.Items.Clear();
                foreach (String br in IEC101Slave.getPortNo())
                {
                    ucs101.cmbPortNo.Items.Add(br.ToString());
                }
                ucs101.cmbPortNo.SelectedIndex = 0;

                //Fill ASDU size...
                ucs101.cmbASDUsize.Items.Clear();
                foreach (String br in IEC101Slave.getASDUsizes())
                {
                    ucs101.cmbASDUsize.Items.Add(br.ToString());
                }
                ucs101.cmbASDUsize.SelectedIndex = 0;

                //Fill IOA size...
                ucs101.cmbIOASize.Items.Clear();
                foreach (String ioa in IEC101Slave.getIOAsizes())
                {
                    ucs101.cmbIOASize.Items.Add(ioa.ToString());
                }
                ucs101.cmbIOASize.SelectedIndex = 0;

                //Fill COT size...
                ucs101.cmbCOTsize.Items.Clear();
                foreach (String db in IEC101Slave.getCOTsizes())
                {
                    ucs101.cmbCOTsize.Items.Add(db.ToString());
                }
                ucs101.cmbCOTsize.SelectedIndex = 0;

                //Fill Debug levels...
                ucs101.cmbDebug.Items.Clear();
                for (int i = 1; i <= Globals.MAX_DEBUG_LEVEL; i++)
                {
                    ucs101.cmbDebug.Items.Add(i.ToString());
                }
                ucs101.cmbDebug.SelectedIndex = 0;

                //Fill Link Address Sizes
                ucs101.CmbLinkAddSize.Items.Clear();
                foreach (String br in IEC101Slave.getLinkAddresssizes())
                {
                    ucs101.CmbLinkAddSize.Items.Add(br.ToString());
                }
                ucs101.CmbLinkAddSize.SelectedIndex = 0;
            }
            catch (Exception ex)
            {
                MessageBox.Show(strRoutineName + ": " + "Error: " + ex.Message.ToString(), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }