public void parseMCNode(XmlNode mNode, Dictionary <string, TreeNode> treeDicts)
        {
            string strRoutineName = "parseMCNode";

            try
            {
                //First set root node name...
                rnName = mNode.Name;

                //tn.Nodes.Clear();
                foreach (XmlNode node in mNode)
                {
                    //Namrata:31/5/2017
                    if (node.Name == "ADRGroup")
                    {
                        adrgroup.parseIECGNode(node, treeDicts["ADRGroup"]);
                    }
                    if (node.Name == "IEC101Group")
                    {
                        iec101Grp.parseIECGNode(node, treeDicts["IEC101Group"]);
                    }
                    else if (node.Name == "IEC103Group")
                    {
                        iecGrp.parseIECGNode(node, treeDicts["IEC103Group"]);
                    }
                    else if (node.Name == "MODBUSGroup")
                    {
                        mbGrp.parseMBGNode(node, treeDicts["MODBUSGroup"]);
                    }
                    else if (node.Name == "IEC61850ClientGroup")
                    {
                        server61850.parseMBGNode(node, treeDicts["IEC61850ClientGroup"]); //61850Group
                    }
                    else if (node.Name == "PLUGroup")
                    {
                        plugroup.parseMBGNode(node, treeDicts["PLUGroup"]); //61850Group
                    }
                    else if (node.Name == "VirtualGroup")
                    {
                        vGrp.parseVGNode(node /*, treeDicts["VirtualGroup"] */);//TreeNode not needed as already sent...
                    }
                    else
                    {
                        Console.WriteLine("***** MasterConfiguration: Node '{0}' not supported!!!", node.Name);
                    }
                }
                refreshList();
            }
            catch (Exception ex)
            {
                MessageBox.Show(strRoutineName + ": " + "Error: " + ex.Message.ToString(), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 2
0
        public void parseMCNode(XmlNode mNode, Dictionary <string, TreeNode> treeDicts)
        {
            string strRoutineName = "parseMCNode";

            try
            {
                //First set root node name...
                rnName = mNode.Name;
                //tn.Nodes.Clear();

                foreach (XmlNode node in mNode)
                {
                    //Namrata:31/5/2017
                    if (node.Name == "ADRGroup" && treeDicts.Keys.Contains("ADRGroup"))
                    {
                        //Task thDetails = new Task(() => adrgroup.parseIECGNode(node, treeDicts["ADRGroup"]));
                        //thDetails.Start();
                        adrgroup.parseIECGNode(node, treeDicts["ADRGroup"]);
                    }
                    else if (node.Name == "IEC101Group" && treeDicts.Keys.Contains("IEC101Group"))
                    {
                        //Task thDetails = new Task(() => iec101Grp.parseIECGNode(node, treeDicts["IEC101Group"]));
                        //thDetails.Start();
                        iec101Grp.parseIECGNode(node, treeDicts["IEC101Group"]);
                    }
                    else if (node.Name == "IEC103Group" && treeDicts.Keys.Contains("IEC103Group"))
                    {
                        //Task thDetails = new Task(() => iec103Grp.parseIECGNode(node, treeDicts["IEC103Group"]));
                        //thDetails.Start();
                        iec103Grp.parseIECGNode(node, treeDicts["IEC103Group"]);
                    }
                    else if (node.Name == "MODBUSGroup" && treeDicts.Keys.Contains("MODBUSGroup"))
                    {
                        //Task thDetails = new Task(() => mbGrp.parseMBGNode(node, treeDicts["MODBUSGroup"]));
                        //thDetails.Start();
                        mbGrp.parseMBGNode(node, treeDicts["MODBUSGroup"]);
                    }
                    else if (node.Name == "IEC61850ClientGroup" && treeDicts.Keys.Contains("IEC61850ClientGroup"))
                    {
                        //Task thDetails = new Task(() => server61850.parseMBGNode(node, treeDicts["IEC61850ClientGroup"]));
                        //thDetails.Start();
                        server61850.parseMBGNode(node, treeDicts["IEC61850ClientGroup"]); //61850Group
                    }
                    //Namrata:17/05/2018
                    //else if (node.Name == "IEC104MasterGroup") //Ajay: 23/11/2018 Commented
                    else if (node.Name == "IEC104MasterGroup" && treeDicts.Keys.Contains("IEC104MasterGroup"))
                    {
                        //Task thDetails = new Task(() => iec104Grp.parseIECGNode(node, treeDicts["IEC104MasterGroup"]));
                        //thDetails.Start();
                        iec104Grp.parseIECGNode(node, treeDicts["IEC104MasterGroup"]);
                    }
                    //else if (node.Name == "SPORTGroup") //Ajay: 23/11/2018 Commented
                    else if (node.Name == "SPORTGroup" && treeDicts.Keys.Contains("SPORTGroup"))
                    {
                        //Task thDetails = new Task(() => Sport.parseIECGNode(node, treeDicts["SPORTGroup"]));
                        //thDetails.Start();
                        Sport.parseIECGNode(node, treeDicts["SPORTGroup"]); //SPORTGroup
                    }
                    //else if (node.Name == "VirtualGroup") //Ajay: 23/11/2018 Commented
                    else if (node.Name == "VirtualGroup" && treeDicts.Keys.Contains("VirtualGroup"))
                    {
                        //Task thDetails = new Task(() => vGrp.parseVGNode(node));
                        //thDetails.Start();
                        vGrp.parseVGNode(node /*, treeDicts["VirtualGroup"] */);//TreeNode not needed as already sent...
                    }
                    //Ajay: 31/07/2018
                    //else if (node.Name == "LoadProfileGroup") //Ajay: 23/11/2018 Commented
                    else if (node.Name == "LoadProfileGroup" && treeDicts.Keys.Contains("LoadProfileGroup"))
                    {
                        //Task thDetails = new Task(() => LoadProfileGrp.parseMBGNode(node, treeDicts["LoadProfileGroup"]));
                        //thDetails.Start();
                        LoadProfileGrp.parseMBGNode(node, treeDicts["LoadProfileGroup"]);//TreeNode not needed as already sent...
                    }
                    else
                    {
                    }
                }
                refreshList();
            }
            catch (Exception ex)
            {
                MessageBox.Show(strRoutineName + ": " + "Error: " + ex.Message.ToString(), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }