diff --git a/web.cpp b/web.cpp index ebe1be33e4ee8ff9e451ee92e777814c36e74baa..2dd4974d627c4cafdca41f6f6004dc077cec45d2 100644 --- a/web.cpp +++ b/web.cpp @@ -5,25 +5,6 @@ void web_setup () { - //Creation des différents styles - - //Les verts pour la mise en mrche de la seringue - sprintf(couleur1, "background-color: #%06X;", (unsigned int) 0xb2dbbf); - sprintf(couleur2, "background-color: #%06X;", (unsigned int) 0x5a8668); - - //Le rouge pour la seringue a l'arrêt - sprintf(couleur3, "background-color: #%06X;", (unsigned int) 0xc97064); - sprintf(couleur4, "background-color: #%06X;", (unsigned int) 0x762419); - - //Les marrons pour la config des seringues - sprintf(couleur5, "background-color: #%06X;", (unsigned int) 0xce9f6f); - sprintf(couleur6, "background-color: #%06X;", (unsigned int) 0x926448); - - - sprintf(couleur7, "background-color: #%06X;", (unsigned int) 0x0a7477); - sprintf(couleur8, "background-color: #%06X;", (unsigned int) 0x052a38); - sprintf(couleur9, "background-color: #%06X;", (unsigned int) 0x044365); - sprintf(couleur10, "background-color: #%06X;", (unsigned int) 0x58b8c3); @@ -69,7 +50,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_push_pull_choice = ESPUI.addControl(ControlType::Label, "Delivrer ou recupérer", "Délivrer", ControlColor::None, position_choice, status_position_choice_callback); + label_push_pull_choice = ESPUI.addControl(ControlType::Label, "Delivrer ou recupérer", "Délivrer", ControlColor::None, position_choice); switch_push_pull_choice = ESPUI.addControl(ControlType::Switcher, "Delivrer ou recupérer", "Délivrer", ControlColor::None, position_choice, switch_push_pull_choice_callback, (void*)19); ESPUI.updateSwitcher(switch_push_pull_choice, true); //pour mettre a "Delivrer" par défaut au début @@ -83,7 +64,7 @@ void web_setup () //Volume restant label_remaining_volume = ESPUI.label("Volume restant en mL", ControlColor::None, "Volume restant en mL"); - ESPUI.addControl(ControlType::Slider, "Distance", "0", ControlColor::None, label_remaining_volume, progress_move_callback, (void*)19); + ESPUI.addControl(ControlType::Slider, "Distance", "0", ControlColor::None, label_remaining_volume, remaining_volume_callback, (void*)19); ESPUI.sliderContinuous = true; @@ -123,7 +104,7 @@ void web_setup () name_new_syringe = ESPUI.addControl(ControlType::Text, "Nouvelle seringue", "", ControlColor::None, name_new_syringe_label, syringe_name_callback); uint16_t internal_diameter_new_syringe_label =ESPUI.addControl(ControlType::Label, "Nouvelle seringue", "Diamètre interne de la seringue en mm :", ControlColor::None, name_new_syringe_label); internal_diameter_new_syringe = ESPUI.addControl(ControlType::Number, "Diamètre interne de la seringue en mm", "5", ControlColor::None, name_new_syringe_label, number_callback); - uint16_t total_volume_new_syringe_label =ESPUI.addControl(ControlType::Label, "Nouvelle seringue", "Volume total de la seringue en µL :", ControlColor::None, name_new__syringe_label); + uint16_t total_volume_new_syringe_label =ESPUI.addControl(ControlType::Label, "Nouvelle seringue", "Volume total de la seringue en µL :", ControlColor::None, name_new_syringe_label); total_volume_new_syringe = ESPUI.addControl(ControlType::Number, "Volume total de la seringue en µL", "5", ControlColor::None, name_new_syringe_label, number_callback); uint16_t add_syringe_label =ESPUI.addControl(ControlType::Label, "Nouvelle seringue", "Ajouter la seringue", ControlColor::None, name_new_syringe_label); add_syringe = ESPUI.addControl(ControlType::Button, "Ajouter la seringue", "Valider", ControlColor::None, name_new_syringe_label, add_syringe_callback, (void*)19); @@ -157,12 +138,15 @@ void web_setup () /************CALLBACK_METHODS****************/ +//GENERAL CALLBACKS// void number_callback(Control* sender, int type) { Serial.println(sender->value); } + +//CALLBACKS// void syringe_name_callback(Control* sender, int type) { Serial.print("Text: ID: "); @@ -171,8 +155,6 @@ void syringe_name_callback(Control* sender, int type) Serial.println(sender->value); } - - void syringe_selection_callback(Control* sender, int value) { Serial.print("Select: ID: "); @@ -202,22 +184,6 @@ void clockwise_equals_push_callback(Control* sender, int value) Serial.println(sender->id); } - -void button_seringue(Control* sender, int type) -{ - switch (type) - { - case B_DOWN: - Serial.println("Button DOWN"); - break; - - case B_UP: - Serial.println("Button UP"); - break; - } -} - - void syringe_pump_callback (Control* sender, int value, void* param) { @@ -261,7 +227,6 @@ void switch_push_pull_choice_callback (Control* sender, int value, void* param) Serial.println(sender->id); } - void syringe_pump_on_off() { if (syringe_filled.is_running()) @@ -273,8 +238,6 @@ void syringe_pump_on_off() } - - void initialisation_callback (Control *sender, int type) { if((type == B_UP)) { @@ -290,12 +253,7 @@ void initialisation_callback (Control *sender, int type) { } - - - - - -void progress_move_callback (Control* sender, int value, void* param) +void remaining_volume_callback (Control* sender, int value, void* param) { } @@ -305,10 +263,6 @@ void position_choice_callback (Control* sender, int value, void* param) Serial.printf("val=%s\n", sender->value.c_str()); syringe_filled.set_exchange_volume_mL(atof(sender->value.c_str())); -} -void status_position_choice_callback (Control* sender, int value) -{ - } void add_syringe_callback (Control* sender, int value, void* param) @@ -328,7 +282,6 @@ void add_syringe_callback (Control* sender, int value, void* param) } - void syringe_filled_placement_callback (Control* sender, int value, void* param) { @@ -348,8 +301,6 @@ void syringe_filled_placement_callback (Control* sender, int value, void* param) Serial.println(sender->id); } - - void choose_syringe_callback (Control* sender, int value, void* param) { switch (value) @@ -432,7 +383,6 @@ void select_syringe_maj(uint16_t tab) } - void style (uint16_t id, int style) //Change style (1 is active, green; 2 is inactive, red; 3 is neutral, brown) { @@ -458,6 +408,9 @@ void style (uint16_t id, int style) } + + +//WEB_LOOP// void web_loop () { diff --git a/web.h b/web.h index a876d1614b1634a0a5ffa5bd4668100ac68d6145..29034c36fedaa2c40a9063e86853be1fd0364998 100644 --- a/web.h +++ b/web.h @@ -60,7 +60,6 @@ void syringe_name_callback(Control* sender, int type); void syringe_selection_callback(Control* sender, int value); void clockwise_equals_push_callback(Control* sender, int value); -void button_seringue(Control* sender, int type);