Garmin Fleet Management Controller  2.19.0
CFileTransferProgressDlg Class Reference

Modal dialog displaying the status of the file transfer. More...

#include <CFileTransferProgressDlg.h>

+ Inheritance diagram for CFileTransferProgressDlg:

Public Member Functions

 CFileTransferProgressDlg (CWnd *aParent, FmiApplicationLayer &aCom)
 Constructor. More...
 
virtual ~CFileTransferProgressDlg ()
 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 OnBnClickedStop ()
 Click handler for the Stop button. More...
 
afx_msg LRESULT OnFileTransferProgress (WPARAM, LPARAM)
 Handler for File Transfer Progress event. More...
 
afx_msg LRESULT OnFileTransferStateChange (WPARAM, LPARAM)
 Handle a File Transfer State Change event. More...
 
BOOL OnInitDialog ()
 Initialize the dialog. More...
 

Protected Attributes

FmiApplicationLayermCom
 Reference to the FMI communication controller. More...
 
CProgressCtrl mProgressBar
 The progress bar. More...
 
BOOL mStopButtonClicked
 If TRUE, the Stop button was clicked. More...
 
CString mTransferStatus
 Current status of the transfer, as a string. More...
 

Detailed Description

Modal dialog displaying the status of the file transfer.

This dialog is displayed when a file transfer begins. When FmiApplicationLayer receives a file or packet receipt, it sends a status update message which this dialog receives and processes to update the text box and progress bar. Canceling the file transfer sets a flag in the FmiApplicationLayer instance which instructs the server to end the transfer (by not sending any more data).

Since
Protocol A604

Definition at line 27 of file CFileTransferProgressDlg.h.

Constructor & Destructor Documentation

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

Constructor.

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

Definition at line 30 of file CFileTransferProgressDlg.cpp.

References FALSE.

CFileTransferProgressDlg::~CFileTransferProgressDlg ( )
virtual

Destructor.

Definition at line 44 of file CFileTransferProgressDlg.cpp.

References DoDataExchange().

Member Function Documentation

void CFileTransferProgressDlg::DoDataExchange ( CDataExchange *  aDataExchange)
protectedvirtual

Perform dialog data exchange and validation.

Parameters
aDataExchangeThe DDX context

Definition at line 53 of file CFileTransferProgressDlg.cpp.

References IDC_FILE_PROGRESS_PROGRESS_BAR, IDC_FILE_PROGRESS_TXT_STATUS, mProgressBar, and mTransferStatus.

Referenced by ~CFileTransferProgressDlg().

void CFileTransferProgressDlg::OnBnClickedStop ( )
protected

Click handler for the Stop button.

Tells FmiApplicationLayer to stop the transfer

Definition at line 151 of file CFileTransferProgressDlg.cpp.

References mCom, mStopButtonClicked, FmiApplicationLayer::stopFileTransfer(), and TRUE.

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 CFileTransferProgressDlg::OnFileTransferProgress ( WPARAM  ,
LPARAM   
)
protected

Handler for File Transfer Progress event.

Updates the progress bar and mTransferStatus text with the progress.

Returns
0, always

Definition at line 129 of file CFileTransferProgressDlg.cpp.

References FALSE, mCom, FmiApplicationLayer::mFileTransferBytesDone, FmiApplicationLayer::mFileTransferSize, mProgressBar, and mTransferStatus.

afx_msg LRESULT CFileTransferProgressDlg::OnFileTransferStateChange ( WPARAM  ,
LPARAM   
)
protected
BOOL CFileTransferProgressDlg::OnInitDialog ( )
protected

Initialize the dialog.

This function is called when the window is created. It initializes the progress bar and text box.

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

Definition at line 68 of file CFileTransferProgressDlg.cpp.

References OnFileTransferStateChange(), and TRUE.

Member Data Documentation

FmiApplicationLayer& CFileTransferProgressDlg::mCom
protected

Reference to the FMI communication controller.

Definition at line 53 of file CFileTransferProgressDlg.h.

Referenced by OnBnClickedStop(), OnFileTransferProgress(), and OnFileTransferStateChange().

CProgressCtrl CFileTransferProgressDlg::mProgressBar
protected

The progress bar.

Definition at line 62 of file CFileTransferProgressDlg.h.

Referenced by DoDataExchange(), OnFileTransferProgress(), and OnFileTransferStateChange().

BOOL CFileTransferProgressDlg::mStopButtonClicked
protected

If TRUE, the Stop button was clicked.

Definition at line 65 of file CFileTransferProgressDlg.h.

Referenced by OnBnClickedStop(), and OnFileTransferStateChange().

CString CFileTransferProgressDlg::mTransferStatus
protected

Current status of the transfer, as a string.

This may be a generic string ("Started", "Cancelled") or, for an in progress transfer, include the bytes transferred and total

Definition at line 59 of file CFileTransferProgressDlg.h.

Referenced by DoDataExchange(), OnFileTransferProgress(), and OnFileTransferStateChange().


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