Skip to content

Commit

Permalink
Update ClassFlowCNNGeneral.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
SybexX authored Dec 21, 2024
1 parent f4dccc1 commit 576b36e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions code/components/jomjol_flowcontroll/ClassFlowCNNGeneral.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 576b36e

Please sign in to comment.