From 81084f8e30f03919ed57e7a972a6b89b312911cd Mon Sep 17 00:00:00 2001
From: Malaurie Bernard <mbernard@kinouby>
Date: Thu, 24 Aug 2023 11:08:20 +0200
Subject: [PATCH] supression of select_value that were useless

---
 web.cpp | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/web.cpp b/web.cpp
index 18e3114..53b7613 100644
--- a/web.cpp
+++ b/web.cpp
@@ -541,11 +541,11 @@ void Web :: choose_syringe_callback (Control* sender, int value)
     {
     case B_DOWN:
 
-        syringe_volume_mL_value = syringe.get_syringe_database()[select_value]["total_volume_mL"];
+        syringe_volume_mL_value = syringe.get_syringe_database()[syringe_filled.get_syringe_name()]["total_volume_mL"];
         syringe_volume_mL_string = "Volume total: " + std::to_string(syringe_volume_mL_value) + "mL";
         ESPUI.print(syringe_volume_mL, syringe_volume_mL_string.c_str());
 
-        syringe_diameter_mm_value = syringe.get_syringe_database()[select_value]["internal_diameter_mm"];
+        syringe_diameter_mm_value = syringe.get_syringe_database()[syringe_filled.get_syringe_name()]["internal_diameter_mm"];
         syringe_diameter_mm_string = "internal diameter : " + std::to_string(syringe_diameter_mm_value) + "mm";
         ESPUI.print(syringe_diameter_mm, syringe_diameter_mm_string.c_str());
 
@@ -791,8 +791,7 @@ void Web :: syringe_selection_callback(Control* sender, int value)
 ***/
 {
 
-    select_value = sender->value;
-    syringe_filled.set_name_syringe(select_value);
+    syringe_filled.set_name_syringe(sender->value);
     syringe_filled.save_json();
 
     serial_print ("syringe_selection (sender->value)", sender);
-- 
GitLab