Opc.Ua.Server.CustomNodeManager2.ReviseAggregateFilter C# (CSharp) Method

ReviseAggregateFilter() protected method

Revises an aggregate filter (may require knowledge of the variable being used).
protected ReviseAggregateFilter ( ServerSystemContext context, NodeHandle handle, double samplingInterval, uint queueSize, ServerAggregateFilter filterToUse ) : Opc.Ua.StatusCode
context ServerSystemContext The context.
handle NodeHandle The handle.
samplingInterval double The sampling interval for the monitored item.
queueSize uint The queue size for the monitored item.
filterToUse ServerAggregateFilter The filter to revise.
return Opc.Ua.StatusCode
        protected virtual StatusCode ReviseAggregateFilter(
            ServerSystemContext context,
            NodeHandle handle,
            double samplingInterval,
            uint queueSize,
            ServerAggregateFilter filterToUse)
        {
            if (filterToUse.ProcessingInterval < samplingInterval)
            {
                filterToUse.ProcessingInterval = samplingInterval;
            }

            if (filterToUse.ProcessingInterval < Server.AggregateManager.MinimumProcessingInterval)
            {
                filterToUse.ProcessingInterval = Server.AggregateManager.MinimumProcessingInterval;
            }

            DateTime earliestStartTime = DateTime.UtcNow.AddMilliseconds(-(queueSize - 1)*filterToUse.ProcessingInterval);

            if (earliestStartTime > filterToUse.StartTime)
            {
                filterToUse.StartTime = earliestStartTime;
            }

            if (filterToUse.AggregateConfiguration.UseServerCapabilitiesDefaults)
            {
                filterToUse.AggregateConfiguration = Server.AggregateManager.GetDefaultConfiguration(null);
            }

            return StatusCodes.Good;
        }
        #endregion
CustomNodeManager2