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