Exemple #1
0
        public TagInfoExpr(XElement element, TagModeEnum mode, Report report)
            : base(element, mode, report)
        {
            XAttribute exprAttr = element.Attribute("expr");

            XAttribute sampleTypeAttr = element.Attribute("sampleType");
            String sampleTypeStr = sampleTypeAttr != null ? sampleTypeAttr.Value : "stInterval";
            TagSampleType = (PISDK.SampleTypeConstants)Enum.Parse(typeof(PISDK.SampleTypeConstants), sampleTypeStr, true);

            TagSampleInterval = element.Attribute("sampleInterval") != null ? element.Attribute("sampleInterval").Value : "1m";

            this.Expr = exprAttr != null ? report.processReplaceString(exprAttr.Value) : "0";
            //this.Expr = "'sinusoid'*'sinusoidu'";
        }
Exemple #2
0
        public TagInfoTag(XElement element, TagModeEnum mode, Report report)
            : base(element,mode,report)
        {
            XAttribute tagNameAttr = element.Attribute("tagName");

            this.TagName = tagNameAttr != null ? report.processReplaceString(tagNameAttr.Value) : "NO_TAG_NAME";

            if ((this.AutoID) && (!report.TagsIDS.Values.Contains(this.TagName))) {
                this.ID = TagName;
            }

            try {
                Point = server.PIPoints[TagName];
                if (this.AutoTitle) {
                    this.Title = Point.Name;
                }
            } catch (Exception e){
                Logger.error(String.Format("Не найден тэг {0}, Исключение: {1}",TagName,e.Message));
                Point = null;
                //Point=server.PIPoints["sinusoid"];
            }
        }