Esempio n. 1
0
        public PIPointStepAttribute(string piPointName, string piServerName)
        {
            FindPIPoint findPIPoint = new FindPIPoint(piPointName, piServerName);
            PIPoint     piPoint     = findPIPoint.piPoint;

            piPoint.LoadAttributes(PICommonPointAttributes.Step);

            object step = piPoint.GetAttribute(PICommonPointAttributes.Step);

            if (Convert.ToInt32(step) == 1)
            {
                isStep = true;
            }
            else
            {
                isStep = false;
            }
        }
Esempio n. 2
0
        private AFValue Calculate(AFTime time, AFAttributeList inputAttributes, AFValues inputValues)
        {
            if (time == null) {
                throw new ArgumentException("No timestamp");
            }

            if (inputAttributes == null || inputAttributes.Count == 0) {
                throw new ArgumentException("No input attributes");
            }

            try {
                PIPoint tag = inputAttributes[0].PIPoint;
                if (tag == null) {
                    throw new ArgumentException("No PI point");
                }

                tag.LoadAttributes(PropertyName);
                object result = tag.GetAttribute(PropertyName);

                return new AFValue(base.Attribute, result, time, Attribute.DefaultUOM);
            } catch {
                throw new ArgumentException("Failed extracting tag property");
            }
        }