Просмотр исходного кода

do not show value on recognition page (#2083)

* do not show value on recognition page

* .

* .

* .

* .

---------

Co-authored-by: CaCO3 <caco@ruinelli.ch>
CaCO3 2 лет назад
Родитель
Сommit
9a9aa68a65
1 измененных файлов с 22 добавлено и 7 удалено
  1. 22 7
      code/components/jomjol_tfliteclass/server_tflite.cpp

+ 22 - 7
code/components/jomjol_tfliteclass/server_tflite.cpp

@@ -378,22 +378,37 @@ esp_err_t handler_wasserzaehler(httpd_req_t *req)
             return ESP_OK;
         }
 
+
+        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;
+            txt = "<body style=\"font-family: arial\">";
+
+            if ((countRounds <= 1) && (*status != std::string("Flow finished"))) { // First round not completed yet
+                txt += "<h3>Please wait for the first round to complete!</h3><h3>Current state: " + *status + "</h3>\n";
+            }
+            else {
+                txt += "<h3>Value</h3>";
+            }
+
+            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()); 
 
-        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();
-
             if ((countRounds <= 1) && (*status != std::string("Flow finished"))) { // First round not completed yet
-                txt = "<body style=\"font-family: arial\">";
-                txt += "<h3>Please wait for the first round to complete!</h3><h3>Current state: " + *status + "</h3>\n";
-                httpd_resp_sendstr_chunk(req, txt.c_str());
+                // Nothing to do
             }
             else {
                 /* Digital ROIs */