Пример #1
0
        private List <DataSourceClient.MonitoringRequest> CollectRequests(ServerSystemContext context, IList <IMonitoredItem> monitoredItems)
        {
            List <DataSourceClient.MonitoringRequest> requests = new List <DataSourceClient.MonitoringRequest>();

            for (int ii = 0; ii < monitoredItems.Count; ii++)
            {
                MonitoredItem monitoredItem = monitoredItems[ii] as MonitoredItem;

                if (monitoredItem != null)
                {
                    if (monitoredItem.AttributeId != Attributes.Value)
                    {
                        continue;
                    }

                    RemoteNode remoteNode = null;

                    if (m_remoteNodes.TryGetValue(monitoredItem.NodeId, out remoteNode))
                    {
                        DataSourceClient.MonitoringRequest request = new DataSourceClient.MonitoringRequest();
                        request.RemoteId      = remoteNode.RemoteId;
                        request.MonitoredItem = monitoredItem;
                        requests.Add(request);
                    }
                }
            }

            return(requests);
        }
Пример #2
0
        private List<DataSourceClient.MonitoringRequest> CollectRequests(ServerSystemContext context, IList<IMonitoredItem> monitoredItems)
        {
            List<DataSourceClient.MonitoringRequest> requests = new List<DataSourceClient.MonitoringRequest>();

            for (int ii = 0; ii < monitoredItems.Count; ii++)
            {
                MonitoredItem monitoredItem = monitoredItems[ii] as MonitoredItem;

                if (monitoredItem != null)
                {
                    if (monitoredItem.AttributeId != Attributes.Value)
                    {
                        continue;
                    }

                    RemoteNode remoteNode = null;

                    if (m_remoteNodes.TryGetValue(monitoredItem.NodeId, out remoteNode))
                    {
                        DataSourceClient.MonitoringRequest request = new DataSourceClient.MonitoringRequest();
                        request.RemoteId = remoteNode.RemoteId;
                        request.MonitoredItem = monitoredItem;
                        requests.Add(request);
                    }
                }
            }

            return requests;
        }