Garmin Fleet Management Controller  2.19.0
CPingStatusDlg Class Reference

Modeless dialog allowing the user to view ping status and send a ping. More...

#include <CPingStatusDlg.h>

+ Inheritance diagram for CPingStatusDlg:

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...
 
FmiApplicationLayermCom
 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...
 

Detailed Description

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.

Since
Protocol A604

Definition at line 26 of file CPingStatusDlg.h.

Constructor & Destructor Documentation

CPingStatusDlg::CPingStatusDlg ( CWnd *  aParent,
FmiApplicationLayer aCom 
)

Constructor.

Parameters
aParentThe parent of this dialog
aComReference to the FMI communication controller

Definition at line 32 of file CPingStatusDlg.cpp.

CPingStatusDlg::~CPingStatusDlg ( )
virtual

Destructor.

Definition at line 44 of file CPingStatusDlg.cpp.

References DoDataExchange().

Member Function Documentation

void CPingStatusDlg::DoDataExchange ( CDataExchange *  aDataExchange)
protectedvirtual

Perform dialog data exchange and validation.

Parameters
aDataExchangeThe 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().

void CPingStatusDlg::OnBnClickedResetClient ( )
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().

void CPingStatusDlg::OnBnClickedResetServer ( )
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().

void CPingStatusDlg::OnBnClickedSendPing ( )
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().

void CWndEventListener::onEvent ( EventId  aEventId,
uint32  aEventData,
void *  aEventDataPtr,
BOOL  handleNow 
)
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.

Parameters
aEventIdThe event ID
aEventDataThe event data
aEventDataPtrPointer to more event data
Note
Interested parties receive these events as Windows messages, i.e., ON_MESSAGE( aEventId, CallbackFunction ). aEventData is the WPARAM, and aEventDataPtr is the LPARAM.

Implements EventListener.

Definition at line 29 of file CWndEventListener.cpp.

References EVENT_ID_CNT, and WM_EVENT.

BOOL CPingStatusDlg::OnInitDialog ( )
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.

Returns
TRUE, since this function does not set focus to a control

Definition at line 72 of file CPingStatusDlg.cpp.

References TRUE, and updateTextFields().

afx_msg LRESULT CPingStatusDlg::OnPingEvent ( WPARAM  ,
LPARAM   
)
protected

Handler for the Ping event from FmiApplicationLayer.

Update the dialog with the ping counts owned by FmiApplicationLayer.

Returns
0, always

Definition at line 107 of file CPingStatusDlg.cpp.

References updateTextFields().

void CPingStatusDlg::updateTextFields ( )
protected

Member Data Documentation

CString CPingStatusDlg::mClientPingCount
protected

Number of client to server pings received.

Definition at line 57 of file CPingStatusDlg.h.

Referenced by DoDataExchange(), and updateTextFields().

CString CPingStatusDlg::mClientPingTime
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().

FmiApplicationLayer& CPingStatusDlg::mCom
protected

Reference to the FMI communication controller.

Definition at line 54 of file CPingStatusDlg.h.

Referenced by OnBnClickedResetClient(), OnBnClickedResetServer(), OnBnClickedSendPing(), and updateTextFields().

CString CPingStatusDlg::mServerPingCount
protected

Number of server to client pings sent.

Definition at line 60 of file CPingStatusDlg.h.

Referenced by DoDataExchange(), and updateTextFields().

CString CPingStatusDlg::mServerPingTime
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().


The documentation for this class was generated from the following files: