AFSDK Custom Data Reference

Discussion created by wpurrer on Jul 10, 2013
Latest reply on Aug 31, 2013 by Gael

Dear all


We want to use ower own Data Reference to display a live-preview of calculation-Results. Therefore we have developed a CalcEngine-Class which returns a List of AFValues. 


We now have a problem to display the preview in Processbook as elementrelative Trend. The Trend uses the GetValues-Method to retrieve the Data. When the trend is initialize the first time (GetData-Method of PB) we get the correct data. Unfortunately we have the problem with automatic refreshing (Refresh-Method of PB) which causes us double Data in the Details View for about the last third of Data. Every time the refresh is started it Adds some values and displays them even if the timestamps are equal (Please se attended screenshots).


Data when started first time:





Data after some minutes





The Get-Values-Method of our Data-Reference is very Simple:

public override AFValues GetValues(object context, AFTimeRange timeRange, int numberOfValues, AFAttributeList inputAttributes, AFValues[] inputValues)
                CalcEngineElement element = new CalcEngineElement(this.Attribute.Element);

                AFValues results = CalcEngine.Lib.CalcEngine.DoCalculation(element, timeRange.EndTime, true, timeRange.StartTime);

                if (results.Count > 0)
                    return results;
                    return null;         



What do aou think about this issue?