コード例 #1
0
        /// <summary>
        /// Appends the channel data to the appropriate data block.
        /// </summary>
        /// <param name="data">The data items.</param>
        protected virtual void AppendChannelData(IList <DataItem> data)
        {
            foreach (var dataItem in data)
            {
                // Check to see if we are accepting data for this channel
                if (!_channelParentUris.ContainsKey(dataItem.ChannelId))
                {
                    continue;
                }

                var parentUri = _channelParentUris[dataItem.ChannelId];
                var dataBlock = _dataBlocks[parentUri];

                var channel = ChannelMetadataRecords.FirstOrDefault(x => x.ChannelId == dataItem.ChannelId);
                if (channel == null)
                {
                    continue;
                }

                var indexes = DownscaleIndexValues(channel.Indexes, dataItem.Indexes);
                dataBlock.Append(dataItem.ChannelId, indexes, dataItem.Value.Item);
            }
        }
コード例 #2
0
 /// <summary>
 /// Gets the channel metadata record for the specified channelId
 /// </summary>
 /// <param name="channelId">The channel identifier.</param>
 /// <returns>
 /// An <see cref="T:Energistics.Etp.Common.Datatypes.ChannelData.IChannelMetadataRecord" /> for the specified channelId
 /// </returns>
 public IChannelMetadataRecord GetChannelMetadataRecord(long channelId)
 {
     return(ChannelMetadataRecords.FirstOrDefault(x => x.ChannelId == channelId));
 }