/// <summary>
        /// Sends a ChangedData message to a consumer.
        /// </summary>
        /// <param name="startIndex">The start index.</param>
        /// <param name="endIndex">The end index.</param>
        /// <param name="uom">The unit of measure.</param>
        /// <param name="depthDatum">The depth datum.</param>
        /// <param name="dataItems">The data items.</param>
        /// <param name="messageFlag">The message flag.</param>
        /// <returns>The message identifier.</returns>
        public virtual long ChangedData(object startIndex, object endIndex, string uom, string depthDatum, IList <DataItem> dataItems, MessageFlags messageFlag = MessageFlags.MultiPart)
        {
            var header = CreateMessageHeader(Protocols.ChannelSubscribe, MessageTypes.ChannelSubscribe.ChangedData, messageFlags: messageFlag);

            var channelData = new ChangedData
            {
                ChangedInterval = new IndexInterval
                {
                    StartIndex = new IndexValue {
                        Item = startIndex
                    },
                    EndIndex = new IndexValue {
                        Item = endIndex
                    },
                    Uom        = uom,
                    DepthDatum = depthDatum
                },
                Data = dataItems
            };

            return(Session.SendMessage(header, channelData));
        }
Beispiel #2
0
 /// <summary>
 /// Handles the ChangedData message from a producer.
 /// </summary>
 /// <param name="header">The message header.</param>
 /// <param name="changedData">The ChangedData message.</param>
 protected virtual void HandleChangedData(IMessageHeader header, ChangedData changedData)
 {
     Notify(OnChangedData, header, changedData);
 }