/// <summary> /// Gets the size of the table /// </summary> /// <param name="table2379">The Actual FW Download Log Table for the current meter.</param> /// <param name="table0">That Table 0 object for the current meter</param> /// <returns>The size of the table in bytes</returns> // Revision History // MM/DD/YY who Version Issue# Description // -------- --- ------- ------ ------------------------------------------- // 08/08/11 MMD Created // 05/07/15 jrf 4.20.05 583950 Updated to retrieve the FWDL event log entry count from // the Actual FW Download Log Table (2379) private static uint GetTableSize(OpenWayMFGTable2379 table2379, CTable00 table0) { uint TableSize = 11; if (table2379 != null) { TableSize += table2379.FWDownloadEntryCount * FWDownloadLogEvent.GetEntrySize(table2379, table0.LTIMESize); } return(TableSize); }
/// <summary> /// Parses the data for the table. /// </summary> // Revision History // MM/DD/YY who Version Issue# Description // -------- --- ------- ------ ------------------------------------------- // 08/08/11 MMD Created private void ParseData() { m_LogFlags = m_Reader.ReadByte(); m_NumValidEntries = m_Reader.ReadUInt16(); m_LastEntryIndex = m_Reader.ReadUInt16(); m_LastEntrySequenceNumber = m_Reader.ReadUInt32(); m_NumUnreadEntries = m_Reader.ReadUInt16(); m_Events = new List <FWDownloadLogEvent>(); for (int Entry = 0; Entry < m_NumValidEntries; Entry++) { DateTime TimeOccurred = DateTime.MinValue; ushort EventNumber = 0; ushort SequenceNumber = 0; ushort UserID; ushort EventID; uint ImageCRC; byte[] ImageHash; byte[] ImageVersionCurrent; byte[] ImageVersionPrevious; byte[] ArgumentData; FWDownloadLogEvent CurrentEntry = null; if (m_Table2379.IsLoggingDateAndTime) { TimeOccurred = m_Reader.ReadLTIME((PSEMBinaryReader.TM_FORMAT)m_Table0.TimeFormat); } if (m_Table2379.IsLoggingEventNumber) { EventNumber = m_Reader.ReadUInt16(); } if (m_Table2379.IsLoggingSequenceNumber) { SequenceNumber = m_Reader.ReadUInt16(); } UserID = m_Reader.ReadUInt16(); EventID = m_Reader.ReadUInt16(); ImageVersionCurrent = m_Reader.ReadBytes(3); ImageVersionPrevious = m_Reader.ReadBytes(3); ImageCRC = m_Reader.ReadUInt32(); ImageHash = m_Reader.ReadBytes(32); ArgumentData = m_Reader.ReadBytes(m_Table2379.FWDownloadArgumentDataLength); CurrentEntry = FWDownloadLogEvent.Create(EventID); CurrentEntry.TimeFormat = (PSEMBinaryReader.TM_FORMAT)m_Table0.TimeFormat; CurrentEntry.TimeOccurred = TimeOccurred; CurrentEntry.EventNumber = EventNumber; CurrentEntry.SequenceNumber = SequenceNumber; CurrentEntry.UserID = UserID; CurrentEntry.ImageCRC = ImageCRC; CurrentEntry.ImageHash = ImageHash; CurrentEntry.ImageVersionCurrent = ImageVersionCurrent; CurrentEntry.ImageVersionPrevious = ImageVersionPrevious; CurrentEntry.Argument = ArgumentData; m_Events.Add(CurrentEntry); } }