diff --git a/pousseseringue-arduino.cpp b/pousseseringue-arduino.cpp index 6190aa5f981beb1461ffa92bb589d41439b1e270..76e27b5c36c728d0191b7b7d3018a25ed551c97e 100644 --- a/pousseseringue-arduino.cpp +++ b/pousseseringue-arduino.cpp @@ -348,7 +348,7 @@ void setup() //Json syringe_filled.read_Json(); - syringe.read_Json(); + //syringe.read_Json(); diff --git a/web.cpp b/web.cpp index 595c263fab3ae344241286384af117ea37e53dfb..df10e48c3ab70db122ae5b214334c9d0084de446 100644 --- a/web.cpp +++ b/web.cpp @@ -69,7 +69,7 @@ void web_setup () //Deplacement demandé du pousse-seringue position_choice = ESPUI.number("Choix du volume à echanger", position_choice_callback, ControlColor::None, 0, 0, 50, (void*)19); - label_position_choice = ESPUI.addControl(ControlType::Label, "Distance", "0", ControlColor::None, position_choice, status_position_choice_callback, (void*)19); + label_position_choice = ESPUI.addControl(ControlType::Label, "Distance", "0", ControlColor::None, position_choice, status_position_choice_callback); ESPUI.addControl(ControlType::Slider, "Distance", "0", ControlColor::None, position_choice, progress_move_callback, (void*)19); ESPUI.sliderContinuous = true; @@ -88,28 +88,22 @@ void web_setup () //Choix de la seringue 1 ESPUI.addControl(ControlType::Separator, "Seringue 1", "", ControlColor::None, tab1); - uint16_t select1 - = ESPUI.addControl(ControlType::Select, "Choix de la seringue :", "", ControlColor::None, tab1, select_callback); - ESPUI.addControl(ControlType::Option, "Seringue A", "Opt1", ControlColor::None, select1); - ESPUI.addControl(ControlType::Option, "Seringue B", "Opt2", ControlColor::None, select1); - ESPUI.addControl(ControlType::Option, "Seringue C", "Opt3", ControlColor::None, select1); - style (select1, 3); + + select_syringe_maj(tab1); + uint16_t carac1 = ESPUI.addControl( ControlType::Label, "Caractéristiques de la seringue 1 : ", "D = 4mm, V = 10µL", ControlColor::None, tab1); style (carac1, 3); - //TAB2 : Mise en marche - //TAB3 : Nouvelle seringue - ESPUI.addControl(ControlType::Text, "Nom de la seringue :", "", ControlColor::Alizarin, tab3, text_callback); - ESPUI.addControl(ControlType::Number, "Diamètre interne de la seringue en mm", "5", ControlColor::Alizarin, tab3, number_callback); - ESPUI.addControl(ControlType::Number, "Volume total de la seringue en µL", "5", ControlColor::Alizarin, tab3, number_callback); + ESPUI.addControl(ControlType::Text, "Nom de la seringue :", "", ControlColor::None, tab3, text_callback); + ESPUI.addControl(ControlType::Number, "Diamètre interne de la seringue en mm", "5", ControlColor::None, tab3, number_callback); + ESPUI.addControl(ControlType::Number, "Volume total de la seringue en µL", "5", ControlColor::None, tab3, number_callback); - etat_button_seringue = ESPUI.addControl( - ControlType::Button, "Ajouter la seringue", "Valider", ControlColor::Peterriver, tab3, button_seringue); + add_syringe = ESPUI.addControl(ControlType::Button, "Ajouter la seringue", "Valider", ControlColor::None, tab3, add_syringe_callback, (void*)19); //TAB4 : Configurations avancées @@ -260,10 +254,13 @@ void syringe_filled_placement_callback (Control* sender, int value, void* param) //Action ESPUI.updateVisibility(initialisation, false); + + ESPUI.updateLabel(status_syringe_pump, "En marche"); ESPUI.updateSwitcher(activation_syringe_pump, true); style (status_syringe_pump, 1); style (activation_syringe_pump, 1); + syringe_filled.move(); break; @@ -295,13 +292,30 @@ void progress_move_callback (Control* sender, int value, void* param) } -void status_position_choice_callback (Control* sender, int value, void* param) +void status_position_choice_callback (Control* sender, int value) +{ + +} + +void add_syringe_callback (Control* sender, int value, void* param) { + syringe_filled.write_Json(); } +void select_syringe_maj(uint16_t tab) +{ + + uint16_t select1 + = ESPUI.addControl(ControlType::Select, "Choix de la seringue :", "", ControlColor::None, tab, select_callback); + ESPUI.addControl(ControlType::Option, "Seringue A", "Opt1", ControlColor::None, select1); + ESPUI.addControl(ControlType::Option, "Seringue B", "Opt2", ControlColor::None, select1); + ESPUI.addControl(ControlType::Option, "Seringue C", "Opt3", ControlColor::None, select1); + style (select1, 3); + +} void style (uint16_t id, int style) diff --git a/web.h b/web.h index 56d6d80c99ec4ecb82999dff7a1c2ef676156a23..b81f3cc94068944332b7b7aa996141e562dc1c67 100644 --- a/web.h +++ b/web.h @@ -18,7 +18,7 @@ int status_syringe_pump, status_syringe_filled; -uint16_t activation_syringe_pump, syringe_filled_placement, initialisation, position_choice, label_position_choice; +uint16_t activation_syringe_pump, syringe_filled_placement, initialisation, position_choice, label_position_choice, add_syringe; @@ -31,9 +31,6 @@ uint16_t status; -uint16_t etat_button_seringue; - - uint16_t zero; @@ -88,9 +85,16 @@ void position_choice_callback (Control* sender, int value, void* param); void progress_move_callback (Control* sender, int value, void* param); +void add_syringe_callback (Control* sender, int value, void* param); + +void status_position_choice_callback (Control* sender, int value); + + + +void add_syringe_callback (Control* sender, int value, void* param); -void status_position_choice_callback (Control* sender, int value, void* param); +void select_syringe_maj(uint16_t tab); void style (uint16_t id, int style);