Esempio n. 1
0
        private void loadValues()
        {
            string strRoutineName = "RCBConfiguration: loadValues";

            try
            {
                RCB rcb = rcbList.ElementAt(editIndex);
                if (rcb != null)
                {
                    ucrcb.comboBox1.SelectedIndex = ucrcb.comboBox1.FindStringExact(rcb.Dataset);
                    ucrcb.ipd.Text                    = rcb.IntegrityPeriod;
                    ucrcb.cRev.Text                   = rcb.ConfigRevision;
                    ucrcb.buffTime.Text               = rcb.BufferTime;
                    ucrcb.ChkListTriOptn.Text         = rcb.TriggerOptions1;
                    ucrcb.txtTriggerOptionBinary.Text = rcb.TriggerOptions;
                    ucrcb.cmbFC.SelectedIndex         = ucrcb.cmbFC.FindStringExact(rcb.FC); //Ajay: 04/08/2018
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(strRoutineName + ": " + "Error: " + ex.Message.ToString(), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 2
0
        private void loadValues()
        {
            string strRoutineName = "loadValues";

            try
            {
                RCB ai = aiList.ElementAt(editIndex);
                if (ai != null)
                {
                    ucai.comboBox1.SelectedIndex = ucai.comboBox1.FindStringExact(ai.Dataset);
                    ucai.ipd.Text            = ai.IntegrityPeriod;
                    ucai.cRev.Text           = ai.ConfigRevision;
                    ucai.buffTime.Text       = ai.BufferTime;
                    ucai.ChkListTriOptn.Text = ai.TriggerOptions1;
                    //ucai.textBox1.Text = ai.TriggerOptions1;
                    ucai.txtTriggerOptionBinary.Text = ai.TriggerOptions;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(strRoutineName + ": " + "Error: " + ex.Message.ToString(), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 3
0
        public void FillRCBList()
        {
            string strRoutineName = "RCBConfiguration: FillRCBList";

            try
            {
                List <KeyValuePair <string, string> > RcbData = Utils.getKeyValueAttributes(ucrcb.grpAO);
                List <string> tblNameList = Utils.dsRCBData.Tables.OfType <DataTable>().Select(tbl => tbl.TableName).ToList();
                string        RCBTable    = tblNameList.Where(x => x.Contains(Utils.strFrmOpenproplusTreeNode + "_" + Utils.UnitIDForIEC61850Client)).Select(x => x).FirstOrDefault();
                DataSet       ds          = Utils.DsRCB;
                foreach (DataTable table in ds.Tables)
                {
                    foreach (DataRow dr in table.Rows)
                    {
                        Address         = dr["Address"].ToString();
                        BufferTime      = dr["BufTime"].ToString();
                        configRevision  = dr["ConRev"].ToString();
                        DSAddress       = dr["DSAddress"].ToString();
                        IntegrityPeriod = dr["IntgPD"].ToString();
                        TriggerOption   = dr["trigOptNum"].ToString();

                        #region Set By deafult TriggerOption Values
                        //Namrata:04/04/2019
                        CkeckComboBox(ucrcb.comboBox1);
                        int trigger = 0;//Namrata:04/04/2019
                        if (CheckListChanged == false)
                        {
                            string strxyz = "";
                            for (int i = 0; i < ucrcb.ChkListTriOptn.Items.Count; i++)
                            {
                                if (ucrcb.ChkListTriOptn.GetItemChecked(i))
                                {
                                    trigger = trigger + (1 << (i + 1));
                                    strxyz += ucrcb.ChkListTriOptn.Items[i].ToString() + ",";
                                }
                            }
                            ucrcb.txtTriggerOptionBinary.Text = trigger.ToString(CultureInfo.InvariantCulture);
                            TriggerOption = ucrcb.txtTriggerOptionBinary.Text;
                        }
                        #endregion Set By deafult TriggerOption Values

                        if (Utils.dsRCBData.Tables.Count > 0)
                        {
                            if (RCBTable != null)
                            {
                                for (introw = 0; introw < Utils.dsRCBData.Tables[RCBTable].Rows.Count; introw++)
                                {
                                    for (intcolumns = 0; intcolumns < Utils.dsRCBData.Tables[RCBTable].Columns.Count; intcolumns++)
                                    {
                                        DatasetAddress = Utils.dsRCBData.Tables[RCBTable].Rows[introw].ItemArray[0].ToString();
                                        ied            = Utils.dsRCBData.Tables[RCBTable].Rows[introw].ItemArray[1].ToString();
                                        if ((DatasetAddress == Address) && (ied == IEDNo.ToString()))
                                        {
                                            RCB NewRCB = new RCB("RCB", RcbData, null, MasterTypes.IEC61850Client, masterNo, IEDNo);
                                            NewRCB.Address         = Address.ToString();
                                            NewRCB.BufferTime      = BufferTime.ToString();
                                            NewRCB.ConfigRevision  = configRevision.ToString();
                                            NewRCB.Dataset         = DSAddress.ToString();
                                            NewRCB.IntegrityPeriod = IntegrityPeriod.ToString();
                                            NewRCB.TriggerOptions  = TriggerOption.ToString();
                                            NewRCB.FC = "URCB"; //Ajay: 04/08/2018
                                            bool boolPresent = false;
                                            for (int i = 0; i < rcbList.Count; i++)
                                            {
                                                if (rcbList[i].Address == NewRCB.Address.ToString())
                                                {
                                                    boolPresent = true;
                                                }
                                            }
                                            if (!boolPresent)
                                            {
                                                if (NewRCB.Address != "")
                                                {
                                                    rcbList.Add(NewRCB);
                                                    refreshList();
                                                    break;
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                ucrcb.grpAO.Visible = false;
                mode      = Mode.NONE;
                editIndex = -1;
                int aa = ucrcb.lvRCBlist.Items.Count;
                ucrcb.lvRCBlist.View = View.Details;
                ucrcb.lvRCBlist.Show();
            }
            catch (Exception ex)
            {
                MessageBox.Show(strRoutineName + ": " + "Error: " + ex.Message.ToString(), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 4
0
        public void FillRCBList()
        {
            string strRoutineName = "FillRCBList";

            try
            {
                List <KeyValuePair <string, string> > RcbData = Utils.getKeyValueAttributes(ucai.grpAO);
                List <string> tblNameList = Utils.dsRCBData.Tables.OfType <DataTable>().Select(tbl => tbl.TableName).ToList();
                string        RCBTable    = tblNameList.Where(x => x.Contains(Utils.strFrmOpenproplusTreeNode + "_" + Utils.UnitIDForIEC61850Client)).Select(x => x).FirstOrDefault();
                DataSet       ds          = Utils.DsRCB;
                foreach (DataTable table in ds.Tables)
                {
                    foreach (DataRow dr in table.Rows)
                    {
                        Address         = dr["Address"].ToString();
                        BufferTime      = dr["BufTime"].ToString();
                        configRevision  = dr["ConRev"].ToString();
                        DSAddress       = dr["DSAddress"].ToString();
                        IntegrityPeriod = dr["IntgPD"].ToString();
                        TriggerOption   = dr["trigOptNum"].ToString();
                        if (Utils.dsRCBData.Tables.Count > 0)
                        {
                            if (RCBTable != null)
                            {
                                for (introw = 0; introw < Utils.dsRCBData.Tables[RCBTable].Rows.Count; introw++)
                                {
                                    for (intcolumns = 0; intcolumns < Utils.dsRCBData.Tables[RCBTable].Columns.Count; intcolumns++)
                                    {
                                        DatasetAddress = Utils.dsRCBData.Tables[RCBTable].Rows[introw].ItemArray[0].ToString();
                                        ied            = Utils.dsRCBData.Tables[RCBTable].Rows[introw].ItemArray[1].ToString();
                                        if ((DatasetAddress == Address) && (ied == IEDNo.ToString()))
                                        {
                                            RCB NewDO = new RCB("RCB", RcbData, null, MasterTypes.IEC61850Client, masterNo, IEDNo);
                                            NewDO.Address         = Address.ToString();
                                            NewDO.BufferTime      = BufferTime.ToString();
                                            NewDO.ConfigRevision  = configRevision.ToString();
                                            NewDO.Dataset         = DSAddress.ToString();
                                            NewDO.IntegrityPeriod = IntegrityPeriod.ToString();
                                            NewDO.TriggerOptions  = TriggerOption.ToString();
                                            bool boolPresent = false;
                                            for (int i = 0; i < aiList.Count; i++)
                                            {
                                                if (aiList[i].Address == NewDO.Address.ToString())
                                                {
                                                    boolPresent = true;
                                                }
                                            }
                                            if (!boolPresent)
                                            {
                                                if (NewDO.Address != "")
                                                {
                                                    aiList.Add(NewDO);
                                                    refreshList();
                                                    break;
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                ucai.grpAO.Visible = false;
                mode      = Mode.NONE;
                editIndex = -1;
                int aa = ucai.lvRCBlist.Items.Count;
                ucai.lvRCBlist.View = View.Details;
                ucai.lvRCBlist.Show();
            }
            catch (Exception ex)
            {
                MessageBox.Show(strRoutineName + ": " + "Error: " + ex.Message.ToString(), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }