Exemplo n.º 1
0
        public static TIRAPTagT20Object CreateInstance(XmlNode node)
        {
            if (node.Name != "Row")
            {
                return(null);
            }

            TIRAPTagT20Object rlt = new TIRAPTagT20Object()
            {
                Ordinal       = Tools.ConvertToInt32(IRAPXMLUtils.GetXMLNodeAttributeValue(node, "Ordinal"), 0),
                T20LeafID     = Tools.ConvertToInt32(IRAPXMLUtils.GetXMLNodeAttributeValue(node, "T20LeafID"), 0),
                ParameterName = IRAPXMLUtils.GetXMLNodeAttributeValue(node, "ParameterName"),
                LowLimit      = Tools.ConvertToInt64(IRAPXMLUtils.GetXMLNodeAttributeValue(node, "LowLimit"), 0),
                Criterion     = IRAPXMLUtils.GetXMLNodeAttributeValue(node, "Criterion"),
                HighLimit     = Tools.ConvertToInt64(IRAPXMLUtils.GetXMLNodeAttributeValue(node, "HighLimit"), 0),
                Scale         = Tools.ConvertToInt32(IRAPXMLUtils.GetXMLNodeAttributeValue(node, "Scale"), 0),
                UnitOfMeasure = IRAPXMLUtils.GetXMLNodeAttributeValue(node, "UnitOfMeasure"),
                RecordingMode = Tools.ConvertToInt32(IRAPXMLUtils.GetXMLNodeAttributeValue(node, "RecordingMode"), 0),
                SamplingCycle = Tools.ConvertToInt32(IRAPXMLUtils.GetXMLNodeAttributeValue(node, "SamplingCycle"), 0),
                RTDBDSLinkID  = Tools.ConvertToInt32(IRAPXMLUtils.GetXMLNodeAttributeValue(node, "RTDBDSLinkID"), 0),
                RTDBTagName   = IRAPXMLUtils.GetXMLNodeAttributeValue(node, "RTDBTagName"),
                Reference     = Tools.ConvertToInt32(IRAPXMLUtils.GetXMLNodeAttributeValue(node, "Reference"), 0),
                StartPosition = Tools.ConvertToInt32(IRAPXMLUtils.GetXMLNodeAttributeValue(node, "StartPosition"), 0),
                EndPosition   = Tools.ConvertToInt32(IRAPXMLUtils.GetXMLNodeAttributeValue(node, "EndPosition"), 0),
            };

            return(rlt);
        }
Exemplo n.º 2
0
 public void Add(TIRAPTagT20Object item)
 {
     if (item != null)
     {
         items.Add(item);
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// 根据 XMLNode 创建 TIRAPOPCTag 实例
        /// </summary>
        /// <param name="node"></param>
        /// <returns></returns>
        public static TIRAPOPCTag CreateInstance(XmlNode node)
        {
            if (node.Name != "Tag")
            {
                return(null);
            }

            TIRAPOPCTag rlt = new TIRAPOPCTag();

            rlt.TagLeafID = Tools.ConvertToInt32(IRAPXMLUtils.GetXMLNodeAttributeValue(node, "TagLeafID"));
            rlt.TagName   = IRAPXMLUtils.GetXMLNodeAttributeValue(node, "TagName");
            rlt.TagType   = Tools.ConvertToInt32(IRAPXMLUtils.GetXMLNodeAttributeValue(node, "TagType"));

            rlt.TestItems.Clear();
            foreach (XmlNode child in node.ChildNodes)
            {
                TIRAPTagT20Object item = TIRAPTagT20Object.CreateInstance(child);
                if (item != null)
                {
                    rlt.TestItems.Add(item);
                }
            }

            return(rlt);
        }
Exemplo n.º 4
0
        public void Remove(TIRAPTagT20Object item)
        {
            bool successed = true;

            do
            {
                successed = items.Remove(item);
            } while (successed);
        }