コード例 #1
0
 public override void write(ByteStream queue)
 {
     ObjectIdentifier.write(queue, 0);
     EventState.write(queue, 1);
     AcknowledgedTransitions.write(queue, 2);
     writeContextTag(queue, 3, true);
     EventTimeStamp1.write(queue);
     EventTimeStamp2.write(queue);
     EventTimeStamp3.write(queue);
     writeContextTag(queue, 3, false);
     NotifyType.write(queue, 4);
     EventEnable.write(queue, 5);
     writeContextTag(queue, 6, true);
     EventPriorities1.write(queue);
     EventPriorities2.write(queue);
     EventPriorities3.write(queue);
     writeContextTag(queue, 6, false);
 }
コード例 #2
0
ファイル: AI.cs プロジェクト: Namrata2392/OPP
        public XmlNode exportXMLnode()
        {
            XmlDocument   xmlDoc        = new XmlDocument();
            StringWriter  stringWriter  = new StringWriter();
            XmlTextWriter xmlTextWriter = new XmlTextWriter(stringWriter);
            XmlNode       rootNode      = null;

            if (isNodeComment)
            {
                rootNode = xmlDoc.CreateComment(comment);
                xmlDoc.AppendChild(rootNode);
                return(rootNode);
            }
            rootNode = xmlDoc.CreateElement(ainType.ToString());

            //Ajay: 01/11/2018 Commented - added attributes directly in arrAttributes Array
            #region MasterType IEC61850
            if (masterType == MasterTypes.IEC61850Client)
            {
                foreach (string attr in arrAttributes)
                {
                    XmlAttribute attrName = xmlDoc.CreateAttribute(attr);
                    attrName.Value = (string)this.GetType().GetProperty(attr).GetValue(this);
                    rootNode.Attributes.Append(attrName);
                }
                XmlAttribute attr1 = xmlDoc.CreateAttribute("ResponseType");
                attr1.Value = Iec61850ResponseType.ToString();
                rootNode.Attributes.Append(attr1);

                XmlAttribute attr2 = xmlDoc.CreateAttribute("Index");
                attr2.Value = Iec61850Index.ToString();
                rootNode.Attributes.Append(attr2);

                XmlAttribute attFC = xmlDoc.CreateAttribute("FC");
                attFC.Value = FC.ToString();
                rootNode.Attributes.Append(attFC);

                XmlAttribute attr3 = xmlDoc.CreateAttribute("SubIndex");
                attr3.Value = SubIndex.ToString();
                rootNode.Attributes.Append(attr3);

                XmlAttribute attr5 = xmlDoc.CreateAttribute("Multiplier");
                attr5.Value = Multiplier.ToString();
                rootNode.Attributes.Append(attr5);

                XmlAttribute attr6 = xmlDoc.CreateAttribute("Constant");
                attr6.Value = Constant.ToString();
                rootNode.Attributes.Append(attr6);

                //Ajay: 01/11/2018 EventEnable added
                XmlAttribute attr7 = xmlDoc.CreateAttribute("EventEnable");
                attr7.Value = EventEnable.ToString();
                rootNode.Attributes.Append(attr7);

                XmlAttribute attr8 = xmlDoc.CreateAttribute("Description");
                attr8.Value = Description.ToString();
                rootNode.Attributes.Append(attr8);
            }
            #endregion MasterType IEC61850

            #region MasterType IEC103,ADR,IEC101,MODBUS,Virtual, LoadProfile
            if ((masterType == MasterTypes.IEC103) || (masterType == MasterTypes.ADR) || (masterType == MasterTypes.IEC104) ||
                (masterType == MasterTypes.IEC101) || (masterType == MasterTypes.MODBUS) || (masterType == MasterTypes.Virtual) ||
                (masterType == MasterTypes.SPORT) || (masterType == MasterTypes.LoadProfile)) //Ajay: 31/07/2018 LoadProfile Added
            {
                foreach (string attr in arrAttributes)
                {
                    XmlAttribute attrName = xmlDoc.CreateAttribute(attr);
                    attrName.Value = (string)this.GetType().GetProperty(attr).GetValue(this);
                    rootNode.Attributes.Append(attrName);
                }
            }
            #endregion

            return(rootNode);
        }