Garmin Fleet Management Controller
2.19.0
|
Modeless dialog allowing the user to manage waypoints. More...
#include <CWaypointDlg.h>
Public Member Functions | |
CWaypointDlg (CWnd *aParent, FmiApplicationLayer &aCom) | |
Constructor. More... | |
virtual | ~CWaypointDlg () |
Destructor. More... | |
afx_msg void | OnBnClickedOk () |
Handler for the OK button. More... | |
afx_msg void | OnBnClickedWptBtnCreateCat () |
Handler for the Create Category button. More... | |
afx_msg void | OnBnClickedWptBtnDelete () |
Handler for the Delete Waypoint button. More... | |
afx_msg void | OnBnClickedWptBtnDeleteCat () |
Handler for the Delete Category button. More... | |
afx_msg void | OnBnClickedWptBtnSend () |
Handler for the Send Waypoint button. More... | |
afx_msg void | OnEnChangeWptEdit () |
Edit handler for the waypoint edit boxes on this dialog. More... | |
void | onEvent (EventId aEventId, uint32 aEventData, void *aEventDataPtr, BOOL handleNow) |
Handles event callbacks by translating an EventId into a windows message. More... | |
Private Member Functions | |
virtual void | DoDataExchange (CDataExchange *aDataExchange) |
Perform dialog data exchange and validation. More... | |
uint16 | getCatIds () |
Get category bit field value for the selected category IDs. More... | |
afx_msg LPARAM | OnCategoryListChanged (WPARAM, LPARAM) |
Handler for EVENT_FMI_CATEGORY_LIST_CHANGED event. More... | |
BOOL | OnInitDialog () |
Initialize the dialog. More... | |
afx_msg LPARAM | OnWaypointListChanged (WPARAM, LPARAM) |
Handler for EVENT_FMI_WAYPOINT_LIST_CHANGED event. More... | |
void | PostNcDestroy () |
Perform final cleanup. More... | |
void | updateCatBox () |
Update the waypoint list box from the map owned by Com. More... | |
void | updateListBox () |
Update the waypoint list box from the map owned by Com. More... | |
Private Attributes | |
CString | mCat |
Waypoint category entered by the user. More... | |
CListBox | mCatBox |
List box containing waypoint categories sent to the client. More... | |
unsigned int | mCatId |
Waypoint category ID entered by the user. More... | |
FmiApplicationLayer & | mCom |
Reference to the FMI communication controller. More... | |
CString | mComment |
Waypoint comment entered by the user. More... | |
double | mLat |
Waypoint latitude in decimal degrees. More... | |
CListBox | mListBox |
List box containing waypoints sent to the client. More... | |
double | mLon |
Waypoint longitude in decimal degrees. More... | |
CString | mName |
Waypoint name entered by the user. More... | |
UINT | mSymbol |
Waypoint symbol entered by the user. More... | |
UINT | mWptId |
Waypoint ID entered by the user. More... | |
Modeless dialog allowing the user to manage waypoints.
CStopListDlg allows the user to view and manipulate the waypoints and waypoint categories on the client device.
Definition at line 24 of file CWaypointDlg.h.
CWaypointDlg::CWaypointDlg | ( | CWnd * | aParent, |
FmiApplicationLayer & | aCom | ||
) |
Constructor.
aParent | The parent of this dialog |
aCom | Reference to the FMI communication controller |
Definition at line 36 of file CWaypointDlg.cpp.
|
virtual |
|
privatevirtual |
Perform dialog data exchange and validation.
aDataExchange | The DDX context |
Definition at line 65 of file CWaypointDlg.cpp.
References IDC_WPT_EDIT_CAT_ID, IDC_WPT_EDIT_CAT_NAME, IDC_WPT_EDIT_LAT, IDC_WPT_EDIT_LON, IDC_WPT_EDIT_SYM_ID, IDC_WPT_EDIT_WPT_COMMENT, IDC_WPT_EDIT_WPT_ID, IDC_WPT_EDIT_WPT_NAME, IDC_WPT_LST_CATEGORIES, IDC_WPT_LST_WAYPOINTS, mCat, mCatBox, mCatId, mComment, mLat, mListBox, mLon, mName, mSymbol, and mWptId.
Referenced by ~CWaypointDlg().
|
private |
Get category bit field value for the selected category IDs.
Form a bit field with bits set corresponding to the selected category IDs. For example, if categories with IDs 0 and 5, are selected, the bit field will have the lowest bit and the 6th lowest bit set to 1 for a value of 33 decimal.
Definition at line 203 of file CWaypointDlg.cpp.
References FileBackedMap< T >::getKeyAt(), mCatBox, FmiApplicationLayer::mCategories, mCom, and setbit.
Referenced by OnBnClickedWptBtnDeleteCat(), and OnBnClickedWptBtnSend().
void CWaypointDlg::OnBnClickedOk | ( | ) |
void CWaypointDlg::OnBnClickedWptBtnCreateCat | ( | ) |
Handler for the Create Category button.
Initiate the Create Waypoint Category Protocol
Definition at line 289 of file CWaypointDlg.cpp.
References mCat, mCatId, mCom, FmiApplicationLayer::sendCreateWaypointCat(), and TRUE.
void CWaypointDlg::OnBnClickedWptBtnDelete | ( | ) |
Handler for the Delete Waypoint button.
Initiate the Delete Waypoint Protocol
Definition at line 264 of file CWaypointDlg.cpp.
References FileBackedMap< T >::getKeyAt(), mCom, mListBox, FmiApplicationLayer::mWaypoints, FmiApplicationLayer::sendDeleteWaypoint(), and TRUE.
void CWaypointDlg::OnBnClickedWptBtnDeleteCat | ( | ) |
Handler for the Delete Category button.
Initiate the Delete Waypoints by Category Protocol
Definition at line 278 of file CWaypointDlg.cpp.
References getCatIds(), mCom, FmiApplicationLayer::sendDeleteWaypointCat(), and TRUE.
void CWaypointDlg::OnBnClickedWptBtnSend | ( | ) |
Handler for the Send Waypoint button.
Initiate the Create Waypoint Protocol
Definition at line 235 of file CWaypointDlg.cpp.
References getCatIds(), mCom, mComment, mLat, mLon, mName, mSymbol, mWptId, FmiApplicationLayer::sendWaypoint(), and TRUE.
|
private |
Handler for EVENT_FMI_CATEGORY_LIST_CHANGED event.
Definition at line 189 of file CWaypointDlg.cpp.
References updateCatBox().
void CWaypointDlg::OnEnChangeWptEdit | ( | ) |
Edit handler for the waypoint edit boxes on this dialog.
Enable the Send Waypoint button if the waypoint name is specified; disable it otherwise.
Definition at line 247 of file CWaypointDlg.cpp.
References FALSE, IDC_WPT_BTN_SEND, mName, 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.
|
private |
Initialize the dialog.
This function is called when the window is created. It sets the window position, updates the Waypoints and Categories list boxes, and disables the appropriate controls.
Definition at line 99 of file CWaypointDlg.cpp.
References FALSE, IDC_WPT_BTN_SEND, TRUE, updateCatBox(), and updateListBox().
|
private |
Handler for EVENT_FMI_WAYPOINT_LIST_CHANGED event.
Definition at line 179 of file CWaypointDlg.cpp.
References updateListBox().
|
private |
Perform final cleanup.
Enable the Waypoints button on the main window.
Definition at line 86 of file CWaypointDlg.cpp.
References EVENT_FMI_WAYPOINT_DLG_CLOSED, and Event::post().
|
private |
Update the waypoint list box from the map owned by Com.
Definition at line 147 of file CWaypointDlg.cpp.
References FileBackedMap< T >::begin(), FileBackedMap< T >::end(), mCatBox, FmiApplicationLayer::mCategories, and mCom.
Referenced by OnCategoryListChanged(), and OnInitDialog().
|
private |
Update the waypoint list box from the map owned by Com.
Definition at line 116 of file CWaypointDlg.cpp.
References FileBackedMap< T >::begin(), FileBackedMap< T >::end(), mCom, mListBox, and FmiApplicationLayer::mWaypoints.
Referenced by OnInitDialog(), and OnWaypointListChanged().
|
private |
Waypoint category entered by the user.
Definition at line 74 of file CWaypointDlg.h.
Referenced by DoDataExchange(), and OnBnClickedWptBtnCreateCat().
|
private |
List box containing waypoint categories sent to the client.
Definition at line 86 of file CWaypointDlg.h.
Referenced by DoDataExchange(), getCatIds(), and updateCatBox().
|
private |
Waypoint category ID entered by the user.
Definition at line 89 of file CWaypointDlg.h.
Referenced by DoDataExchange(), and OnBnClickedWptBtnCreateCat().
|
private |
Reference to the FMI communication controller.
Definition at line 58 of file CWaypointDlg.h.
Referenced by getCatIds(), OnBnClickedWptBtnCreateCat(), OnBnClickedWptBtnDelete(), OnBnClickedWptBtnDeleteCat(), OnBnClickedWptBtnSend(), updateCatBox(), and updateListBox().
|
private |
Waypoint comment entered by the user.
Definition at line 80 of file CWaypointDlg.h.
Referenced by DoDataExchange(), and OnBnClickedWptBtnSend().
|
private |
Waypoint latitude in decimal degrees.
Definition at line 65 of file CWaypointDlg.h.
Referenced by DoDataExchange(), and OnBnClickedWptBtnSend().
|
private |
List box containing waypoints sent to the client.
Definition at line 83 of file CWaypointDlg.h.
Referenced by DoDataExchange(), OnBnClickedWptBtnDelete(), and updateListBox().
|
private |
Waypoint longitude in decimal degrees.
Definition at line 68 of file CWaypointDlg.h.
Referenced by DoDataExchange(), and OnBnClickedWptBtnSend().
|
private |
Waypoint name entered by the user.
Definition at line 77 of file CWaypointDlg.h.
Referenced by DoDataExchange(), OnBnClickedWptBtnSend(), and OnEnChangeWptEdit().
|
private |
Waypoint symbol entered by the user.
Definition at line 71 of file CWaypointDlg.h.
Referenced by DoDataExchange(), and OnBnClickedWptBtnSend().
|
private |
Waypoint ID entered by the user.
Definition at line 62 of file CWaypointDlg.h.
Referenced by DoDataExchange(), and OnBnClickedWptBtnSend().