Garmin Fleet Management Controller
2.19.0
|
Modal dialog displaying the status of the file transfer. More...
#include <CFileTransferProgressDlg.h>
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 | |
FmiApplicationLayer & | mCom |
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... | |
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).
Definition at line 27 of file CFileTransferProgressDlg.h.
CFileTransferProgressDlg::CFileTransferProgressDlg | ( | CWnd * | aParent, |
FmiApplicationLayer & | aCom | ||
) |
Constructor.
aParent | The parent of this dialog |
aCom | Reference to the FMI communication controller |
Definition at line 30 of file CFileTransferProgressDlg.cpp.
References FALSE.
|
virtual |
Destructor.
Definition at line 44 of file CFileTransferProgressDlg.cpp.
References DoDataExchange().
|
protectedvirtual |
Perform dialog data exchange and validation.
aDataExchange | The 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().
|
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.
|
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 |
Handler for File Transfer Progress event.
Updates the progress bar and mTransferStatus text with the progress.
Definition at line 129 of file CFileTransferProgressDlg.cpp.
References FALSE, mCom, FmiApplicationLayer::mFileTransferBytesDone, FmiApplicationLayer::mFileTransferSize, mProgressBar, and mTransferStatus.
|
protected |
Handle a File Transfer State Change event.
Updates the transfer mTransferStatus text box (based on the current state known to FmiApplicationLayer) and, if the transfer is in progress, the progress bar.
Definition at line 84 of file CFileTransferProgressDlg.cpp.
References FALSE, IDC_FILE_PROGRESS_BTN_STOP, mCom, FmiApplicationLayer::mFileTransferSize, FmiApplicationLayer::mFileTransferState, mProgressBar, mStopButtonClicked, mTransferStatus, FmiApplicationLayer::TRANSFER_COMPLETED, FmiApplicationLayer::TRANSFER_FAILED, FmiApplicationLayer::TRANSFER_IN_PROGRESS, FmiApplicationLayer::TRANSFER_NOT_STARTED, FmiApplicationLayer::TRANSFER_STARTED, and TRUE.
Referenced by OnInitDialog().
|
protected |
Initialize the dialog.
This function is called when the window is created. It initializes the progress bar and text box.
Definition at line 68 of file CFileTransferProgressDlg.cpp.
References OnFileTransferStateChange(), and TRUE.
|
protected |
Reference to the FMI communication controller.
Definition at line 53 of file CFileTransferProgressDlg.h.
Referenced by OnBnClickedStop(), OnFileTransferProgress(), and OnFileTransferStateChange().
|
protected |
The progress bar.
Definition at line 62 of file CFileTransferProgressDlg.h.
Referenced by DoDataExchange(), OnFileTransferProgress(), and OnFileTransferStateChange().
|
protected |
If TRUE, the Stop button was clicked.
Definition at line 65 of file CFileTransferProgressDlg.h.
Referenced by OnBnClickedStop(), and OnFileTransferStateChange().
|
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().