Garmin Fleet Management Controller
2.19.0
|
Abstract base class for log item parsers. More...
#include <LogParser.h>
Public Member Functions | |
LogParser () | |
Constructor. More... | |
virtual | ~LogParser () |
Destructor. More... | |
CString | getFilename () |
Get the path of the log file being parsed. More... | |
int | getLineCount () const |
Return the number of lines parsed so far. More... | |
virtual CString | getPacketDetail (int aLineNumber)=0 |
Return the packet detail as a formatted string. More... | |
virtual CString | getPacketTitle (int aLineNumber)=0 |
Return the packet title as a formatted string. More... | |
void | init (const CString &aFilename) |
Initialize the LogParser to read a particular file. More... | |
BOOL | readLog () |
Reads from the log file starting from the end of the last read position and adds it to the display. More... | |
virtual void | resendPacket (int aLineNumber)=0 |
Resend the packet at this line number. More... | |
void | reset () |
Reset the log parser to initial state. More... | |
void | setRenderWidth (int aWidth) |
Set the number of pixels available for rendering text. More... | |
Protected Member Functions | |
CString | formatMultiLineHex (int aSize, uint8 *aData) |
Format bytes into a multi logLine hex dump format. More... | |
Protected Attributes | |
BOOL | mIsMorning |
If TRUE, the log was started in the mIsMorning (computed from log header) More... | |
int | mLineCount |
Number of lines that have been parsed so far. More... | |
std::map< int, std::streamoff > | mLineOffset |
Map of log items to the offset in the log file where the text line starts. More... | |
CString | mLogFilename |
File name of the currently open log file. More... | |
int | mLogStartHr |
Hour of the time when the log file was created (from log header) More... | |
int | mLogStartMillis |
Milliseconds of the time when the log file was created (from log header) More... | |
int | mLogStartMin |
Minutes of the time when the log file was created (from log header) More... | |
int | mLogStartSec |
Seconds of the time when the log file was created (from log header) More... | |
std::streamoff | mParseEndOffset |
Offset of the log file where parsing stopped. More... | |
int | mRenderWidth |
Available width in pixels to render the packet detail. More... | |
Abstract base class for log item parsers.
The LogParser is used by the LogViewer to perform the work associated with parsing the log.
Definition at line 23 of file LogParser.h.
LogParser::LogParser | ( | ) |
|
virtual |
|
protected |
Format bytes into a multi logLine hex dump format.
aSize | The number of bytes to format |
aData | The bytes to format |
Definition at line 165 of file LogParser.cpp.
Referenced by setRenderWidth().
CString LogParser::getFilename | ( | ) |
Get the path of the log file being parsed.
Definition at line 204 of file LogParser.cpp.
int LogParser::getLineCount | ( | ) | const |
Return the number of lines parsed so far.
Definition at line 141 of file LogParser.cpp.
References setRenderWidth().
|
pure virtual |
Return the packet detail as a formatted string.
aLineNumber | the line number of the packet to parse |
Implemented in FmiLogParser.
|
pure virtual |
Return the packet title as a formatted string.
aLineNumber | the line number of the packet to parse |
Implemented in FmiLogParser.
void LogParser::init | ( | const CString & | aFilename | ) |
Initialize the LogParser to read a particular file.
aFilename | The file to read |
Definition at line 193 of file LogParser.cpp.
BOOL LogParser::readLog | ( | ) |
Reads from the log file starting from the end of the last read position and adds it to the display.
The display text is normally the Garmin packet name, but for FMI packets the FMI packet name is used, and for Garmin commands the Garmin command name is used.
Definition at line 44 of file LogParser.cpp.
References cnt_of_array, FALSE, and TRUE.
|
pure virtual |
Resend the packet at this line number.
aLineNumber | the line number of the packet to resend |
Implemented in FmiLogParser.
void LogParser::reset | ( | ) |
Reset the log parser to initial state.
Definition at line 130 of file LogParser.cpp.
void LogParser::setRenderWidth | ( | int | aWidth | ) |
Set the number of pixels available for rendering text.
aWidth | The width of the packet detail area, in pixels |
Definition at line 151 of file LogParser.cpp.
References formatMultiLineHex().
Referenced by getLineCount().
|
protected |
If TRUE, the log was started in the mIsMorning (computed from log header)
Definition at line 89 of file LogParser.h.
|
protected |
Number of lines that have been parsed so far.
Definition at line 98 of file LogParser.h.
|
protected |
Map of log items to the offset in the log file where the text line starts.
Definition at line 95 of file LogParser.h.
|
protected |
File name of the currently open log file.
Definition at line 74 of file LogParser.h.
|
protected |
Hour of the time when the log file was created (from log header)
Definition at line 77 of file LogParser.h.
|
protected |
Milliseconds of the time when the log file was created (from log header)
Definition at line 86 of file LogParser.h.
|
protected |
Minutes of the time when the log file was created (from log header)
Definition at line 80 of file LogParser.h.
|
protected |
Seconds of the time when the log file was created (from log header)
Definition at line 83 of file LogParser.h.
|
protected |
Offset of the log file where parsing stopped.
Definition at line 92 of file LogParser.h.
|
protected |
Available width in pixels to render the packet detail.
Definition at line 101 of file LogParser.h.