Example #1
0
        /// <summary>
        /// Initializes <see cref="StateRecordSummary"/> from the specified <paramref name="buffer"/>.
        /// </summary>
        /// <param name="buffer">Binary image to be used for initializing <see cref="StateRecordSummary"/>.</param>
        /// <param name="startIndex">0-based starting index of initialization data in the <paramref name="buffer"/>.</param>
        /// <param name="length">Valid number of bytes in <paramref name="buffer"/> from <paramref name="startIndex"/>.</param>
        /// <returns>Number of bytes used from the <paramref name="buffer"/> for initializing <see cref="StateRecordSummary"/>.</returns>
        public int ParseBinaryImage(byte[] buffer, int startIndex, int length)
        {
            if (length >= FixedLength)
            {
                // Binary image has sufficient data.
                HistorianID = EndianOrder.LittleEndian.ToInt32(buffer, startIndex);
                CurrentData = new StateRecordDataPoint(HistorianID, buffer, startIndex + 4, length - 4);

                return FixedLength;
            }
            else
            {
                // Binary image does not have sufficient data.
                return 0;
            }
        }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="StateRecord"/> class.
 /// </summary>
 /// <param name="historianID">Historian identifier of <see cref="StateRecord"/>.</param>
 public StateRecord(int historianID)
 {
     m_historianID = historianID;
     m_archivedData = new StateRecordDataPoint(m_historianID);
     m_previousData = new StateRecordDataPoint(m_historianID);
     m_currentData = new StateRecordDataPoint(m_historianID);
     m_activeDataBlockIndex = -1;
     m_activeDataBlockSlot = 1;
 }