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
Diff: src/ConfigurationHandler/ConfigurationHandler.cpp
- Revision:
- 230:11765008ff3a
- Parent:
- 221:2a5e9902003c
- Child:
- 231:f22901955e0c
diff -r 0d6755d765fd -r 11765008ff3a src/ConfigurationHandler/ConfigurationHandler.cpp --- a/src/ConfigurationHandler/ConfigurationHandler.cpp Tue Oct 18 14:18:30 2016 +0000 +++ b/src/ConfigurationHandler/ConfigurationHandler.cpp Tue Oct 18 20:23:31 2016 +0000 @@ -16,7 +16,7 @@ StringVectorTimerMap timerTable; // timer control object table StringManualMap manualTable; // manual control object table StringCompositeMap compositeTable; // composite control object table -StringAlgorithmMap algorithmTable; // composite control algorithms +StringAlgorithmMap algorithmTable; // composite control algorithms // local function prototypes static int loadPersistentControls(void); @@ -113,7 +113,7 @@ pos->second->display(); } } - + if ( !compositeTable.empty() ) { printf("\r\n"); StringCompositeMap::iterator pos; @@ -126,7 +126,7 @@ void ConfigurationHandler_showAlgorithms(void) { StringAlgorithmMap::iterator pos; - + for ( pos = algorithmTable.begin(); pos != algorithmTable.end(); ++pos ) { pos->second->display(); } @@ -174,6 +174,26 @@ } else { printf("\r control %s loaded.\n", msg.controlFile); } + } else if ( strncmp( i->name, CONTROL_COMP_STR, strlen(CONTROL_COMP_STR)) == 0 ) { + Message_t msg; + msg.control = CONTROL_COMPOSITE; + strncpy(msg.controlFile, i->name, sizeof(msg.controlFile)); + int rc = createControl(&msg); + if ( rc != 0 ) { + logError("%s: failed to load %s\n", __func__, msg.controlFile); + } else { + printf("\r control %s loaded.\n", msg.controlFile); + } + } else if ( strncmp( i->name, CONTROL_CA_STR, strlen(CONTROL_CA_STR)) == 0 ) { + Message_t msg; + msg.control = CONTROL_ALGORITHM; + strncpy(msg.controlFile, i->name, sizeof(msg.controlFile)); + int rc = createControl(&msg); + if ( rc != 0 ) { + logError("%s: failed to load %s\n", __func__, msg.controlFile); + } else { + printf("\r control %s loaded.\n", msg.controlFile); + } } else if ( strncmp( i->name, CONTROL_MN_STR, strlen(CONTROL_MN_STR)) == 0 ) { // TODO: delete any timed manual control, not continuous... GLOBAL_mdot->deleteUserFile(i->name); @@ -260,7 +280,7 @@ if ( rc != true ) { logError("%s: failed to load %s\n", __func__, msg->controlFile); } else { - // add this algorithm to the table + // add this algorithm to the table algorithmTable[compositeAlgorithm->getId()] = compositeAlgorithm; } break;