Garmin Fleet Management Controller  2.19.0
CMsgThrottlingDlg Class Reference

Modal dialog allowing the user to throttle (disable) or un-throttle (enable) certain client-initiated protocols. More...

#include <CMsgThrottlingDlg.h>

+ Inheritance diagram for CMsgThrottlingDlg:

Public Member Functions

 CMsgThrottlingDlg (CWnd *aParent, FmiApplicationLayer &aCom)
 Constructor. More...
 
virtual ~CMsgThrottlingDlg ()
 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 OnBnClickedBack ()
 Click handler for the Back button; closes the dialog. More...
 
afx_msg void OnBnClickedCheckAll ()
 Click handler for the Select All check box. More...
 
afx_msg void OnBnClickedUpdate ()
 Click handler for the Update button. More...
 
BOOL OnInitDialog ()
 Initialize the dialog. More...
 
afx_msg LRESULT OnThrottleQueryResponse (WPARAM aResponseCount, LPARAM aResponseList)
 Event handler that processes a throttling query response event. More...
 

Protected Attributes

BOOL mClientToServerTextMessage
 If TRUE, the Client to Server Text Message check box is selected. More...
 
FmiApplicationLayermCom
 Reference to the FMI communication controller. More...
 
BOOL mDriverIdUpdate
 If TRUE, the Driver ID Update check box is selected. More...
 
BOOL mDriverStatusList
 If TRUE, the Driver Status List Refresh check box is selected. More...
 
BOOL mDriverStatusUpdate
 If TRUE, the Driver Status Update check box is selected. More...
 
BOOL mEta
 If TRUE, the ETA check box is selected. More...
 
BOOL mMessageStatus
 If TRUE, the Message Status check box is selected. More...
 
BOOL mOriginalValues [NUM_THROTTLED_PROTOCOLS]
 The current throttle state on the client. More...
 
uint16 mPacketIdLookup [NUM_THROTTLED_PROTOCOLS]
 Lookup table from array indexes to protocol (packet) IDs. More...
 
BOOL mPing
 If TRUE, the Client to Server Ping check box is selected. More...
 
BOOL * mProtocolStateLookup [NUM_THROTTLED_PROTOCOLS]
 Pointers to BOOLs indicating the requested throttle state. More...
 
BOOL mRefreshCannedMessageList
 If TRUE, the Refresh Canned Message List check box is selected. More...
 
BOOL mRefreshCannedResponseList
 If TRUE, the Refresh Canned Response List check box is selected. More...
 
BOOL mSelectAll
 If TRUE, the Select All check box is selected. More...
 
BOOL mStopStatus
 If TRUE, the Stop Status check box is selected. More...
 
BOOL mWaypointDeleted
 If TRUE, the Waypoint Deleted check box is selected. More...
 

Detailed Description

Modal dialog allowing the user to throttle (disable) or un-throttle (enable) certain client-initiated protocols.

When this dialog is initialized, the Message Throttling Query protocol is used to determine the current throttle state of each supported protocol on the client; the result is used to set the initial state of each check box. When the OK button is clicked, the current state of each check box is compared to the throttle state received in the Message Throttle Query, and the Message Throttling Command protocol is used to update the client state for any check boxes that have changed.

Note
The Message Throttle Query protocol requires that the client have support for A605.
Since
Protocol A604

Definition at line 33 of file CMsgThrottlingDlg.h.

Constructor & Destructor Documentation

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

Constructor.

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

Definition at line 33 of file CMsgThrottlingDlg.cpp.

CMsgThrottlingDlg::~CMsgThrottlingDlg ( )
virtual

Destructor.

Definition at line 56 of file CMsgThrottlingDlg.cpp.

References DoDataExchange().

Member Function Documentation

void CMsgThrottlingDlg::OnBnClickedBack ( )
protected

Click handler for the Back button; closes the dialog.

Definition at line 144 of file CMsgThrottlingDlg.cpp.

void CMsgThrottlingDlg::OnBnClickedCheckAll ( )
protected

Click handler for the Select All check box.

Select or deselect all boxes on the dialog

Definition at line 184 of file CMsgThrottlingDlg.cpp.

References FALSE, mProtocolStateLookup, mSelectAll, NUM_THROTTLED_PROTOCOLS, OnThrottleQueryResponse(), and TRUE.

void CMsgThrottlingDlg::OnBnClickedUpdate ( )
protected

Click handler for the Update button.

Compare the requested message throttling state for each protocol to the original state received from the client. If a protocol's requested throttle state has changed, send a Message Throttling request to the client to set the new state. Once all requests are ACKed, close the dialog.

Definition at line 157 of file CMsgThrottlingDlg.cpp.

References mCom, MESSAGE_THROTTLE_STATE_DISABLE, MESSAGE_THROTTLE_STATE_ENABLE, mOriginalValues, mPacketIdLookup, mProtocolStateLookup, NUM_THROTTLED_PROTOCOLS, FmiApplicationLayer::sendMessageThrottlingUpdate(), 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 CMsgThrottlingDlg::OnInitDialog ( )
protected

Initialize the dialog.

This function is called when the window is created. It sets up the lookup table to relate protocols to check boxes, then initiates the Message Throttling Query Protocol to get the current throttle status of each protocol.

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

Definition at line 93 of file CMsgThrottlingDlg.cpp.

References FALSE, FMI_ID_CLIENT_OPEN_TXT_MSG, FMI_ID_DRIVER_ID_UPDATE, FMI_ID_DRIVER_STATUS_LIST_REFRESH, FMI_ID_DRIVER_STATUS_UPDATE, FMI_ID_ETA_DATA, FMI_ID_PING, FMI_ID_REFRESH_CANNED_MSG_LIST, FMI_ID_REFRESH_CANNED_RESP_LIST, FMI_ID_STOP_STATUS, FMI_ID_TEXT_MSG_STATUS, FMI_ID_WAYPOINT_DELETED, mClientToServerTextMessage, mCom, mDriverIdUpdate, mDriverStatusList, mDriverStatusUpdate, mEta, mMessageStatus, mOriginalValues, mPacketIdLookup, mPing, mProtocolStateLookup, mRefreshCannedMessageList, mRefreshCannedResponseList, mStopStatus, mWaypointDeleted, NUM_THROTTLED_PROTOCOLS, FmiApplicationLayer::sendMessageThrottlingQuery(), and TRUE.

afx_msg LRESULT CMsgThrottlingDlg::OnThrottleQueryResponse ( WPARAM  aResponseCount,
LPARAM  aResponseList 
)
protected

Event handler that processes a throttling query response event.

For each protocol in the list received, find the corresponding local state value and update it.

Parameters
aResponseCountThe number of protocols in the query response
aResponseListPointer to a message_throttling_data_type containing the response
Returns
0, always
Since
Protocol A605

Definition at line 210 of file CMsgThrottlingDlg.cpp.

References FALSE, mOriginalValues, mPacketIdLookup, mProtocolStateLookup, NUM_THROTTLED_PROTOCOLS, and TRUE.

Referenced by OnBnClickedCheckAll().

Member Data Documentation

BOOL CMsgThrottlingDlg::mClientToServerTextMessage
protected

If TRUE, the Client to Server Text Message check box is selected.

Definition at line 93 of file CMsgThrottlingDlg.h.

Referenced by DoDataExchange(), and OnInitDialog().

FmiApplicationLayer& CMsgThrottlingDlg::mCom
protected

Reference to the FMI communication controller.

Definition at line 66 of file CMsgThrottlingDlg.h.

Referenced by OnBnClickedUpdate(), and OnInitDialog().

BOOL CMsgThrottlingDlg::mDriverIdUpdate
protected

If TRUE, the Driver ID Update check box is selected.

Definition at line 102 of file CMsgThrottlingDlg.h.

Referenced by DoDataExchange(), and OnInitDialog().

BOOL CMsgThrottlingDlg::mDriverStatusList
protected

If TRUE, the Driver Status List Refresh check box is selected.

Definition at line 105 of file CMsgThrottlingDlg.h.

Referenced by DoDataExchange(), and OnInitDialog().

BOOL CMsgThrottlingDlg::mDriverStatusUpdate
protected

If TRUE, the Driver Status Update check box is selected.

Definition at line 108 of file CMsgThrottlingDlg.h.

Referenced by DoDataExchange(), and OnInitDialog().

BOOL CMsgThrottlingDlg::mEta
protected

If TRUE, the ETA check box is selected.

Definition at line 99 of file CMsgThrottlingDlg.h.

Referenced by DoDataExchange(), and OnInitDialog().

BOOL CMsgThrottlingDlg::mMessageStatus
protected

If TRUE, the Message Status check box is selected.

Definition at line 84 of file CMsgThrottlingDlg.h.

Referenced by DoDataExchange(), and OnInitDialog().

BOOL CMsgThrottlingDlg::mOriginalValues[NUM_THROTTLED_PROTOCOLS]
protected

The current throttle state on the client.

mOriginalValues[i] is the current state for the protocol at id_lookup[i].

Definition at line 81 of file CMsgThrottlingDlg.h.

Referenced by OnBnClickedUpdate(), OnInitDialog(), and OnThrottleQueryResponse().

uint16 CMsgThrottlingDlg::mPacketIdLookup[NUM_THROTTLED_PROTOCOLS]
protected

Lookup table from array indexes to protocol (packet) IDs.

mPacketIdLookup[i] is the packet id corresponding to *(mProtocolStateLookup[i]) and mOriginalValues[i]

Definition at line 71 of file CMsgThrottlingDlg.h.

Referenced by OnBnClickedUpdate(), OnInitDialog(), and OnThrottleQueryResponse().

BOOL CMsgThrottlingDlg::mPing
protected

If TRUE, the Client to Server Ping check box is selected.

Definition at line 111 of file CMsgThrottlingDlg.h.

Referenced by DoDataExchange(), and OnInitDialog().

BOOL* CMsgThrottlingDlg::mProtocolStateLookup[NUM_THROTTLED_PROTOCOLS]
protected

Pointers to BOOLs indicating the requested throttle state.

*(boolLookup[i]) is the requested state for the protocol at id_lookup[i].

Definition at line 76 of file CMsgThrottlingDlg.h.

Referenced by OnBnClickedCheckAll(), OnBnClickedUpdate(), OnInitDialog(), and OnThrottleQueryResponse().

BOOL CMsgThrottlingDlg::mRefreshCannedMessageList
protected

If TRUE, the Refresh Canned Message List check box is selected.

Definition at line 90 of file CMsgThrottlingDlg.h.

Referenced by DoDataExchange(), and OnInitDialog().

BOOL CMsgThrottlingDlg::mRefreshCannedResponseList
protected

If TRUE, the Refresh Canned Response List check box is selected.

Definition at line 87 of file CMsgThrottlingDlg.h.

Referenced by DoDataExchange(), and OnInitDialog().

BOOL CMsgThrottlingDlg::mSelectAll
protected

If TRUE, the Select All check box is selected.

Definition at line 117 of file CMsgThrottlingDlg.h.

Referenced by DoDataExchange(), and OnBnClickedCheckAll().

BOOL CMsgThrottlingDlg::mStopStatus
protected

If TRUE, the Stop Status check box is selected.

Definition at line 96 of file CMsgThrottlingDlg.h.

Referenced by DoDataExchange(), and OnInitDialog().

BOOL CMsgThrottlingDlg::mWaypointDeleted
protected

If TRUE, the Waypoint Deleted check box is selected.

Definition at line 114 of file CMsgThrottlingDlg.h.

Referenced by DoDataExchange(), and OnInitDialog().


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