Garmin Fleet Management Controller  2.19.0
CWaypointDlg Class Reference

Modeless dialog allowing the user to manage waypoints. More...

#include <CWaypointDlg.h>

+ Inheritance diagram for CWaypointDlg:

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

Detailed Description

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.

Since
Protocol A607

Definition at line 24 of file CWaypointDlg.h.

Constructor & Destructor Documentation

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

Constructor.

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

Definition at line 36 of file CWaypointDlg.cpp.

CWaypointDlg::~CWaypointDlg ( )
virtual

Destructor.

Definition at line 56 of file CWaypointDlg.cpp.

References DoDataExchange().

Member Function Documentation

void CWaypointDlg::DoDataExchange ( CDataExchange *  aDataExchange)
privatevirtual
uint16 CWaypointDlg::getCatIds ( )
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.

Returns
The category bit field

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 ( )

Handler for the OK button.

Destroy the window

Definition at line 226 of file CWaypointDlg.cpp.

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.

afx_msg LPARAM CWaypointDlg::OnCategoryListChanged ( WPARAM  ,
LPARAM   
)
private

Handler for EVENT_FMI_CATEGORY_LIST_CHANGED event.

Returns
0, always

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.

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

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

Definition at line 99 of file CWaypointDlg.cpp.

References FALSE, IDC_WPT_BTN_SEND, TRUE, updateCatBox(), and updateListBox().

afx_msg LPARAM CWaypointDlg::OnWaypointListChanged ( WPARAM  ,
LPARAM   
)
private

Handler for EVENT_FMI_WAYPOINT_LIST_CHANGED event.

Returns
0, always

Definition at line 179 of file CWaypointDlg.cpp.

References updateListBox().

void CWaypointDlg::PostNcDestroy ( )
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().

void CWaypointDlg::updateCatBox ( )
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().

void CWaypointDlg::updateListBox ( )
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().

Member Data Documentation

CString CWaypointDlg::mCat
private

Waypoint category entered by the user.

Definition at line 74 of file CWaypointDlg.h.

Referenced by DoDataExchange(), and OnBnClickedWptBtnCreateCat().

CListBox CWaypointDlg::mCatBox
private

List box containing waypoint categories sent to the client.

Definition at line 86 of file CWaypointDlg.h.

Referenced by DoDataExchange(), getCatIds(), and updateCatBox().

unsigned int CWaypointDlg::mCatId
private

Waypoint category ID entered by the user.

Definition at line 89 of file CWaypointDlg.h.

Referenced by DoDataExchange(), and OnBnClickedWptBtnCreateCat().

FmiApplicationLayer& CWaypointDlg::mCom
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().

CString CWaypointDlg::mComment
private

Waypoint comment entered by the user.

Definition at line 80 of file CWaypointDlg.h.

Referenced by DoDataExchange(), and OnBnClickedWptBtnSend().

double CWaypointDlg::mLat
private

Waypoint latitude in decimal degrees.

Definition at line 65 of file CWaypointDlg.h.

Referenced by DoDataExchange(), and OnBnClickedWptBtnSend().

CListBox CWaypointDlg::mListBox
private

List box containing waypoints sent to the client.

Definition at line 83 of file CWaypointDlg.h.

Referenced by DoDataExchange(), OnBnClickedWptBtnDelete(), and updateListBox().

double CWaypointDlg::mLon
private

Waypoint longitude in decimal degrees.

Definition at line 68 of file CWaypointDlg.h.

Referenced by DoDataExchange(), and OnBnClickedWptBtnSend().

CString CWaypointDlg::mName
private

Waypoint name entered by the user.

Definition at line 77 of file CWaypointDlg.h.

Referenced by DoDataExchange(), OnBnClickedWptBtnSend(), and OnEnChangeWptEdit().

UINT CWaypointDlg::mSymbol
private

Waypoint symbol entered by the user.

Definition at line 71 of file CWaypointDlg.h.

Referenced by DoDataExchange(), and OnBnClickedWptBtnSend().

UINT CWaypointDlg::mWptId
private

Waypoint ID entered by the user.

Definition at line 62 of file CWaypointDlg.h.

Referenced by DoDataExchange(), and OnBnClickedWptBtnSend().


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