Garmin Fleet Management Controller
2.19.0
|
Modal dialog allowing the user to throttle (disable) or un-throttle (enable) certain client-initiated protocols. More...
#include <CMsgThrottlingDlg.h>
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... | |
FmiApplicationLayer & | mCom |
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... | |
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.
Definition at line 33 of file CMsgThrottlingDlg.h.
CMsgThrottlingDlg::CMsgThrottlingDlg | ( | CWnd * | aParent, |
FmiApplicationLayer & | aCom | ||
) |
Constructor.
aParent | The parent of this dialog |
aCom | Reference to the FMI communication controller |
Definition at line 33 of file CMsgThrottlingDlg.cpp.
|
virtual |
|
protectedvirtual |
Perform dialog data exchange and validation.
aDataExchange | The DDX context |
Definition at line 65 of file CMsgThrottlingDlg.cpp.
References IDC_THROTTLE_CHK_CLIENT_TO_SERVER_OPEN_TXT_MSG, IDC_THROTTLE_CHK_DRIVER_ID_UPDATE, IDC_THROTTLE_CHK_DRIVER_STATUS_LIST_REFRESH, IDC_THROTTLE_CHK_DRIVER_STATUS_UPDATE, IDC_THROTTLE_CHK_ETA, IDC_THROTTLE_CHK_MESSAGE_STATUS, IDC_THROTTLE_CHK_PING, IDC_THROTTLE_CHK_REFRESH_CAN_MSG_LIST, IDC_THROTTLE_CHK_REFRESH_CAN_RESP, IDC_THROTTLE_CHK_STOP_STATUS, IDC_THROTTLE_CHK_WAYPOINT_DELETED, mClientToServerTextMessage, mDriverIdUpdate, mDriverStatusList, mDriverStatusUpdate, mEta, mMessageStatus, mPing, mRefreshCannedMessageList, mRefreshCannedResponseList, mSelectAll, mStopStatus, and mWaypointDeleted.
Referenced by ~CMsgThrottlingDlg().
|
protected |
Click handler for the Back button; closes the dialog.
Definition at line 144 of file CMsgThrottlingDlg.cpp.
|
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.
|
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.
|
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 |
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.
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.
|
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.
aResponseCount | The number of protocols in the query response |
aResponseList | Pointer to a message_throttling_data_type containing the response |
Definition at line 210 of file CMsgThrottlingDlg.cpp.
References FALSE, mOriginalValues, mPacketIdLookup, mProtocolStateLookup, NUM_THROTTLED_PROTOCOLS, and TRUE.
Referenced by OnBnClickedCheckAll().
|
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().
|
protected |
Reference to the FMI communication controller.
Definition at line 66 of file CMsgThrottlingDlg.h.
Referenced by OnBnClickedUpdate(), and OnInitDialog().
|
protected |
If TRUE, the Driver ID Update check box is selected.
Definition at line 102 of file CMsgThrottlingDlg.h.
Referenced by DoDataExchange(), and OnInitDialog().
|
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().
|
protected |
If TRUE, the Driver Status Update check box is selected.
Definition at line 108 of file CMsgThrottlingDlg.h.
Referenced by DoDataExchange(), and OnInitDialog().
|
protected |
If TRUE, the ETA check box is selected.
Definition at line 99 of file CMsgThrottlingDlg.h.
Referenced by DoDataExchange(), and OnInitDialog().
|
protected |
If TRUE, the Message Status check box is selected.
Definition at line 84 of file CMsgThrottlingDlg.h.
Referenced by DoDataExchange(), and OnInitDialog().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
protected |
If TRUE, the Select All check box is selected.
Definition at line 117 of file CMsgThrottlingDlg.h.
Referenced by DoDataExchange(), and OnBnClickedCheckAll().
|
protected |
If TRUE, the Stop Status check box is selected.
Definition at line 96 of file CMsgThrottlingDlg.h.
Referenced by DoDataExchange(), and OnInitDialog().
|
protected |
If TRUE, the Waypoint Deleted check box is selected.
Definition at line 114 of file CMsgThrottlingDlg.h.
Referenced by DoDataExchange(), and OnInitDialog().