diff --git a/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.cpp b/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.cpp index 076ce5b4..0e2d91c9 100644 --- a/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.cpp +++ b/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.cpp @@ -866,8 +866,6 @@ bool ClassFlowPostProcessing::doFlow(string zwtime) void ClassFlowPostProcessing::WriteDataLog(int _index) { - LogFile.WriteToFile(ESP_LOG_WARN, "Data file writing temporarily disabled, see https://github.com/jomjol/AI-on-the-edge-device/issues/1225"); - return; string analog = ""; string digital = ""; string timezw = ""; @@ -875,7 +873,7 @@ void ClassFlowPostProcessing::WriteDataLog(int _index) struct tm* timeinfo = localtime(&NUMBERS[_index]->lastvalue); strftime(buffer, 80, PREVALUE_TIME_FORMAT_OUTPUT, timeinfo); timezw = std::string(buffer); - + if (flowAnalog) analog = flowAnalog->getReadoutRawString(_index); if (flowDigit) diff --git a/code/test/components/jomjol-flowcontroll/test_flow_postrocess_helper.cpp b/code/test/components/jomjol-flowcontroll/test_flow_postrocess_helper.cpp index 6e20e395..7d577742 100644 --- a/code/test/components/jomjol-flowcontroll/test_flow_postrocess_helper.cpp +++ b/code/test/components/jomjol-flowcontroll/test_flow_postrocess_helper.cpp @@ -82,6 +82,8 @@ UnderTestPost* init_do_flow(std::vector analog, std::vector digits anaROI->result_float = analog[i]; gen_analog->ROI.push_back(anaROI); } + } else { + _undertestPost->flowAnalog = NULL; } ESP_LOGD(TAG, "Setting up of ROIs completed."); diff --git a/code/test/components/jomjol-flowcontroll/test_flowpostprocessing.cpp b/code/test/components/jomjol-flowcontroll/test_flowpostprocessing.cpp index fb1aa581..a9dc4f65 100644 --- a/code/test/components/jomjol-flowcontroll/test_flowpostprocessing.cpp +++ b/code/test/components/jomjol-flowcontroll/test_flowpostprocessing.cpp @@ -108,11 +108,14 @@ void test_doFlowPP() { result = process_doFlow(analogs, digits); TEST_ASSERT_EQUAL_STRING(expected, result.c_str()); +} + +void test_doFlowPP1() { // https://github.com/jomjol/AI-on-the-edge-device/issues/942#issuecomment-1226966346 - digits = { 0.0, 2.9, 3.0, 2.9, 3.5, 9.5}; - analogs = { }; - expected = "33330"; - result = process_doFlow(analogs, digits); + std::vector digits = { 0.0, 2.9, 3.0, 2.9, 3.5, 9.5}; + std::vector analogs = { }; + const char* expected = "33330"; + std::string result = process_doFlow(analogs, digits); TEST_ASSERT_EQUAL_STRING(expected, result.c_str()); // https://github.com/jomjol/AI-on-the-edge-device/issues/942#issuecomment-1226966346 @@ -151,15 +154,13 @@ void test_doFlowPP() { expected = "377988.4"; result = process_doFlow(analogs, digits); TEST_ASSERT_EQUAL_STRING(expected, result.c_str()); -} -void test_doFlowPP1() { // Fehler bei V11.2.0 // https://github.com/jomjol/AI-on-the-edge-device/issues/921#issuecomment-1233149877 - std::vector digits = { 0.0, 0.0, 7.0, 8.9}; // 79.9999(6) als falsches Ergebnis - std::vector analogs = { 0.1, 0.1, 0.1, 9.6}; - const char* expected = "78.9999"; - std::string result = process_doFlow(analogs, digits); + digits = { 0.0, 0.0, 7.0, 8.9}; // 79.9999(6) als falsches Ergebnis + analogs = { 0.1, 0.1, 0.1, 9.6}; + expected = "78.9999"; + result = process_doFlow(analogs, digits); TEST_ASSERT_EQUAL_STRING(expected, result.c_str()); // Fehler bei V11.2.0