Skip to content
Snippets Groups Projects
Commit 0a2a2c57 authored by Malaurie Bernard's avatar Malaurie Bernard
Browse files

adding some buttons and control on my inerface (and changing some names to make them clearer)

parent 5806e67d
No related branches found
No related tags found
1 merge request!17Malaurie's work on UI + CLI interface + AccelStepper interface
......@@ -72,15 +72,22 @@ void web_setup ()
label_push_pull_choice = ESPUI.addControl(ControlType::Label, "Delivrer ou recupérer", "Délivrer", ControlColor::None, position_choice, status_position_choice_callback);
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.addControl(ControlType::Slider, "Distance", "0", ControlColor::None, position_choice, progress_move_callback, (void*)19);
//Style
style (position_choice, 3);
style (label_push_pull_choice, 3);
style (switch_push_pull_choice, 3);
//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.sliderContinuous = true;
//Style
style (position_choice, 3);
style (label_push_pull_choice, 3);
style (label_remaining_volume, 3);
......@@ -107,24 +114,35 @@ void web_setup ()
choose_syringe = ESPUI.addControl(ControlType::Button, "Choisir cette seringue", "Valider", ControlColor::None, syringe_selection, choose_syringe_callback, (void*)19);
style (choose_syringe, 3);
//TAB3 : Nouvelle seringue
new_syringe =ESPUI.addControl(ControlType::Text, "Nouvelle seringue", "Nom de la seringue :", ControlColor::None, tab3, syringe_name_callback);
ESPUI.addControl(ControlType::Number, "Diamètre interne de la seringue en mm", "5", ControlColor::None, new_syringe, number_callback);
ESPUI.addControl(ControlType::Number, "Volume total de la seringue en µL", "5", ControlColor::None, new_syringe, number_callback);
add_syringe = ESPUI.addControl(ControlType::Button, "Ajouter la seringue", "Valider", ControlColor::None, new_syringe, add_syringe_callback, (void*)19);
uint16_t name_new__syringe_label = ESPUI.addControl(ControlType::Label, "Nouvelle seringue", "Nom de la seringue :", ControlColor::None, tab3);
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);
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);
style (new_syringe, 3);
style (name_new__syringe_label, 3);
style (name_new_syringe, 3);
style (internal_diameter_new_syringe_label, 3);
style (internal_diameter_new_syringe, 3);
style (total_volume_new_syringe_label, 3);
style (total_volume_new_syringe, 3);
style (add_syringe_label, 3);
style (add_syringe, 3);
//TAB4 : Configurations avancées
//Diamètre de la vis
ESPUI.addControl(ControlType::Number, "Diamètre de la vis sans fin", "5", ControlColor::None, tab4, number_callback);
worm_diameter = ESPUI.addControl(ControlType::Number, "Diamètre de la vis sans fin", "5", ControlColor::None, tab4, number_callback);
//Sens de rotation du moteur
ESPUI.addControl(ControlType::Switcher, "Sens de rotation du moteur", "Horaire", ControlColor::None, tab4, switch_callback);
clockwise_equals_push = ESPUI.addControl(ControlType::Switcher, "Sens de rotation du moteur", "Horaire =", ControlColor::None, tab4, clockwise_equals_push_callback);
style (name_new__syringe_label, 3);
style (name_new_syringe, 3);
......@@ -160,16 +178,16 @@ void syringe_selection_callback(Control* sender, int value)
select_value = sender->value;
}
void switch_callback(Control* sender, int value)
void clockwise_equals_push_callback(Control* sender, int value)
{
switch (value)
{
case S_ACTIVE:
Serial.print("Active:");
Serial.print("Clockwise equals push");
break;
case S_INACTIVE:
Serial.print("Inactive");
Serial.print("Clockwise equals pull");
break;
}
......@@ -340,6 +358,9 @@ void choose_syringe_callback (Control* sender, int value, void* param)
}
/*************ON/OFF_METHODS****************/
void syringe_pump_on()
......
......@@ -20,11 +20,17 @@ int status_syringe_pump, status_syringe_filled;
uint16_t activation_syringe_pump, syringe_filled_placement, initialisation, position_choice, label_push_pull_choice, switch_push_pull_choice, add_syringe, choose_syringe;
uint16_t syringe_selection, syringe_ref, syringe_brand, syringe_volume, syringe_diameter, new_syringe;
uint16_t syringe_selection, syringe_ref, syringe_brand, syringe_volume, syringe_diameter, label_remaining_volume;
String select_value;
uint16_t name_new_syringe, internal_diameter_new_syringe, total_volume_new_syringe, add_syringe_label;
uint16_t worm_diameter, clockwise_equals_push;
int millis_label_id;
......@@ -71,7 +77,7 @@ void number_callback(Control* sender, int type);
void syringe_name_callback(Control* sender, int type);
void syringe_selection_callback(Control* sender, int value);
void switch_callback(Control* sender, int value);
void clockwise_equals_push_callback(Control* sender, int value);
void button_seringue(Control* sender, int type);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment