From 576b36eda8306fe3e6c7aa2311644b7d8823fd06 Mon Sep 17 00:00:00 2001 From: SybexX Date: Sat, 21 Dec 2024 12:59:17 +0100 Subject: [PATCH] Update ClassFlowCNNGeneral.cpp --- .../jomjol_flowcontroll/ClassFlowCNNGeneral.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/code/components/jomjol_flowcontroll/ClassFlowCNNGeneral.cpp b/code/components/jomjol_flowcontroll/ClassFlowCNNGeneral.cpp index 146063f3d..14ccc3b4d 100644 --- a/code/components/jomjol_flowcontroll/ClassFlowCNNGeneral.cpp +++ b/code/components/jomjol_flowcontroll/ClassFlowCNNGeneral.cpp @@ -65,11 +65,11 @@ string ClassFlowCNNGeneral::getReadout(int _analog = 0, bool _extendedResolution if (CNNType == Digit) { for (int i = 0; i < GENERAL[_analog]->ROI.size(); ++i) { - if (GENERAL[_analog]->ROI[i]->result_klasse >= 10) { - result = result + "N"; + if ((GENERAL[_analog]->ROI[i]->result_klasse >= 0) && (GENERAL[_analog]->ROI[i]->result_klasse < 10)) { + result = result + std::to_string(GENERAL[_analog]->ROI[i]->result_klasse); } else { - result = result + std::to_string(GENERAL[_analog]->ROI[i]->result_klasse); + result = result + "N"; } } return result; @@ -78,7 +78,7 @@ string ClassFlowCNNGeneral::getReadout(int _analog = 0, bool _extendedResolution if ((CNNType == DoubleHyprid10) || (CNNType == Digit100)) { float number = GENERAL[_analog]->ROI[GENERAL[_analog]->ROI.size() - 1]->result_float; // NaN? - if (number >= 0) { + if ((number >= 0) && (number < 10)) { // is only set if it is the first digit (no analogue before!) if (_extendedResolution) { int result_after_decimal_point = ((int) floor(number * 10)) % 10; @@ -107,7 +107,7 @@ string ClassFlowCNNGeneral::getReadout(int _analog = 0, bool _extendedResolution } for (int i = GENERAL[_analog]->ROI.size() - 2; i >= 0; --i) { - if (GENERAL[_analog]->ROI[i]->result_float >= 0) { + if ((GENERAL[_analog]->ROI[i]->result_float >= 0) && (GENERAL[_analog]->ROI[i]->result_float < 10)) { prev = PointerEvalHybridNew(GENERAL[_analog]->ROI[i]->result_float, GENERAL[_analog]->ROI[i+1]->result_float, prev); LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "getReadout#PointerEvalHybridNew()= " + std::to_string(prev)); result = std::to_string(prev) + result;