AnsweredAssumed Answered

AF SDK PiPoinList Summaries

Question asked by mdspath on Jul 9, 2015
Latest reply on Jul 9, 2015 by bshang

Hello:

I'm using the AF SDK to gather specific data from our server and starting to try to use the power of the the SDK to get me aggregated values in some continuous data. I looked into the AF SDK help to get an example and modify to suit but I'm running into issues. Attached is the snapshot of the screen in the IDE and below is the snippet from the help. I'm confused on the pointList.Summaries() method. I thought that pointList could be replaced by my PiPointList object I created above but it doesn't find any summary methods.

Can someone aide on what I'm missing here?

Thanks

 

          // **** copied code from the Help

            // Holds the results keyed on the associated point

            var resultsMap = new Dictionary<PIPoint, AFValues>();

 

 

            // Results should be sent back for 100 tags in each page.

            PIPagingConfiguration config = new PIPagingConfiguration(PIPageType.TagCount, 100);

 

 

            try

            {

                var listResults = pointList.Summaries(myTimeRange, span,

                   AFSummaryTypes.Average, AFCalculationBasis.TimeWeighted,

                   AFTimestampCalculation.Auto, config);

 

 

                foreach (IDictionary<AFSummaryTypes, AFValues> pointResults in listResults)

                {

                    // Get average values from the result dictionary

                    AFValues pointValues = pointResults[AFSummaryTypes.Average];

                    PIPoint point = pointValues.PIPoint;

 

 

                    // Map the results back to the point

                    resultsMap[point] = pointValues;

                }

            }

Attachments

Outcomes