コード例 #1
0
ファイル: GooseDataeEdit.cs プロジェクト: ttgzs/iedexplorer
 private NodeGData recursiveCheckIfDataPresent(NodeGData ngdcn, NodeGData ngd)
 {
     if (ngdcn.DataType == scsm_MMS_TypeEnum.structure)
     {
         if (ngdcn.GetChildNodes().Length > 0)
         {
             foreach (NodeGData ngdcncn in ngdcn.GetChildNodes())
             {
                 NodeGData ret = recursiveCheckIfDataPresent(ngdcncn, ngd);
                 if (ret != null)
                 {
                     return(ret);
                 }
             }
             return(null);
         }
         else
         {
             return(null);
         }
     }
     else
     {
         if (ngd.Tag == ngdcn.Tag)
         {
             return(ngdcn);
         }
         else
         {
             return(null);
         }
     }
 }
コード例 #2
0
ファイル: ExportGvlToXml.cs プロジェクト: ttgzs/iedexplorer
        private void recursiveReadGvl(NodeGData ngd, XElement el)
        {
            el.Add(new XElement("Data", new XAttribute("Type", ngd.DataType.ToString()), new XAttribute("Value", ngd.StringValue),
                                (ngd.Tag is Data) ? (((ngd.Tag as Data).Description != null && (ngd.Tag as Data).Description != "") ? new XAttribute("Desc", (ngd.Tag as Data).Description) : null) :
                                ((ngd.Description != null && ngd.Description != "") ? new XAttribute("Desc", ngd.Description) : null)));

            XElement eldn = el.Descendants().Last();

            if (ngd.GetChildNodes().Length > 0)
            {
                foreach (NodeGData ngdcn in ngd.GetChildNodes())
                {
                    recursiveReadGvl(ngdcn, eldn);
                }
            }
        }
コード例 #3
0
        private NodeGData recursiveFindNodeGData(NodeGData ngd, string name)
        {
            if (name == ngd.CommAddress.Domain.ToString() + ((ngd.CommAddress.Variable.ToString() != "") ? ("/" + ngd.CommAddress.Variable.ToString().Replace("$", "/")) : ""))
            {
                return(ngd);
            }

            if (ngd.GetChildNodes().Length > 0)
            {
                foreach (NodeGData ngdcn in ngd.GetChildNodes())
                {
                    NodeGData ret = recursiveFindNodeGData(ngdcn, name);

                    if (ret != null)
                    {
                        return(ret);
                    }
                }
            }

            return(null);
        }