Opc.Ua.Com.Client.ComHdaClientNodeManager.HistoryReadProcessed C# (CSharp) Method

HistoryReadProcessed() protected method

Reads processed history data.
protected HistoryReadProcessed ( ServerSystemContext context, ReadProcessedDetails details, TimestampsToReturn timestampsToReturn, IList nodesToRead, IList results, IList errors, List nodesToProcess, NodeState>.IDictionary cache ) : void
context Opc.Ua.Server.ServerSystemContext
details ReadProcessedDetails
timestampsToReturn TimestampsToReturn
nodesToRead IList
results IList
errors IList
nodesToProcess List
cache NodeState>.IDictionary
return void
        protected override void HistoryReadProcessed(
            ServerSystemContext context, 
            ReadProcessedDetails details,
            TimestampsToReturn timestampsToReturn, 
            IList<HistoryReadValueId> nodesToRead,
            IList<HistoryReadResult> results,
            IList<ServiceResult> errors,
            List<NodeHandle> nodesToProcess, 
            IDictionary<NodeId, NodeState> cache)
        {
            ComHdaClientManager system = (ComHdaClientManager)this.SystemContext.SystemHandle;
            ComHdaClient client = (ComHdaClient)system.SelectClient((ServerSystemContext)SystemContext, false);

            for (int ii = 0; ii < nodesToProcess.Count; ii++)
            {
                NodeHandle handle = nodesToProcess[ii];
                HistoryReadValueId nodeToRead = nodesToRead[handle.Index];
                HistoryReadResult result = results[handle.Index];
                NodeId aggregateId = details.AggregateType[handle.Index];

                // check if the node id has been parsed.
                HdaParsedNodeId parsedNodeId = handle.ParsedNodeId as HdaParsedNodeId;

                if (parsedNodeId == null)
                {
                    errors[handle.Index] = StatusCodes.BadNodeIdInvalid;
                    continue;
                }

                // validate the aggregate.
                uint hdaAggregateId = HdaModelUtils.HdaAggregateToUaAggregate(aggregateId, NamespaceIndex);

                if (hdaAggregateId == 0)
                {
                    errors[handle.Index] = StatusCodes.BadAggregateNotSupported;
                    continue;
                }
                
                // read the history of an item.
                if (parsedNodeId.RootType == HdaModelUtils.HdaItem)
                {
                    errors[handle.Index] = HistoryReadProcessedItem(
                        context,
                        client,
                        details,
                        timestampsToReturn,
                        hdaAggregateId,
                        nodeToRead,
                        parsedNodeId,
                        result);

                    continue;
                }

                errors[handle.Index] = StatusCodes.BadHistoryOperationUnsupported;
            }
        }