/// <summary> /// Parses the Error Log entry /// </summary> /// <param name="reader">The binary reader containing the table data</param> /// <param name="timeFormat">The time format of the meter</param> // Revision History // MM/DD/YY Who Version Issue# Description // -------- --- ------- ------ --------------------------------------------- // 04/15/11 RCG 2.50.32 Created internal void ParseEntry(PSEMBinaryReader reader, PSEMBinaryReader.TM_FORMAT timeFormat) { m_ErrorTime = reader.ReadSTIME(timeFormat); m_usErrorCode = reader.ReadUInt16(); m_usGenericParameter2 = reader.ReadUInt16(); m_uiGenericParameter = reader.ReadUInt32(); }
/// <summary> /// Writes a TIME value to the stream. /// </summary> /// <param name="time">The time value to write.</param> /// <param name="timeFormat">The time format of the meter.</param> // Revision History // MM/DD/YY Who Version Issue# Description // -------- --- ------- ------ --------------------------------------------- // 11/20/08 RCG 2.00.09 Created public void WriteTIME(TimeSpan time, PSEMBinaryReader.TM_FORMAT timeFormat) { switch (timeFormat) { case PSEMBinaryReader.TM_FORMAT.UINT32_TIME: { uint TotalSeconds = Convert.ToUInt32(time.TotalSeconds); base.Write(TotalSeconds); break; } default: { throw new NotImplementedException("The selected time format has not been implemented"); } } }
/// <summary> /// Writes the STIME value to the stream /// </summary> /// <param name="date">The date to write</param> /// <param name="timeFormat">The time format to use</param> // Revision History // MM/DD/YY who Version Issue# Description // -------- --- ------- ------ ------------------------------------------- // 04/27/10 RCG 2.40.43 N/A Created public void WriteSTIME(DateTime date, PSEMBinaryReader.TM_FORMAT timeFormat) { switch (timeFormat) { case PSEMBinaryReader.TM_FORMAT.UINT32_TIME: { uint uiMinutes = Convert.ToUInt32((date - STIMEReferenceDate).TotalMinutes); base.Write(uiMinutes); break; } default: { throw new NotImplementedException("The selected time format has not been implemented"); } } }
/// <summary> /// Parses the Reset Log Entry /// </summary> /// <param name="reader">The binary reader that contains the data</param> /// <param name="timeFormat">The time format of the meter</param> // Revision History // MM/DD/YY Who Version Issue# Description // -------- --- ------- ------ --------------------------------------------- // 04/15/11 RCG 2.50.32 Created internal void ParseEntry(PSEMBinaryReader reader, PSEMBinaryReader.TM_FORMAT timeFormat) { m_ResetType = (HANResetType)reader.ReadByte(); m_ErrorSubcode = reader.ReadByte(); m_CurrentTaskID = reader.ReadByte(); m_ResetState = reader.ReadByte(); m_ResetTime = reader.ReadSTIME(timeFormat); m_CondensedRegistrationTable = new List <CondensedRegistrationTableEntry>(); for (int iIndex = 0; iIndex < 10; iIndex++) { CondensedRegistrationTableEntry NewEntry = new CondensedRegistrationTableEntry(); NewEntry.ParseEntry(reader); m_CondensedRegistrationTable.Add(NewEntry); } m_ResetErrors = new List <ZigBeeErrorLogEntry>(); for (int iIndex = 0; iIndex < 8; iIndex++) { ZigBeeErrorLogEntry NewEntry = new ZigBeeErrorLogEntry(); NewEntry.ParseEntry(reader, timeFormat); m_ResetErrors.Add(NewEntry); } m_ResetEvents = new List <ZigBeeEventLogEntry>(); for (int iIndex = 0; iIndex < 32; iIndex++) { ZigBeeEventLogEntry NewEntry = new ZigBeeEventLogEntry(); NewEntry.ParseEntry(reader); m_ResetEvents.Add(NewEntry); } m_SpecificErrorData = reader.ReadBytes(256); m_MiniCoreDump = new ZigBeeMiniCoreDump(); m_MiniCoreDump.Parse(reader); // There is a large amount of padding at the end of the entry that we should skip over reader.BaseStream.Seek(241 * sizeof(uint), System.IO.SeekOrigin.Current); }