Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: NaturalTinyShell_ice libmDot-12Sept mbed-rtos mbed
Fork of ICE by
src/ConfigurationHandler/ConfigurationHandler.cpp@126:c85ac6a8e9af, 2016-09-23 (annotated)
- Committer:
- jmarkel44
- Date:
- Fri Sep 23 16:13:20 2016 +0000
- Revision:
- 126:c85ac6a8e9af
- Parent:
- 122:4db48b933115
- Child:
- 152:c03ebcda54ef
- Child:
- 156:44f87c5a83ae
- Child:
- 162:5e8948b8044d
updates to timer control;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jmarkel44 | 0:65cfa4873284 | 1 | /****************************************************************************** |
jmarkel44 | 0:65cfa4873284 | 2 | * |
jmarkel44 | 0:65cfa4873284 | 3 | * File: ConfigurationHandler.cpp |
jmarkel44 | 0:65cfa4873284 | 4 | * Desciption: source for the ICE Configuration Handler |
jmarkel44 | 0:65cfa4873284 | 5 | * |
jmarkel44 | 0:65cfa4873284 | 6 | *****************************************************************************/ |
jmarkel44 | 3:8ea4db957749 | 7 | #include "ConfigurationHandler.h" |
jmarkel44 | 0:65cfa4873284 | 8 | #include "global.h" |
jmarkel44 | 5:5e77a1db4d45 | 9 | #include "SetpointControl.h" |
jmarkel44 | 12:ea87887ca7ad | 10 | #include "TimerControl.h" |
jmarkel44 | 12:ea87887ca7ad | 11 | |
jmarkel44 | 46:4cb96ab2d1c8 | 12 | StringSetpointMap setpointTable; // setpoint control object table |
jmarkel44 | 46:4cb96ab2d1c8 | 13 | StringTimerMap timerTable; // timer control object table |
jmarkel44 | 97:5cf6ab71dcd0 | 14 | StringManualMap manualTable; // manual control object table |
jmarkel44 | 5:5e77a1db4d45 | 15 | |
jmarkel44 | 5:5e77a1db4d45 | 16 | // local function prototypes |
jmarkel44 | 5:5e77a1db4d45 | 17 | static int loadPersistentControls(void); |
jmarkel44 | 5:5e77a1db4d45 | 18 | |
jmarkel44 | 74:03ccf04998b5 | 19 | // local helper functions |
jmarkel44 | 5:5e77a1db4d45 | 20 | static int createControl(const Message_t *msg); |
jmarkel44 | 5:5e77a1db4d45 | 21 | static int modifyControl(const Message_t *msg); |
jmarkel44 | 5:5e77a1db4d45 | 22 | static int destroyControl(const Message_t *msg); |
jmarkel44 | 5:5e77a1db4d45 | 23 | |
jmarkel44 | 12:ea87887ca7ad | 24 | /***************************************************************************** |
jmarkel44 | 12:ea87887ca7ad | 25 | * Function: ConfigurationHandler() |
jmarkel44 | 12:ea87887ca7ad | 26 | * Description: The ICE Configuration Handler |
jmarkel44 | 12:ea87887ca7ad | 27 | * |
jmarkel44 | 12:ea87887ca7ad | 28 | * @param args (unused) |
jmarkel44 | 12:ea87887ca7ad | 29 | * @return none |
jmarkel44 | 12:ea87887ca7ad | 30 | *****************************************************************************/ |
jmarkel44 | 0:65cfa4873284 | 31 | void ConfigurationHandler(void const *args) |
jmarkel44 | 0:65cfa4873284 | 32 | { |
jmarkel44 | 12:ea87887ca7ad | 33 | UNUSED(args); |
jmarkel44 | 5:5e77a1db4d45 | 34 | loadPersistentControls(); |
jmarkel44 | 75:96512ccc0443 | 35 | osSignalSet(mainThreadId, sig_config_continue); |
jmarkel44 | 5:5e77a1db4d45 | 36 | |
jmarkel44 | 3:8ea4db957749 | 37 | while ( true ) { |
jmarkel44 | 5:5e77a1db4d45 | 38 | // wait for an event |
jmarkel44 | 5:5e77a1db4d45 | 39 | osEvent evt = MailBox.get(); |
jmarkel44 | 5:5e77a1db4d45 | 40 | if (evt.status == osEventMail) { |
jmarkel44 | 5:5e77a1db4d45 | 41 | Message_t *msg = (Message_t*) evt.value.p; |
jmarkel44 | 5:5e77a1db4d45 | 42 | |
jmarkel44 | 37:7e6986b77f01 | 43 | logInfo("\r%s: mes->action = %d\n", __func__, msg->action); |
jmarkel44 | 37:7e6986b77f01 | 44 | logInfo("\r%s: msg->control = %d\n", __func__, msg->control); |
jmarkel44 | 37:7e6986b77f01 | 45 | logInfo("\r%s: msg->controlFile = %s\n", __func__, msg->controlFile); |
jmarkel44 | 5:5e77a1db4d45 | 46 | |
jmarkel44 | 5:5e77a1db4d45 | 47 | switch ( msg->action ) { |
jmarkel44 | 5:5e77a1db4d45 | 48 | case ACTION_CREATE: { |
jmarkel44 | 5:5e77a1db4d45 | 49 | (void)createControl(msg); |
jmarkel44 | 5:5e77a1db4d45 | 50 | break; |
jmarkel44 | 5:5e77a1db4d45 | 51 | } |
jmarkel44 | 5:5e77a1db4d45 | 52 | case ACTION_MODIFY: { |
jmarkel44 | 5:5e77a1db4d45 | 53 | (void)modifyControl(msg); |
jmarkel44 | 5:5e77a1db4d45 | 54 | break; |
jmarkel44 | 5:5e77a1db4d45 | 55 | } |
jmarkel44 | 5:5e77a1db4d45 | 56 | case ACTION_DESTROY: { |
jmarkel44 | 5:5e77a1db4d45 | 57 | (void)destroyControl(msg); |
jmarkel44 | 5:5e77a1db4d45 | 58 | break; |
jmarkel44 | 5:5e77a1db4d45 | 59 | } |
jmarkel44 | 5:5e77a1db4d45 | 60 | default: |
jmarkel44 | 5:5e77a1db4d45 | 61 | break; |
jmarkel44 | 5:5e77a1db4d45 | 62 | } |
jmarkel44 | 5:5e77a1db4d45 | 63 | |
jmarkel44 | 5:5e77a1db4d45 | 64 | // free the message |
jmarkel44 | 5:5e77a1db4d45 | 65 | MailBox.free(msg); |
jmarkel44 | 5:5e77a1db4d45 | 66 | } |
jmarkel44 | 0:65cfa4873284 | 67 | } |
jmarkel44 | 0:65cfa4873284 | 68 | } |
jmarkel44 | 5:5e77a1db4d45 | 69 | |
jmarkel44 | 12:ea87887ca7ad | 70 | /***************************************************************************** |
jmarkel44 | 12:ea87887ca7ad | 71 | * Function: ConfigurationHandler_showControls() |
jmarkel44 | 13:c80c283f9db2 | 72 | * Description: show the controls |
jmarkel44 | 12:ea87887ca7ad | 73 | * |
jmarkel44 | 12:ea87887ca7ad | 74 | * @param msg |
jmarkel44 | 12:ea87887ca7ad | 75 | * @return none |
jmarkel44 | 12:ea87887ca7ad | 76 | *****************************************************************************/ |
jmarkel44 | 12:ea87887ca7ad | 77 | void ConfigurationHandler_showControls(void) |
jmarkel44 | 12:ea87887ca7ad | 78 | { |
jmarkel44 | 12:ea87887ca7ad | 79 | if ( !timerTable.empty() ) { |
jmarkel44 | 12:ea87887ca7ad | 80 | printf("\rTIMER CONTROLS\n"); |
jmarkel44 | 12:ea87887ca7ad | 81 | StringTimerMap::iterator pos; |
jmarkel44 | 46:4cb96ab2d1c8 | 82 | for ( pos = timerTable.begin(); pos != timerTable.end(); ++pos ) { |
jmarkel44 | 122:4db48b933115 | 83 | pos->second->display(); |
jmarkel44 | 12:ea87887ca7ad | 84 | } |
jmarkel44 | 12:ea87887ca7ad | 85 | } |
jmarkel44 | 74:03ccf04998b5 | 86 | |
jmarkel44 | 12:ea87887ca7ad | 87 | if ( !setpointTable.empty() ) { |
jmarkel44 | 12:ea87887ca7ad | 88 | printf("\rSETPOINT CONTROLS\n"); |
jmarkel44 | 12:ea87887ca7ad | 89 | StringSetpointMap::iterator pos; |
jmarkel44 | 93:1553fb156915 | 90 | for ( pos = setpointTable.begin(); pos != setpointTable.end(); ++pos ) { |
jmarkel44 | 93:1553fb156915 | 91 | pos->second->display(); |
jmarkel44 | 12:ea87887ca7ad | 92 | } |
jmarkel44 | 12:ea87887ca7ad | 93 | } |
jmarkel44 | 121:650205ffa656 | 94 | |
jmarkel44 | 97:5cf6ab71dcd0 | 95 | if ( !manualTable.empty() ) { |
jmarkel44 | 97:5cf6ab71dcd0 | 96 | printf("MANUAL CONTROLS\n"); |
jmarkel44 | 97:5cf6ab71dcd0 | 97 | StringManualMap::iterator pos; |
jmarkel44 | 97:5cf6ab71dcd0 | 98 | for ( pos = manualTable.begin(); pos != manualTable.end(); ++pos ) { |
jmarkel44 | 97:5cf6ab71dcd0 | 99 | pos->second->display(); |
jmarkel44 | 97:5cf6ab71dcd0 | 100 | } |
jmarkel44 | 97:5cf6ab71dcd0 | 101 | } |
jmarkel44 | 12:ea87887ca7ad | 102 | } |
jmarkel44 | 12:ea87887ca7ad | 103 | |
jmarkel44 | 12:ea87887ca7ad | 104 | /***************************************************************************** |
jmarkel44 | 12:ea87887ca7ad | 105 | * Function: loadPersistentControls() |
jmarkel44 | 12:ea87887ca7ad | 106 | * Description: load persistent controls from flash |
jmarkel44 | 12:ea87887ca7ad | 107 | * |
jmarkel44 | 12:ea87887ca7ad | 108 | * @param none |
jmarkel44 | 12:ea87887ca7ad | 109 | * @return none |
jmarkel44 | 12:ea87887ca7ad | 110 | *****************************************************************************/ |
jmarkel44 | 12:ea87887ca7ad | 111 | static int loadPersistentControls(void) |
jmarkel44 | 12:ea87887ca7ad | 112 | { |
jmarkel44 | 12:ea87887ca7ad | 113 | static bool loaded = false; |
jmarkel44 | 12:ea87887ca7ad | 114 | |
jmarkel44 | 12:ea87887ca7ad | 115 | if ( !loaded ) { // lazy protection |
jmarkel44 | 121:650205ffa656 | 116 | |
jmarkel44 | 77:43e0a3d9e536 | 117 | printf("\rLoading persistent controls: \n"); |
jmarkel44 | 74:03ccf04998b5 | 118 | std::vector<mDot::mdot_file> file_list = GLOBAL_mdot->listUserFiles(); |
jmarkel44 | 126:c85ac6a8e9af | 119 | |
jmarkel44 | 126:c85ac6a8e9af | 120 | loaded = true; |
jmarkel44 | 74:03ccf04998b5 | 121 | |
jmarkel44 | 74:03ccf04998b5 | 122 | for (std::vector<mDot::mdot_file>::iterator i = file_list.begin(); i != file_list.end(); ++i) { |
jmarkel44 | 74:03ccf04998b5 | 123 | if( strncmp( i->name, CONTROL_SP_STR, strlen(CONTROL_SP_STR)) == 0 ) { |
jmarkel44 | 77:43e0a3d9e536 | 124 | // create the setpoint control |
jmarkel44 | 74:03ccf04998b5 | 125 | Message_t msg; |
jmarkel44 | 74:03ccf04998b5 | 126 | msg.control = CONTROL_SETPOINT; |
jmarkel44 | 74:03ccf04998b5 | 127 | strncpy(msg.controlFile, i->name, sizeof(msg.controlFile)); |
jmarkel44 | 74:03ccf04998b5 | 128 | int rc = createControl(&msg); |
jmarkel44 | 74:03ccf04998b5 | 129 | if ( rc != 0 ) { |
jmarkel44 | 121:650205ffa656 | 130 | logError("%s: failed to load %s", __func__, msg.controlFile); |
jmarkel44 | 74:03ccf04998b5 | 131 | } else { |
jmarkel44 | 74:03ccf04998b5 | 132 | printf("\r control %s loaded.\n", msg.controlFile); |
jmarkel44 | 74:03ccf04998b5 | 133 | } |
jmarkel44 | 74:03ccf04998b5 | 134 | } else if ( strncmp( i->name, CONTROL_TM_STR, strlen(CONTROL_TM_STR)) == 0 ) { |
jmarkel44 | 121:650205ffa656 | 135 | // create the timer control |
jmarkel44 | 74:03ccf04998b5 | 136 | Message_t msg; |
jmarkel44 | 74:03ccf04998b5 | 137 | msg.control = CONTROL_TIMER; |
jmarkel44 | 74:03ccf04998b5 | 138 | strncpy(msg.controlFile, i->name, sizeof(msg.controlFile)); |
jmarkel44 | 74:03ccf04998b5 | 139 | int rc = createControl(&msg); |
jmarkel44 | 74:03ccf04998b5 | 140 | if ( rc != 0 ) { |
jmarkel44 | 121:650205ffa656 | 141 | logError("%s: failed to load %s", __func__, msg.controlFile); |
jmarkel44 | 121:650205ffa656 | 142 | |
jmarkel44 | 74:03ccf04998b5 | 143 | } else { |
jmarkel44 | 74:03ccf04998b5 | 144 | printf("\r control %s loaded.\n", msg.controlFile); |
jmarkel44 | 74:03ccf04998b5 | 145 | } |
jmarkel44 | 74:03ccf04998b5 | 146 | } else if ( strncmp( i->name, CONTROL_MN_STR, strlen(CONTROL_MN_STR)) == 0 ) { |
jmarkel44 | 126:c85ac6a8e9af | 147 | // TODO: delete any timed manual control, not continuous... |
jmarkel44 | 126:c85ac6a8e9af | 148 | GLOBAL_mdot->deleteUserFile(i->name); |
jmarkel44 | 74:03ccf04998b5 | 149 | } else { |
jmarkel44 | 74:03ccf04998b5 | 150 | // not a control file |
jmarkel44 | 74:03ccf04998b5 | 151 | } |
jmarkel44 | 74:03ccf04998b5 | 152 | } |
jmarkel44 | 12:ea87887ca7ad | 153 | } |
jmarkel44 | 12:ea87887ca7ad | 154 | return 0; |
jmarkel44 | 12:ea87887ca7ad | 155 | } |
jmarkel44 | 12:ea87887ca7ad | 156 | |
jmarkel44 | 12:ea87887ca7ad | 157 | /***************************************************************************** |
jmarkel44 | 12:ea87887ca7ad | 158 | * Function: createControl() |
jmarkel44 | 12:ea87887ca7ad | 159 | * Description: creates a new control |
jmarkel44 | 12:ea87887ca7ad | 160 | * |
jmarkel44 | 12:ea87887ca7ad | 161 | * @param none |
jmarkel44 | 12:ea87887ca7ad | 162 | * @return none |
jmarkel44 | 12:ea87887ca7ad | 163 | *****************************************************************************/ |
jmarkel44 | 5:5e77a1db4d45 | 164 | static int createControl(const Message_t *msg) |
jmarkel44 | 5:5e77a1db4d45 | 165 | { |
jmarkel44 | 37:7e6986b77f01 | 166 | logInfo("\r%s invoked\n", __func__); |
jmarkel44 | 5:5e77a1db4d45 | 167 | |
jmarkel44 | 5:5e77a1db4d45 | 168 | switch (msg->control) { |
jmarkel44 | 5:5e77a1db4d45 | 169 | case CONTROL_SETPOINT: { |
jmarkel44 | 46:4cb96ab2d1c8 | 170 | SetpointControl *setpointControl = new SetpointControl; |
jmarkel44 | 28:c410a61238bb | 171 | bool rc = setpointControl->load(msg->controlFile); |
jmarkel44 | 19:9bc8fabeddfa | 172 | if ( rc != true ) { |
jmarkel44 | 19:9bc8fabeddfa | 173 | logError("%s: failed to load %s\n", __func__, msg->controlFile); |
jmarkel44 | 19:9bc8fabeddfa | 174 | delete setpointControl; |
jmarkel44 | 19:9bc8fabeddfa | 175 | } else { |
jmarkel44 | 19:9bc8fabeddfa | 176 | setpointTable[msg->controlFile] = setpointControl; |
jmarkel44 | 74:03ccf04998b5 | 177 | // start the setpoint control |
jmarkel44 | 74:03ccf04998b5 | 178 | setpointControl->start(); |
jmarkel44 | 19:9bc8fabeddfa | 179 | } |
jmarkel44 | 5:5e77a1db4d45 | 180 | break; |
jmarkel44 | 5:5e77a1db4d45 | 181 | } |
jmarkel44 | 5:5e77a1db4d45 | 182 | case CONTROL_TIMER: { |
jmarkel44 | 46:4cb96ab2d1c8 | 183 | TimerControl *timerControl = new TimerControl; |
jmarkel44 | 28:c410a61238bb | 184 | bool rc = timerControl->load(msg->controlFile); |
jmarkel44 | 19:9bc8fabeddfa | 185 | if ( rc != true ) { |
jmarkel44 | 19:9bc8fabeddfa | 186 | logError("%s: failed to load %s\n", __func__, msg->controlFile); |
jmarkel44 | 19:9bc8fabeddfa | 187 | delete timerControl; |
jmarkel44 | 19:9bc8fabeddfa | 188 | } else { |
jmarkel44 | 19:9bc8fabeddfa | 189 | timerTable[msg->controlFile] = timerControl; |
jmarkel44 | 126:c85ac6a8e9af | 190 | // start the timer control |
jmarkel44 | 126:c85ac6a8e9af | 191 | timerControl->start(); |
jmarkel44 | 19:9bc8fabeddfa | 192 | } |
jmarkel44 | 5:5e77a1db4d45 | 193 | break; |
jmarkel44 | 5:5e77a1db4d45 | 194 | } |
jmarkel44 | 46:4cb96ab2d1c8 | 195 | case CONTROL_MANUAL: { |
jmarkel44 | 46:4cb96ab2d1c8 | 196 | ManualControl *manualControl = new ManualControl; |
jmarkel44 | 46:4cb96ab2d1c8 | 197 | bool rc = manualControl->load(msg->controlFile); |
jmarkel44 | 46:4cb96ab2d1c8 | 198 | if ( rc != true ) { |
jmarkel44 | 46:4cb96ab2d1c8 | 199 | logError("%s: failed to load %s\n", __func__, msg->controlFile); |
jmarkel44 | 46:4cb96ab2d1c8 | 200 | delete manualControl; |
jmarkel44 | 46:4cb96ab2d1c8 | 201 | } else { |
jmarkel44 | 46:4cb96ab2d1c8 | 202 | manualTable[msg->controlFile] = manualControl; |
jmarkel44 | 97:5cf6ab71dcd0 | 203 | // start the manual control |
jmarkel44 | 97:5cf6ab71dcd0 | 204 | manualControl->start(); |
jmarkel44 | 46:4cb96ab2d1c8 | 205 | } |
jmarkel44 | 46:4cb96ab2d1c8 | 206 | break; |
jmarkel44 | 46:4cb96ab2d1c8 | 207 | } |
jmarkel44 | 19:9bc8fabeddfa | 208 | case CONTROL_PID: |
jmarkel44 | 19:9bc8fabeddfa | 209 | case CONTROL_COMPOSITE: |
jmarkel44 | 5:5e77a1db4d45 | 210 | default: |
jmarkel44 | 46:4cb96ab2d1c8 | 211 | logInfo("\r%s: control type %d not implemented yet...\n", |
jmarkel44 | 46:4cb96ab2d1c8 | 212 | __func__, msg->control); |
jmarkel44 | 5:5e77a1db4d45 | 213 | break; |
jmarkel44 | 5:5e77a1db4d45 | 214 | } |
jmarkel44 | 5:5e77a1db4d45 | 215 | return 0; |
jmarkel44 | 5:5e77a1db4d45 | 216 | } |
jmarkel44 | 12:ea87887ca7ad | 217 | |
jmarkel44 | 12:ea87887ca7ad | 218 | /***************************************************************************** |
jmarkel44 | 12:ea87887ca7ad | 219 | * Function: modifyControl() |
jmarkel44 | 12:ea87887ca7ad | 220 | * Description: modifies a control |
jmarkel44 | 12:ea87887ca7ad | 221 | * |
jmarkel44 | 12:ea87887ca7ad | 222 | * @param msg |
jmarkel44 | 12:ea87887ca7ad | 223 | * @return none |
jmarkel44 | 12:ea87887ca7ad | 224 | *****************************************************************************/ |
jmarkel44 | 5:5e77a1db4d45 | 225 | static int modifyControl(const Message_t *msg) |
jmarkel44 | 5:5e77a1db4d45 | 226 | { |
jmarkel44 | 37:7e6986b77f01 | 227 | logInfo("\r%s invoked\n", __func__); |
jmarkel44 | 46:4cb96ab2d1c8 | 228 | |
jmarkel44 | 46:4cb96ab2d1c8 | 229 | // TODO: can we delete the current object and start a new one? |
jmarkel44 | 5:5e77a1db4d45 | 230 | return 0; |
jmarkel44 | 5:5e77a1db4d45 | 231 | |
jmarkel44 | 5:5e77a1db4d45 | 232 | } |
jmarkel44 | 12:ea87887ca7ad | 233 | |
jmarkel44 | 12:ea87887ca7ad | 234 | /***************************************************************************** |
jmarkel44 | 12:ea87887ca7ad | 235 | * Function: destroyControl() |
jmarkel44 | 12:ea87887ca7ad | 236 | * Description: destroys a controls |
jmarkel44 | 12:ea87887ca7ad | 237 | * |
jmarkel44 | 12:ea87887ca7ad | 238 | * @param msg |
jmarkel44 | 12:ea87887ca7ad | 239 | * @return none |
jmarkel44 | 12:ea87887ca7ad | 240 | *****************************************************************************/ |
jmarkel44 | 5:5e77a1db4d45 | 241 | static int destroyControl(const Message_t *msg) |
jmarkel44 | 5:5e77a1db4d45 | 242 | { |
jmarkel44 | 37:7e6986b77f01 | 243 | logInfo("\r%s invoked\n", __func__); |
jmarkel44 | 12:ea87887ca7ad | 244 | |
jmarkel44 | 12:ea87887ca7ad | 245 | switch ( msg->control ) { |
jmarkel44 | 12:ea87887ca7ad | 246 | case CONTROL_SETPOINT: { |
jmarkel44 | 12:ea87887ca7ad | 247 | StringSetpointMap::iterator pos; |
jmarkel44 | 12:ea87887ca7ad | 248 | pos = setpointTable.find(msg->controlFile); |
jmarkel44 | 12:ea87887ca7ad | 249 | if ( pos != setpointTable.end() ) { |
jmarkel44 | 74:03ccf04998b5 | 250 | pos->second->unregisterControl(); |
jmarkel44 | 12:ea87887ca7ad | 251 | delete (pos->second); |
jmarkel44 | 12:ea87887ca7ad | 252 | setpointTable.erase(pos); |
jmarkel44 | 12:ea87887ca7ad | 253 | } |
jmarkel44 | 12:ea87887ca7ad | 254 | break; |
jmarkel44 | 12:ea87887ca7ad | 255 | } |
jmarkel44 | 12:ea87887ca7ad | 256 | case CONTROL_TIMER: { |
jmarkel44 | 12:ea87887ca7ad | 257 | StringTimerMap::iterator pos; |
jmarkel44 | 12:ea87887ca7ad | 258 | pos = timerTable.find(msg->controlFile); |
jmarkel44 | 12:ea87887ca7ad | 259 | if ( pos != timerTable.end() ) { |
jmarkel44 | 12:ea87887ca7ad | 260 | delete (pos->second); |
jmarkel44 | 12:ea87887ca7ad | 261 | timerTable.erase(pos); |
jmarkel44 | 12:ea87887ca7ad | 262 | } |
jmarkel44 | 12:ea87887ca7ad | 263 | break; |
jmarkel44 | 12:ea87887ca7ad | 264 | } |
jmarkel44 | 46:4cb96ab2d1c8 | 265 | case CONTROL_MANUAL: { |
jmarkel44 | 46:4cb96ab2d1c8 | 266 | StringManualMap::iterator pos; |
jmarkel44 | 46:4cb96ab2d1c8 | 267 | pos = manualTable.find(msg->controlFile); |
jmarkel44 | 46:4cb96ab2d1c8 | 268 | if ( pos != manualTable.end() ) { |
jmarkel44 | 97:5cf6ab71dcd0 | 269 | pos->second->unregisterControl(); |
jmarkel44 | 46:4cb96ab2d1c8 | 270 | delete (pos->second); |
jmarkel44 | 46:4cb96ab2d1c8 | 271 | manualTable.erase(pos); |
jmarkel44 | 46:4cb96ab2d1c8 | 272 | } |
jmarkel44 | 46:4cb96ab2d1c8 | 273 | break; |
jmarkel44 | 46:4cb96ab2d1c8 | 274 | } |
jmarkel44 | 12:ea87887ca7ad | 275 | default: |
jmarkel44 | 12:ea87887ca7ad | 276 | break; |
jmarkel44 | 12:ea87887ca7ad | 277 | } |
jmarkel44 | 12:ea87887ca7ad | 278 | return 0; |
jmarkel44 | 20:653923c2f37a | 279 | } |