Garmin Fleet Management Controller
2.19.0
|
Modeless log viewer dialog. More...
#include <CLogViewerDlg.h>
Public Member Functions | |
CLogViewerDlg (LogParser *aLogParser, CWnd *aParent=NULL, BOOL aOpenOther=FALSE) | |
Constructor. More... | |
virtual | ~CLogViewerDlg () |
Destructor. More... | |
void | onEvent (EventId aEventId, uint32 aEventData, void *aEventDataPtr, BOOL handleNow) |
Handles event callbacks by translating an EventId into a windows message. More... | |
Protected Types | |
enum | SearchDirectionType { SEARCH_UP, SEARCH_DOWN } |
Search direction. Indexes must correspond to the radio buttons in the IDC_LOG_RDO_UP radio group. More... | |
Protected Member Functions | |
virtual void | DoDataExchange (CDataExchange *aDataExchange) |
Perform dialog data exchange and validation. More... | |
afx_msg void | OnBnClickedClearLog () |
Click handler for the Clear Log button. More... | |
afx_msg void | OnBnClickedFindNext () |
Click handler for the Find Next button. More... | |
afx_msg void | OnBnClickedOk () |
Click handler for the OK button; destroys the window. More... | |
afx_msg void | OnBnClickedSaveAs () |
Click handler for the Save As button. More... | |
afx_msg void | OnBnClickedViewCurrent () |
Click handler for the View Current button. More... | |
afx_msg void | OnBnClickedViewOther () |
Click handler for the View Other button. More... | |
afx_msg void | OnCancel () |
Handler for the Cancel action; destroys the window. More... | |
afx_msg void | OnGetMinMaxInfo (MINMAXINFO *aMinMaxInfo) |
Called on every resize to get the resize bounds. More... | |
BOOL | OnInitDialog () |
Initialize the dialog. More... | |
afx_msg void | OnLbnSelchangeLog () |
Selection Changed handler for the packet list. More... | |
afx_msg LPARAM | OnPacketLogged (WPARAM, LPARAM) |
Handles the Packet Logged event from Com; updates the packet list. More... | |
afx_msg void | OnSize (UINT aType, int aClientWidth, int aClientHeight) |
Called after the dialog is resized; repositions the contents of the display. More... | |
void | PostNcDestroy () |
Perform final cleanup on the log viewer. More... | |
void | resendPacket () |
Retransmit the selected packet for debugging purposes. More... | |
void | resetView () |
Reset the log view. More... | |
void | UpdateLogDisplay () |
Reads the log file and updates the packet list. If a packet was selected, keeps the packet selected and visible in the list. More... | |
BOOL | updateView () |
Update the log view. More... | |
Protected Attributes | |
CButton | mClearButton |
Reference to the Clear button. More... | |
CButton | mCloseButton |
Reference to the Close button. More... | |
CStatic | mCurrentPacketControl |
Reference to a control containing the currently selected packet, formatted. More... | |
CStatic | mCurrentPacketTitleLabel |
Label above the current packet text box. More... | |
CButton | mFindNextButton |
Reference to the Find Next button. More... | |
CStatic | mLogNameControl |
Control containing the log name. More... | |
CString | mLogNameText |
The string describing the log being viewed ("Current execution's" or a file name) More... | |
CStatic | mLogNameTitleLabel |
Label for the log name control. More... | |
LogParser * | mLogParser |
The log parser. More... | |
BOOL | mOpenOtherLog |
If TRUE, the Open File dialog should be presented (to aOpenOther another log) More... | |
CColoredListBox | mPacketListBox |
Reference to the packet list box. More... | |
CStatic | mPacketListTitleLabel |
Label above the packet list. More... | |
CButton | mResendButton |
Reference to the Resend button. More... | |
CButton | mSaveButton |
Reference to the Save button. More... | |
int | mSearchDirection |
Search direction. More... | |
CButton | mSearchDownRadioButton |
Reference to the Search Down radio button. More... | |
CButton | mSearchGroupBox |
Reference to the Search group box. More... | |
CString | mSearchText |
Contents of the Search Text edit box. More... | |
CEdit | mSearchTextControl |
Reference to the Search Text edit box. More... | |
CButton | mSearchUpRadioButton |
Reference to the Search Up radio button. More... | |
CString | mSelectedPacketText |
Formatted representation of the current packet. More... | |
CButton | mViewCurrentButton |
Reference to the View Current button. More... | |
CButton | mViewOtherButton |
Reference to the View Other button. More... | |
Modeless log viewer dialog.
This dialog reads, parses, and displays a packet log created by the Com class. The list of packets is displayed on the left side; selecting a packet causes the selected packet to be displayed and formatted into a text box on the right side of the dialog. The user can also search the packet list (header names only), mSaveButton the current log file, or open a previous log.
Definition at line 31 of file CLogViewerDlg.h.
|
protected |
Search direction. Indexes must correspond to the radio buttons in the IDC_LOG_RDO_UP radio group.
Enumerator | |
---|---|
SEARCH_UP | |
SEARCH_DOWN |
Definition at line 48 of file CLogViewerDlg.h.
CLogViewerDlg::CLogViewerDlg | ( | LogParser * | aLogParser, |
CWnd * | aParentWnd = NULL , |
||
BOOL | aOpenOtherLog = FALSE |
||
) |
Constructor.
aLogParser | The LogParser which will format log entries |
aParentWnd | The parent of this dialog |
aOpenOtherLog | If TRUE, the dialog starts by presenting a File/Open dialog to allow the user to select another (i.e., saved, not the current) packet log to view. |
Definition at line 47 of file CLogViewerDlg.cpp.
|
virtual |
|
protectedvirtual |
Perform dialog data exchange and validation.
aDataExchange | The DDX context |
Definition at line 72 of file CLogViewerDlg.cpp.
References IDC_LOG_BTN_RESEND, IDC_LOG_EDIT_SEARCH_TEXT, IDC_LOG_GRP_SEARCH, IDC_LOG_LBL_LOG_NAME, IDC_LOG_LBL_PACKETS, IDC_LOG_LBL_SELECTED_PACKET, IDC_LOG_RDO_DOWN, IDC_LOG_RDO_UP, IDC_LOG_TXT_LOG_NAME, and IDC_LOG_TXT_SELECTED_PACKET.
Referenced by ~CLogViewerDlg().
|
protected |
Click handler for the Clear Log button.
Clear (remove all packets from) the log file; also resets the packet list in the UI.
Definition at line 525 of file CLogViewerDlg.cpp.
References Logger::clearLog(), and Logger::LOG_FILE.
|
protected |
Click handler for the Find Next button.
Finds the next occurrence of the search string supplied in the list of packets. Note that this only searches the packet description in the list, not the parsed content.
Definition at line 604 of file CLogViewerDlg.cpp.
References TRUE.
|
protected |
Click handler for the OK button; destroys the window.
Definition at line 187 of file CLogViewerDlg.cpp.
|
protected |
Click handler for the Save As button.
Presents the user with a File Save dialog then saves the currently viewed log to the user-specified filename.
Definition at line 538 of file CLogViewerDlg.cpp.
References FALSE.
|
protected |
Click handler for the View Current button.
Switch to the default (current) packet log and update the log display.
Definition at line 507 of file CLogViewerDlg.cpp.
References Logger::LOG_FILE.
|
protected |
Click handler for the View Other button.
Prompt the user (with a FileDialog) to select another packet log to view then update the log display.
Definition at line 439 of file CLogViewerDlg.cpp.
References TRUE.
|
protected |
Handler for the Cancel action; destroys the window.
Definition at line 196 of file CLogViewerDlg.cpp.
|
virtualinherited |
Handles event callbacks by translating an EventId into a windows message.
Casts this to a CWnd then posts a Windows message to it. The use of dynamic_cast is used as an alternative to the "dreaded diamond" caused by C++ multiple inheritance.
aEventId | The event ID |
aEventData | The event data |
aEventDataPtr | Pointer to more event data |
Implements EventListener.
Definition at line 29 of file CWndEventListener.cpp.
References EVENT_ID_CNT, and WM_EVENT.
|
protected |
Called on every resize to get the resize bounds.
Sets minTrackSize to the minimum dimensions the window can be resized to.
aMinMaxInfo | Pointer to the MINMAXINFO data structure that this function updates |
Definition at line 393 of file CLogViewerDlg.cpp.
Referenced by OnSize().
|
protected |
Initialize the dialog.
This function is called when the window is created. It sets up the parent, so it can get info from and send a message to Com. It also registers to receive events from Com, and initializes the maps of packet and command IDs to names for simplified lookup.
Definition at line 108 of file CLogViewerDlg.cpp.
References FALSE, Logger::LOG_FILE, and TRUE.
|
protected |
Selection Changed handler for the packet list.
Gets the currently selected packet and formats it into the text box. Enables the resend button if a packet is selected and the app is connected to a client.
Definition at line 417 of file CLogViewerDlg.cpp.
References FALSE, SerialPort::getInstance(), and TRUE.
|
protected |
Handles the Packet Logged event from Com; updates the packet list.
Definition at line 133 of file CLogViewerDlg.cpp.
|
protected |
Called after the dialog is resized; repositions the contents of the display.
Moves/sizes the contents as follows:
aType | The type of resizing requested (maximized, etc.) |
aClientWidth | The new width of the client area |
aClientHeight | The new height of the client area |
Definition at line 233 of file CLogViewerDlg.cpp.
References EDGE_SPACING, FALSE, and OnGetMinMaxInfo().
Referenced by PostNcDestroy().
|
protected |
Perform final cleanup on the log viewer.
This is a "monitor", so it is modeless. When it gets the destroy message it must re-enable the main button to open these dialogs (the button was disabled when this window opened to prevent several instances of the log viewer from being displayed. Finally, this function deletes the CLogViewerDlg object since the pointer to it was lost after creation.
Definition at line 210 of file CLogViewerDlg.cpp.
References EVENT_LOG_VIEWER_CLOSED, OnSize(), and Event::post().
|
protected |
Retransmit the selected packet for debugging purposes.
Definition at line 405 of file CLogViewerDlg.cpp.
|
protected |
Reset the log view.
Clear the packet list and packet detail, and update the log name.
Definition at line 478 of file CLogViewerDlg.cpp.
References FALSE, Logger::LOG_FILE, and TRUE.
|
protected |
Reads the log file and updates the packet list. If a packet was selected, keeps the packet selected and visible in the list.
Definition at line 144 of file CLogViewerDlg.cpp.
|
protected |
Update the log view.
Retrieve any new packet titles from the log parser and add them to the list box.
Definition at line 169 of file CLogViewerDlg.cpp.
|
protected |
Reference to the Clear button.
Definition at line 108 of file CLogViewerDlg.h.
|
protected |
Reference to the Close button.
Definition at line 96 of file CLogViewerDlg.h.
|
protected |
Reference to a control containing the currently selected packet, formatted.
Definition at line 141 of file CLogViewerDlg.h.
|
protected |
Label above the current packet text box.
Definition at line 144 of file CLogViewerDlg.h.
|
protected |
Reference to the Find Next button.
Definition at line 111 of file CLogViewerDlg.h.
|
protected |
Control containing the log name.
Definition at line 153 of file CLogViewerDlg.h.
|
protected |
The string describing the log being viewed ("Current execution's" or a file name)
Definition at line 132 of file CLogViewerDlg.h.
|
protected |
Label for the log name control.
Definition at line 150 of file CLogViewerDlg.h.
|
protected |
The log parser.
Definition at line 160 of file CLogViewerDlg.h.
|
protected |
If TRUE, the Open File dialog should be presented (to aOpenOther another log)
Definition at line 93 of file CLogViewerDlg.h.
|
protected |
Reference to the packet list box.
Definition at line 129 of file CLogViewerDlg.h.
|
protected |
Label above the packet list.
Definition at line 147 of file CLogViewerDlg.h.
|
protected |
Reference to the Resend button.
Definition at line 123 of file CLogViewerDlg.h.
|
protected |
Reference to the Save button.
Definition at line 105 of file CLogViewerDlg.h.
|
protected |
Search direction.
Definition at line 157 of file CLogViewerDlg.h.
|
protected |
Reference to the Search Down radio button.
Definition at line 117 of file CLogViewerDlg.h.
|
protected |
Reference to the Search group box.
Definition at line 120 of file CLogViewerDlg.h.
|
protected |
Contents of the Search Text edit box.
Definition at line 138 of file CLogViewerDlg.h.
|
protected |
Reference to the Search Text edit box.
Definition at line 126 of file CLogViewerDlg.h.
|
protected |
Reference to the Search Up radio button.
Definition at line 114 of file CLogViewerDlg.h.
|
protected |
Formatted representation of the current packet.
Definition at line 135 of file CLogViewerDlg.h.
|
protected |
Reference to the View Current button.
Definition at line 102 of file CLogViewerDlg.h.
|
protected |
Reference to the View Other button.
Definition at line 99 of file CLogViewerDlg.h.