diff --git a/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.cpp b/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.cpp index a894ba09..7ac1740f 100644 --- a/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.cpp +++ b/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.cpp @@ -739,12 +739,18 @@ bool ClassFlowPostProcessing::doFlow(string zwtime) if (!NUMBERS[j]->AllowNegativeRates) { - if (NUMBERS[j]->Value < NUMBERS[j]->PreValue) + if ((NUMBERS[j]->Value < NUMBERS[j]->PreValue)) { - NUMBERS[j]->ErrorMessageText = NUMBERS[j]->ErrorMessageText + "Neg. Rate - Read: " + zwvalue + " - Raw: " + NUMBERS[j]->ReturnRawValue + " - Pre: " + RundeOutput(NUMBERS[j]->PreValue, NUMBERS[j]->Nachkomma) + " "; - NUMBERS[j]->Value = NUMBERS[j]->PreValue; - NUMBERS[j]->ReturnValue = ""; - continue; + // Bei isExtendedResolution Ungenauigkeit von 0.2 mit einrechnen. + if (NUMBERS[j]->Value < (NUMBERS[j]->PreValue-0.2) && NUMBERS[j]->isExtendedResolution) { + NUMBERS[j]->Value = NUMBERS[j]->PreValue; + } else { + NUMBERS[j]->ErrorMessageText = NUMBERS[j]->ErrorMessageText + "Neg. Rate - Read: " + zwvalue + " - Raw: " + NUMBERS[j]->ReturnRawValue + " - Pre: " + RundeOutput(NUMBERS[j]->PreValue, NUMBERS[j]->Nachkomma) + " "; + NUMBERS[j]->Value = NUMBERS[j]->PreValue; + NUMBERS[j]->ReturnValue = ""; + continue; + } + } } #ifdef SERIAL_DEBUG diff --git a/code/test/components/jomjol-flowcontroll/test_flowpostprocessing.cpp b/code/test/components/jomjol-flowcontroll/test_flowpostprocessing.cpp index 196460ee..c8876429 100644 --- a/code/test/components/jomjol-flowcontroll/test_flowpostprocessing.cpp +++ b/code/test/components/jomjol-flowcontroll/test_flowpostprocessing.cpp @@ -427,7 +427,7 @@ void test_doFlow() { result = process_doFlow(analogs, digits, Digital100, false, true, 0); TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str()); - // Fehler V12.0.1 + // Fehler V11.3.0 // https://github.com/jomjol/AI-on-the-edge-device/issues/1143#issue-1400807695 digits = { 7.0, 4.0, 7.0, 2.0, 7.0, 5.4, 9.4}; // 7472.749 als falsches Ergebnis analogs = {};