Пример #1
0
            public void OnReadComplete(int transactionId, int groupId, int quality, int error, uint count, int[] clientIds, IntPtr values, short[] qualities, long[] timeStamps, int[] errors)
            {
                if (_group.ClientId != groupId)
                {
                    return;
                }

                _group._readCompleteHandlers?.Invoke(_group, new DataChangeEventArgs(
                                                         groupId,
                                                         transactionId,
                                                         quality,
                                                         error,
                                                         ItemValueReader.Read(clientIds, values, qualities, timeStamps, errors)));
            }
Пример #2
0
        public ItemValue[] SyncReadItems(DataSource source, int[] serverIds)
        {
            if (_group == null)
            {
                throw new ObjectDisposedException("Group");
            }
            if (serverIds == null)
            {
                throw new ArgumentNullException(nameof(serverIds));
            }
            if (serverIds.Length == 0)
            {
                return(new ItemValue[0]);
            }

            _syncIo.Read(source, (uint)serverIds.Length, serverIds, out var dataPtr, out var errorsPtr);

            return(ItemValueReader.Read(serverIds.Length, dataPtr, errorsPtr));
        }