Garmin Fleet Management Controller
2.19.0
|
Modeless dialog allowing the user to view ping status and send a ping. More...
#include <CPingStatusDlg.h>
Public Member Functions | |
CPingStatusDlg (CWnd *aParent, FmiApplicationLayer &aCom) | |
Constructor. More... | |
virtual | ~CPingStatusDlg () |
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 Member Functions | |
virtual void | DoDataExchange (CDataExchange *aDataExchange) |
Perform dialog data exchange and validation. More... | |
afx_msg void | OnBnClickedResetClient () |
Click handler for the Reset (Client) button. More... | |
afx_msg void | OnBnClickedResetServer () |
Click handler for the Reset (Server) button. More... | |
afx_msg void | OnBnClickedSendPing () |
Click handler for the Send Ping button. More... | |
BOOL | OnInitDialog () |
Initialize the dialog. More... | |
afx_msg LRESULT | OnPingEvent (WPARAM, LPARAM) |
Handler for the Ping event from FmiApplicationLayer. More... | |
void | updateTextFields () |
Update the text boxes. More... | |
Protected Attributes | |
CString | mClientPingCount |
Number of client to server pings received. More... | |
CString | mClientPingTime |
Time when the last client to server ping was received, in the form HH:MM:SS AA (AA is am or pm) More... | |
FmiApplicationLayer & | mCom |
Reference to the FMI communication controller. More... | |
CString | mServerPingCount |
Number of server to client pings sent. More... | |
CString | mServerPingTime |
Time when the last server to client ping was sent, in the form HH:MM:SS AA (AA is am or pm) More... | |
Modeless dialog allowing the user to view ping status and send a ping.
This dialog allows the user to view the number of client to server pings and the timestamp of the last ping received, the number of server to client pings sent (and last time sent). The user can also reset these statistics, and initiate a server to client ping.
Definition at line 26 of file CPingStatusDlg.h.
CPingStatusDlg::CPingStatusDlg | ( | CWnd * | aParent, |
FmiApplicationLayer & | aCom | ||
) |
Constructor.
aParent | The parent of this dialog |
aCom | Reference to the FMI communication controller |
Definition at line 32 of file CPingStatusDlg.cpp.
|
virtual |
|
protectedvirtual |
Perform dialog data exchange and validation.
aDataExchange | The DDX context |
Definition at line 53 of file CPingStatusDlg.cpp.
References IDC_PING_TXT_CLIENT_PING_TS, IDC_PING_TXT_CLIENT_PINGS, IDC_PING_TXT_SERVER_PING_TS, IDC_PING_TXT_SERVER_PINGS, mClientPingCount, mClientPingTime, mServerPingCount, and mServerPingTime.
Referenced by ~CPingStatusDlg().
|
protected |
Click handler for the Reset (Client) button.
Reset the Client to Server Ping count and last ping time.
Definition at line 85 of file CPingStatusDlg.cpp.
References FmiApplicationLayer::mClientPingCount, mCom, and updateTextFields().
|
protected |
Click handler for the Reset (Server) button.
Reset the Server to Client Ping count and last ping time.
Definition at line 95 of file CPingStatusDlg.cpp.
References mCom, FmiApplicationLayer::mServerPingCount, and updateTextFields().
|
protected |
Click handler for the Send Ping button.
Initiate the Server to Client Ping protocol. If a timeout occurs and the user does not retry, close the dialog.
Definition at line 147 of file CPingStatusDlg.cpp.
References mCom, and FmiApplicationLayer::sendPing().
|
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 |
Initialize the dialog.
This function is called when the window is created. It initializes the text boxes with the current counts and times from FmiApplicationLayer.
Definition at line 72 of file CPingStatusDlg.cpp.
References TRUE, and updateTextFields().
|
protected |
Handler for the Ping event from FmiApplicationLayer.
Update the dialog with the ping counts owned by FmiApplicationLayer.
Definition at line 107 of file CPingStatusDlg.cpp.
References updateTextFields().
|
protected |
Update the text boxes.
Update the text boxes with the ping counts and times that FmiApplicationLayer has.
Definition at line 118 of file CPingStatusDlg.cpp.
References FALSE, mClientPingCount, FmiApplicationLayer::mClientPingCount, mClientPingTime, mCom, FmiApplicationLayer::mLastClientPingTime, FmiApplicationLayer::mLastServerPingTime, mServerPingCount, FmiApplicationLayer::mServerPingCount, and mServerPingTime.
Referenced by OnBnClickedResetClient(), OnBnClickedResetServer(), OnInitDialog(), and OnPingEvent().
|
protected |
Number of client to server pings received.
Definition at line 57 of file CPingStatusDlg.h.
Referenced by DoDataExchange(), and updateTextFields().
|
protected |
Time when the last client to server ping was received, in the form HH:MM:SS AA (AA is am or pm)
Definition at line 64 of file CPingStatusDlg.h.
Referenced by DoDataExchange(), and updateTextFields().
|
protected |
Reference to the FMI communication controller.
Definition at line 54 of file CPingStatusDlg.h.
Referenced by OnBnClickedResetClient(), OnBnClickedResetServer(), OnBnClickedSendPing(), and updateTextFields().
|
protected |
Number of server to client pings sent.
Definition at line 60 of file CPingStatusDlg.h.
Referenced by DoDataExchange(), and updateTextFields().
|
protected |
Time when the last server to client ping was sent, in the form HH:MM:SS AA (AA is am or pm)
Definition at line 68 of file CPingStatusDlg.h.
Referenced by DoDataExchange(), and updateTextFields().