예제 #1
0
        //Gets the array
        private void composeArray()
        {
            this.aFTimeRange = new AFTimeRange(this.startDateTime, this.endDateTime);
            //this.interval = new TimeSpan(0, 5, 0);
            this.span = new AFTimeSpan(this.samplingInterval);

            foreach (String windNodeTag in windNodePotentialTags)
            {
                PIPoint pi_point = PIPoint.FindPIPoint(this.piServer, windNodeTag);
                //tagList.Add(pi_point.RecordedValues(aFTimeRange, OSIsoft.AF.Data.AFBoundaryType.Inside, "", false).ToString());
                AFValues interpolated = pi_point.InterpolatedValues(this.aFTimeRange, this.span, "", false);

                foreach (AFValue value in interpolated)
                {
                    String[] temp = { windNodeTag, value.Value.ToString(), value.Timestamp.ToString() };
                    //Temp 0: Name of Wind Node Tag
                    //Temp 1: Value of the tag
                    //Temp 2: Time Stamp of the tag
                    Console.WriteLine(temp[0] + ", " + temp[1] + ", " + temp[2]);
                    this.valueList.Add(temp);
                }
                //this.rtu.setArray(this.valueList);
            }
            //this.rtu.sendToRTU();
        }