jomjol 5 年之前
父节点
当前提交
ac3edc9bec
共有 4 个文件被更改,包括 24 次插入13 次删除
  1. 5 1
      README.md
  2. 1 6
      code/src/server_tflite.cpp
  3. 9 3
      sd-card/html/edit_analog.html
  4. 9 3
      sd-card/html/edit_digits.html

+ 5 - 1
README.md

@@ -29,7 +29,11 @@ A 3d-printable housing can be found here: https://www.thingiverse.com/thing:4571
 
 
 
 
 
 
-##### Rolling - (2020-09-09)
+##### Rolling - (2020-09-10)
+
+* update ROI-configurator, in case of no ROIs defined
+
+2020-09-10
 
 
 * Update to new and modern layout (thanks to michaeljoos in iobroker-thread)
 * Update to new and modern layout (thanks to michaeljoos in iobroker-thread)
 * incorporated "Take Picture" to make new reference image
 * incorporated "Take Picture" to make new reference image

+ 1 - 6
code/src/server_tflite.cpp

@@ -58,7 +58,6 @@ void doInit(void)
 
 
 bool doflow(void)
 bool doflow(void)
 {
 {
-    int i;
     std::string zw_time = gettimestring("%Y%m%d-%H%M%S");
     std::string zw_time = gettimestring("%Y%m%d-%H%M%S");
     printf("doflow - start %s\n", zw_time.c_str());
     printf("doflow - start %s\n", zw_time.c_str());
     flowisrunning = true;
     flowisrunning = true;
@@ -131,9 +130,8 @@ esp_err_t handler_doflow(httpd_req_t *req)
 esp_err_t handler_wasserzaehler(httpd_req_t *req)
 esp_err_t handler_wasserzaehler(httpd_req_t *req)
 {
 {
     LogFile.WriteToFile("handler_wasserzaehler");    
     LogFile.WriteToFile("handler_wasserzaehler");    
-    const char* resp_str;
-    string zw;
     bool _rawValue = false;
     bool _rawValue = false;
+    string zw;
 
 
     printf("handler_wasserzaehler uri:\n"); printf(req->uri); printf("\n");
     printf("handler_wasserzaehler uri:\n"); printf(req->uri); printf("\n");
 
 
@@ -213,9 +211,6 @@ esp_err_t handler_wasserzaehler(httpd_req_t *req)
 esp_err_t handler_editflow(httpd_req_t *req)
 esp_err_t handler_editflow(httpd_req_t *req)
 {
 {
     LogFile.WriteToFile("handler_editflow");    
     LogFile.WriteToFile("handler_editflow");    
-    const char* resp_str;
-    string zw;
-    bool _rawValue = false;
 
 
     printf("handler_editflow uri: "); printf(req->uri); printf("\n");
     printf("handler_editflow uri: "); printf(req->uri); printf("\n");
 
 

+ 9 - 3
sd-card/html/edit_analog.html

@@ -23,8 +23,8 @@
                             <table>
                             <table>
                                     <tr>
                                     <tr>
                                         <td>
                                         <td>
-                                            <input type="submit" name="newROI" onclick="newROI()" value="New ROI (after current)">
-                                            <input type="submit" name="deleteROI" onclick="deleteROI()" value="Delete ROI">
+                                            <input type="submit" id= "newROI" name="newROI" onclick="newROI()" value="New ROI (after current)">
+                                            <input type="submit" id= "deleteROI" name="deleteROI" onclick="deleteROI()" value="Delete ROI">
                                         </td>
                                         </td>
                                     </tr>
                                     </tr>
                                 
                                 
@@ -68,7 +68,7 @@
                                     </tr>
                                     </tr>
                                     <tr>
                                     <tr>
                                         <td>
                                         <td>
-                                            <input type="submit" name="saveroi" onclick="SaveToConfig()" value="Save all to Config.ini">
+                                            <input type="submit" id="saveroi" name="saveroi" onclick="SaveToConfig()" value="Save all to Config.ini">
                                         </td>                                        
                                         </td>                                        
                                     </tr>
                                     </tr>
                             </table>
                             </table>
@@ -159,6 +159,12 @@ function SaveToConfig(){
 function UpdateROIs(){
 function UpdateROIs(){
     if (ROIInfo.length == 0){
     if (ROIInfo.length == 0){
         alert("There are no ROIs defined.\nPlease first define minimum one ROI in the config.ini by hand.\n");
         alert("There are no ROIs defined.\nPlease first define minimum one ROI in the config.ini by hand.\n");
+        document.getElementById("newROI").disabled = true;
+        document.getElementById("deleteROI").disabled = true;
+        document.getElementById("index").disabled = true;
+        document.getElementById("saveroi").disabled = true;
+        document.getElementById("moveNext").disabled = true;
+        document.getElementById("movePrevious").disabled = true;
         return;
         return;
     }
     }
 
 

+ 9 - 3
sd-card/html/edit_digits.html

@@ -23,8 +23,8 @@
                             <table>
                             <table>
                                     <tr>
                                     <tr>
                                         <td>
                                         <td>
-                                            <input type="submit" name="newROI" onclick="newROI()" value="New ROI (after current)">
-                                            <input type="submit" name="deleteROI" onclick="deleteROI()" value="Delete ROI">
+                                            <input type="submit" id="newROI" name="newROI" onclick="newROI()" value="New ROI (after current)">
+                                            <input type="submit" id="deleteROI" name="deleteROI" onclick="deleteROI()" value="Delete ROI">
                                         </td>
                                         </td>
                                     </tr>
                                     </tr>
                                 
                                 
@@ -68,7 +68,7 @@
                                     </tr>
                                     </tr>
                                     <tr>
                                     <tr>
                                         <td>
                                         <td>
-                                            <input type="submit" name="saveroi" onclick="SaveToConfig()" value="Save all to Config.ini">
+                                            <input type="submit" id="saveroi" name="saveroi" onclick="SaveToConfig()" value="Save all to Config.ini">
                                         </td>                                        
                                         </td>                                        
                                     </tr>
                                     </tr>
                             </table>
                             </table>
@@ -159,6 +159,12 @@ function SaveToConfig(){
 function UpdateROIs(){
 function UpdateROIs(){
     if (ROIInfo.length == 0){
     if (ROIInfo.length == 0){
         alert("There are no ROIs defined.\nPlease first define minimum one ROI in the config.ini by hand.\n");
         alert("There are no ROIs defined.\nPlease first define minimum one ROI in the config.ini by hand.\n");
+        document.getElementById("newROI").disabled = true;
+        document.getElementById("deleteROI").disabled = true;
+        document.getElementById("index").disabled = true;
+        document.getElementById("saveroi").disabled = true;
+        document.getElementById("moveNext").disabled = true;
+        document.getElementById("movePrevious").disabled = true;
         return;
         return;
     }
     }