Garmin Fleet Management Controller  2.19.0
CGpiQueryDlg Class Reference

Modal dialog allowing the user to query the file version and size of the FMI GPI file on the client device. More...

#include <CGpiQueryDlg.h>

+ Inheritance diagram for CGpiQueryDlg:

Public Member Functions

 CGpiQueryDlg (CWnd *aParent, FmiApplicationLayer &aCom)
 Constructor. More...
 
virtual ~CGpiQueryDlg ()
 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 OnBnClickedUpdate ()
 Click handler for the Update button. More...
 
afx_msg LRESULT OnGpiInfoReceived (WPARAM, LPARAM)
 Handler for the GPI Information Received event. More...
 
BOOL OnInitDialog ()
 Initialize the dialog. More...
 

Protected Attributes

FmiApplicationLayermCom
 Reference to the FMI communication controller. More...
 
CString mFileSize
 Contents of the File Size text box. More...
 
CString mFileVersion
 Contents of the File Version text box. More...
 

Detailed Description

Modal dialog allowing the user to query the file version and size of the FMI GPI file on the client device.

When the dialog is displayed, and when the Refresh button is clicked, the dialog initiates the GPI File Information Protocol. When the response is received from the client, FmiApplicationLayer sends an event; this dialog then displays the details received from the client.

Since
Protocol A604

Definition at line 25 of file CGpiQueryDlg.h.

Constructor & Destructor Documentation

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

Constructor.

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

Definition at line 28 of file CGpiQueryDlg.cpp.

CGpiQueryDlg::~CGpiQueryDlg ( )
virtual

Destructor.

Definition at line 42 of file CGpiQueryDlg.cpp.

References DoDataExchange().

Member Function Documentation

void CGpiQueryDlg::DoDataExchange ( CDataExchange *  aDataExchange)
protectedvirtual

Perform dialog data exchange and validation.

Parameters
aDataExchangeThe DDX context

Definition at line 51 of file CGpiQueryDlg.cpp.

References IDC_GPIQUERY_TXT_SIZE, IDC_GPIQUERY_TXT_VERSION, mFileSize, and mFileVersion.

Referenced by ~CGpiQueryDlg().

void CGpiQueryDlg::OnBnClickedUpdate ( )
protected

Click handler for the Update button.

Initiate the GPI File Information Request protocol to get the current information from the client.

Definition at line 80 of file CGpiQueryDlg.cpp.

References mCom, and FmiApplicationLayer::sendGpiFileInfoRequest().

Referenced by OnInitDialog().

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.

afx_msg LRESULT CGpiQueryDlg::OnGpiInfoReceived ( WPARAM  ,
LPARAM   
)
protected

Handler for the GPI Information Received event.

Updates the fields in this dialog with the information received. If the file version is printable, it is interpreted as a string; otherwise, it is displayed in hexadecimal.

Returns
0, always

Definition at line 92 of file CGpiQueryDlg.cpp.

References FALSE, FmiApplicationLayer::mClientCodepage, mCom, mFileSize, FmiApplicationLayer::mFileSize, mFileVersion, FmiApplicationLayer::mFileVersion, FmiApplicationLayer::mFileVersionLength, minval, UTIL_data_is_printable(), and UTIL_uint8_to_hex().

BOOL CGpiQueryDlg::OnInitDialog ( )
protected

Initialize the dialog.

This function is called when the window is created. It initiates a GPI File Information Request to get the current information from the client.

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

Definition at line 67 of file CGpiQueryDlg.cpp.

References OnBnClickedUpdate(), and TRUE.

Member Data Documentation

FmiApplicationLayer& CGpiQueryDlg::mCom
protected

Reference to the FMI communication controller.

Definition at line 50 of file CGpiQueryDlg.h.

Referenced by OnBnClickedUpdate(), and OnGpiInfoReceived().

CString CGpiQueryDlg::mFileSize
protected

Contents of the File Size text box.

Definition at line 56 of file CGpiQueryDlg.h.

Referenced by DoDataExchange(), and OnGpiInfoReceived().

CString CGpiQueryDlg::mFileVersion
protected

Contents of the File Version text box.

Definition at line 53 of file CGpiQueryDlg.h.

Referenced by DoDataExchange(), and OnGpiInfoReceived().


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