diff --git a/web.cpp b/web.cpp index ef33987e407f6a2d6e3620d1f48de09e82360f7c..80f491f63575f17cd4d08f018a9777c531292e59 100644 --- a/web.cpp +++ b/web.cpp @@ -29,7 +29,7 @@ void web_setup () //***Initialisation***// - initialisation = ESPUI.button("Initialisation", initialisation_callback, ControlColor::None, "Lancer"); + calibration = ESPUI.button("Callibration", calibration_callback, ControlColor::None, "Lancer"); //Remaning_volume @@ -47,9 +47,9 @@ void web_setup () exchange_throughtput_uL_per_sec = ESPUI.addControl(ControlType::Number,"Caractéristiques de l'échange", "", ControlColor::None, volume_exchange_mL_label, exchange_throughtput_uL_per_sec_callback, (void*)19); - label_push_pull_choice = ESPUI.addControl(ControlType::Label, "Delivrer ou recupérer", "Délivrer", ControlColor::None, volume_exchange_mL_label); - switch_push_pull_choice = ESPUI.addControl(ControlType::Switcher, "Delivrer ou recupérer", "Délivrer", ControlColor::None, volume_exchange_mL_label, switch_push_pull_choice_callback, (void*)19); - ESPUI.updateSwitcher(switch_push_pull_choice, true); //pour mettre a "Delivrer" par défaut au début + label_push_pull_choice = ESPUI.addControl(ControlType::Label, "Injection ou Aspiration", "Injection", ControlColor::None, volume_exchange_mL_label); + switch_push_pull_choice = ESPUI.addControl(ControlType::Switcher, "Injection ou Aspiration", "Injection", ControlColor::None, volume_exchange_mL_label, switch_push_pull_choice_callback, (void*)19); + ESPUI.updateSwitcher(switch_push_pull_choice, true); //pour mettre a "Injection" par défaut au début //Configurations @@ -86,10 +86,11 @@ void web_setup () //Features - worm_diameter_mm = ESPUI.addControl(ControlType::Number, "Diamètre de la vis sans fin", "5", ControlColor::None, features, number_callback); - clockwise_equals_push_label = ESPUI.addControl(ControlType::Label, "Sens de rotation du moteur", "Horaire = Delivrer", ControlColor::None, features); + syringe_pump_length_mm_bis = ESPUI.addControl(ControlType::Number, "Longueur totale du pousse-seringue", "50", ControlColor::None, features, syringe_pump_length_mm_callback); + lead_screw_pitch_mm = ESPUI.addControl(ControlType::Number, "Avance par tour", "0.7", ControlColor::None, features, number_callback); + clockwise_equals_push_label = ESPUI.addControl(ControlType::Label, "Sens de rotation du moteur", "Horaire = Injection", ControlColor::None, features); clockwise_equals_push = ESPUI.addControl(ControlType::Switcher, "Sens de rotation du moteur", "Horaire =", ControlColor::None, clockwise_equals_push_label, clockwise_equals_push_callback); - ESPUI.updateSwitcher(clockwise_equals_push, true); //set "Horaire = Delivrer" at the beginning + ESPUI.updateSwitcher(clockwise_equals_push, true); //set "Horaire = Injection" at the beginning //Begin set_init_style(); @@ -164,11 +165,11 @@ void syringe_filled_placement_callback (Control* sender, int value, void* param) Serial.println(sender->id); } -void initialisation_callback (Control *sender, int type) +void calibration_callback (Control *sender, int type) /*** -Argument : Pointer to the controller calling the function, integer according to the controller type. -Return : / --Action : Enable the syringe-pump initialisation and change the style appropriately. +-Action : Enable the syringe-pump calibration and change the style appropriately. ***/ { if((type == B_UP)) { @@ -223,7 +224,7 @@ void switch_push_pull_choice_callback (Control* sender, int value, void* param) case S_ACTIVE: syringe_filled.set_push(true); - ESPUI.print(label_push_pull_choice, "Délivrer"); + ESPUI.print(label_push_pull_choice, "Injection"); style (volume_exchange_mL_label, 1); style (volume_exchange_mL, 1); @@ -238,7 +239,7 @@ void switch_push_pull_choice_callback (Control* sender, int value, void* param) syringe_filled.set_push(false); - ESPUI.print(label_push_pull_choice, "Recupérer"); + ESPUI.print(label_push_pull_choice, "Aspiration"); style (volume_exchange_mL_label, 2); style (volume_exchange_mL, 2); @@ -375,6 +376,16 @@ void add_syringe_callback (Control* sender, int value, void* param) //features : Configurations avancées +void syringe_pump_length_mm_callback(Control* sender, int type) +/*** +-Argument : Pointer to the controller calling the function, integer according to the controller type. +-Return : / +-Action : Print the value of the number controller via the serial port. +***/ +{ + Serial.println(sender->value); +} + void clockwise_equals_push_callback(Control* sender, int value) /*** -Argument : Pointer to the controller calling the function, integer according to the controller type. @@ -387,13 +398,13 @@ void clockwise_equals_push_callback(Control* sender, int value) { case S_ACTIVE: Serial.print("Clockwise equals push"); - ESPUI.print(clockwise_equals_push_label, "Horaire = Delivrer"); + ESPUI.print(clockwise_equals_push_label, "Horaire = Injection"); break; case S_INACTIVE: Serial.print("Clockwise equals pull"); - ESPUI.print(clockwise_equals_push_label, "Horaire = Récupérer"); + ESPUI.print(clockwise_equals_push_label, "Horaire = Aspiration"); break; } @@ -475,15 +486,15 @@ void syringe_filled_placement_on() -Return : / -Action : Change the status_syringe_filled label to display the information. Change the style of the controller involved. - Disable the initialisation. + Disable the calibration. ***/ { ESPUI.print(status_syringe_filled, "En place"); style (status_syringe_filled, 1); style (syringe_filled_placement, 1); - ESPUI.setEnabled(initialisation, false); - style (initialisation, 2); + ESPUI.setEnabled(calibration, false); + style (calibration, 2); syringe_pump_on(); } @@ -493,15 +504,15 @@ void syringe_filled_placement_off() -Return : / -Action : Change the status_syringe_filled label to display the information. Change the style of the controller involved. - Enable the initialisation. + Enable the calibration. ***/ { ESPUI.print(status_syringe_filled, "Enlevée"); style (status_syringe_filled, 2); style (syringe_filled_placement, 2); - ESPUI.setEnabled(initialisation, true); - style (initialisation, 1); + ESPUI.setEnabled(calibration, true); + style (calibration, 1); } @@ -553,7 +564,7 @@ void set_init_style() style (status_syringe_filled, 2); style (syringe_filled_placement, 2); - style (initialisation, 2); + style (calibration, 2); style (volume_exchange_mL_label, 1); style (volume_exchange_mL, 1); @@ -581,9 +592,9 @@ void set_init_style() - //features : Configurations avancées - - style (worm_diameter_mm, 3); + //features + style (syringe_pump_length_mm_bis, 3); + style (lead_screw_pitch_mm, 3); style (clockwise_equals_push_label, 3); style (clockwise_equals_push, 3); diff --git a/web.h b/web.h index 5fac25447a16b572c1f23068b966655c0154eebb..de1b94e8341ab70b594b079e032e37c3644b25f9 100644 --- a/web.h +++ b/web.h @@ -25,7 +25,7 @@ uint16_t activation_syringe_pump; int status_syringe_filled; uint16_t syringe_filled_placement; -uint16_t initialisation; +uint16_t calibration; uint16_t volume_exchange_mL_label, volume_exchange_mL, exchange_throughtput_uL_per_sec_label, exchange_throughtput_uL_per_sec, label_push_pull_choice, switch_push_pull_choice; @@ -45,7 +45,8 @@ uint16_t name_new_syringe, name_new_syringe_label, internal_diameter_mm_new_syri String name_new_syringe_value, total_volume_mL_new_syringe_value, internal_diameter_mm_new_syringe_value; //Features -uint16_t worm_diameter_mm, clockwise_equals_push_label, clockwise_equals_push; +uint16_t syringe_pump_length_mm_bis; +uint16_t lead_screw_pitch_mm, clockwise_equals_push_label, clockwise_equals_push; //Other @@ -83,7 +84,7 @@ void number_callback(Control* sender, int type); //***ABOVE***// void activation_syringe_pump_callback (Control* sender, int value, void* param); void syringe_filled_placement_callback (Control* sender, int value, void* param); -void initialisation_callback(Control* sender, int type); +void calibration_callback(Control* sender, int type); void volume_exchange_mL_callback (Control* sender, int value, void* param); void exchange_throughtput_uL_per_sec_callback (Control* sender, int value, void* param); void switch_push_pull_choice_callback (Control* sender, int value, void* param); @@ -97,6 +98,7 @@ void internal_diameter_mm_new_syringe_callback(Control* sender, int type); void add_syringe_callback (Control* sender, int value, void* param); //features : Configurations avancées +void syringe_pump_length_mm_callback(Control* sender, int type); void clockwise_equals_push_callback(Control* sender, int value); //