Opc.Ua.Server.AggregateCalculator.Initialize C# (CSharp) Method

Initialize() protected method

Initializes the calculation stream.
protected Initialize ( NodeId aggregateId, System.DateTime startTime, System.DateTime endTime, double processingInterval, bool stepped, AggregateConfiguration configuration ) : void
aggregateId NodeId The aggregate function to apply.
startTime System.DateTime The start time.
endTime System.DateTime The end time.
processingInterval double The processing interval.
stepped bool Whether to use stepped interpolation.
configuration AggregateConfiguration The aggregate configuration.
return void
        protected void Initialize(
            NodeId aggregateId,
            DateTime startTime,
            DateTime endTime,
            double processingInterval,
            bool stepped,
            AggregateConfiguration configuration)
        {
            AggregateId = aggregateId;
            StartTime = startTime;
            EndTime = endTime;
            ProcessingInterval = processingInterval;
            Stepped = stepped;
            Configuration = configuration;
            TimeFlowsBackward = (endTime < startTime);

            if (processingInterval == 0)
            {
                if (endTime == DateTime.MinValue || startTime == DateTime.MinValue)
                {
                    throw new ArgumentException("Non-zero processingInterval required.", "processingInterval");
                }

                ProcessingInterval = Math.Abs((endTime - startTime).TotalMilliseconds);
            }

            m_values = new LinkedList<DataValue>();
        }
        #endregion