From 9a9aa68a65b28f7c301ae3db08b301eeaa7b2f8f Mon Sep 17 00:00:00 2001 From: CaCO3 Date: Sun, 26 Feb 2023 18:28:26 +0100 Subject: [PATCH] do not show value on recognition page (#2083) * do not show value on recognition page * . * . * . * . --------- Co-authored-by: CaCO3 --- .../jomjol_tfliteclass/server_tflite.cpp | 31 ++++++++++++++----- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/code/components/jomjol_tfliteclass/server_tflite.cpp b/code/components/jomjol_tfliteclass/server_tflite.cpp index f937a68d..5b9d8bbf 100644 --- a/code/components/jomjol_tfliteclass/server_tflite.cpp +++ b/code/components/jomjol_tfliteclass/server_tflite.cpp @@ -378,22 +378,37 @@ esp_err_t handler_wasserzaehler(httpd_req_t *req) return ESP_OK; } - zw = tfliteflow.getReadout(_rawValue, _noerror); - if (zw.length() > 0) - httpd_resp_sendstr_chunk(req, zw.c_str()); + std::string *status = tfliteflow.getActStatus(); string query = std::string(_query); // ESP_LOGD(TAG, "Query: %s, query.c_str()); if (query.find("full") != std::string::npos) { - string txt, zw; - - std::string *status = tfliteflow.getActStatus(); + string txt; + txt = ""; if ((countRounds <= 1) && (*status != std::string("Flow finished"))) { // First round not completed yet - txt = ""; txt += "

Please wait for the first round to complete!

Current state: " + *status + "

\n"; - httpd_resp_sendstr_chunk(req, txt.c_str()); + } + else { + txt += "

Value

"; + } + + httpd_resp_sendstr_chunk(req, txt.c_str()); + } + + + zw = tfliteflow.getReadout(_rawValue, _noerror); + if (zw.length() > 0) + httpd_resp_sendstr_chunk(req, zw.c_str()); + + + if (query.find("full") != std::string::npos) + { + string txt, zw; + + if ((countRounds <= 1) && (*status != std::string("Flow finished"))) { // First round not completed yet + // Nothing to do } else { /* Digital ROIs */