From f8dce83b6ac061a88ec42a26e4aa9b2fdca20ac9 Mon Sep 17 00:00:00 2001 From: john30 Date: Sun, 13 Mar 2016 15:05:42 +0100 Subject: [PATCH] introduced instructions, added "include" and "load" instructions for including/loading configuration data depending on conditions, added support for on-the-fly creation of conditions, added support for string based conditions --- src/ebusd/main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ebusd/main.cpp b/src/ebusd/main.cpp index 75b30181..9868d841 100644 --- a/src/ebusd/main.cpp +++ b/src/ebusd/main.cpp @@ -668,6 +668,10 @@ result_t loadConfigFiles(MessageMap* messages, bool verbose, bool denyRecursive) if (result != RESULT_OK) logError(lf_main, "error resolving conditions: %s, %s", getResultCode(result), messages->getLastError().c_str()); + result = messages->executeInstructions(verbose); + if (result != RESULT_OK) + logError(lf_main, "error executing instructions: %s, %s", getResultCode(result), messages->getLastError().c_str()); + logNotice(lf_main, "found messages: %d (%d conditional on %d conditions, %d poll, %d update)", messages->size(), messages->sizeConditional(), messages->sizeConditions(), messages->sizePoll(), messages->sizePassive()); return result; @@ -832,10 +836,15 @@ result_t loadScanConfigFile(MessageMap* messages, unsigned char address, SymbolS return result; } logNotice(lf_main, "read scan config file %s for ID \"%s\", SW%s, HW%s", best.c_str(), ident.c_str(), sw.c_str(), hw.c_str()); + result = messages->resolveConditions(false); if (result != RESULT_OK) logError(lf_main, "error resolving conditions: %s, %s", getResultCode(result), messages->getLastError().c_str()); + result = messages->executeInstructions(false); + if (result != RESULT_OK) + logError(lf_main, "error executing instructions: %s, %s", getResultCode(result), messages->getLastError().c_str()); + logNotice(lf_main, "found messages: %d (%d conditional on %d conditions, %d poll, %d update)", messages->size(), messages->sizeConditional(), messages->sizeConditions(), messages->sizePoll(), messages->sizePassive()); relativeFile = best.substr(strlen(opt.configPath)+1); return RESULT_OK;