From 1f0cc513f00d20dac9936199325b4845cd4017a2 Mon Sep 17 00:00:00 2001
From: Malaurie Bernard <mbernard@kinouby>
Date: Wed, 12 Jul 2023 12:00:41 +0200
Subject: [PATCH] Fxing problem in initialisation (it was moving and not
 initialising  and changing visibility true/false to enability (for the button
 initialisation) so it cannot be used when we don't want it to) (Imust now
 change the colors in that case by creating a ne style)

---
 web.cpp | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/web.cpp b/web.cpp
index a4eead5..369e60c 100644
--- a/web.cpp
+++ b/web.cpp
@@ -214,7 +214,12 @@ void initialisation_callback (Control *sender, int type) {
     if((type == B_UP)) {
         Serial.printf("Go to zero"); 
         syringe_filled.go_to_zero();
-        syringe_pump_on();
+            Serial.print("Active:");
+            
+    ESPUI.print(status_syringe_pump, "En marche");
+    ESPUI.updateSwitcher(activation_syringe_pump, true);
+    style (status_syringe_pump, 1);
+    style (activation_syringe_pump, 1);
     }
 
 }
@@ -309,7 +314,8 @@ void syringe_filled_placement_on()
     style (status_syringe_filled, 1);
     style (syringe_filled_placement, 1);
     
-    ESPUI.updateVisibility(initialisation, false);
+    ESPUI.setEnabled(initialisation, false);
+    style (initialisation, 1);
     syringe_pump_on();
 }
 
@@ -320,7 +326,8 @@ void syringe_filled_placement_off()
     style (status_syringe_filled, 2);
     style (syringe_filled_placement, 2);
 
-    ESPUI.updateVisibility(initialisation, true);
+    ESPUI.setEnabled(initialisation, true);
+    style (initialisation, 2);
 }
 
 
-- 
GitLab