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

Creating functions to set style of a bloc directly (so we don't need to initialize them one by one)

parent 6f4f01a8
No related branches found
No related tags found
1 merge request!17Malaurie's work on UI + CLI interface + AccelStepper interface
...@@ -21,9 +21,9 @@ void web_setup () ...@@ -21,9 +21,9 @@ void web_setup ()
stop_syringe_pump = ESPUI.addControl(ControlType::Button, "Mise en marche", "\u26D4", ControlColor::None, status_syringe_pump, stop_syringe_pump_callback, (void*)19); stop_syringe_pump = ESPUI.addControl(ControlType::Button, "Mise en marche", "\u26D4", ControlColor::None, status_syringe_pump, stop_syringe_pump_callback, (void*)19);
//***Syringe-filled***// //***Syringe-filled***//
status_syringe_filled = ESPUI.label("Etat de la seringue :", ControlColor::None, "Enlevée"); status_syringe_filled_placement = ESPUI.label("Etat de la seringue :", ControlColor::None, "Enlevée");
syringe_filled_placement = ESPUI.addControl(ControlType::Switcher, "Mise en marche", "Arrêt", ControlColor::None, status_syringe_filled, syringe_filled_placement_callback, (void*)19); syringe_filled_placement = ESPUI.addControl(ControlType::Switcher, "Mise en marche", "Arrêt", ControlColor::None, status_syringe_filled_placement, syringe_filled_placement_callback, (void*)19);
ESPUI.addControl(ControlType::Separator, "", "", ControlColor::None); ESPUI.addControl(ControlType::Separator, "", "", ControlColor::None);
...@@ -131,7 +131,7 @@ void web_setup () ...@@ -131,7 +131,7 @@ void web_setup ()
ESPUI.updateSwitcher(clockwise_equals_push, true); //set "Horaire = Injection" at the beginning ESPUI.updateSwitcher(clockwise_equals_push, true); //set "Horaire = Injection" at the beginning
//Begin //Begin
set_init_style(); set_initial_style();
ESPUI.begin("ESPUI Control"); ESPUI.begin("ESPUI Control");
} }
...@@ -736,7 +736,7 @@ void style (uint16_t id, int style) ...@@ -736,7 +736,7 @@ void style (uint16_t id, int style)
} }
void set_init_style() void set_initial_style()
/*** /***
-Argument : / -Argument : /
-Return : / -Return : /
...@@ -748,7 +748,7 @@ void set_init_style() ...@@ -748,7 +748,7 @@ void set_init_style()
style (status_syringe_pump, 2); style (status_syringe_pump, 2);
style (stop_syringe_pump, 2); style (stop_syringe_pump, 2);
style (status_syringe_filled, 2); style (status_syringe_filled_placement, 2);
style (syringe_filled_placement, 2); style (syringe_filled_placement, 2);
...@@ -756,23 +756,10 @@ void set_init_style() ...@@ -756,23 +756,10 @@ void set_init_style()
style (calibration, 1); style (calibration, 1);
style (fast_forward, 3);
style (fast_backward, 3);
style (slow_forward, 3);
style (slow_backward, 3);
style (confirm_initialisation, 3); style_initialisation(3);
style_exchange_configuration(3);
style (initial_volume_mL, 3);
style (initial_volume_mL_label, 3);
style (volume_exchange_mL_label, 3);
style (volume_exchange_mL, 3);
style (exchange_throughtput_uL_per_sec_label, 3);
style (exchange_throughtput_uL_per_sec, 3);
style (label_push_pull_choice, 3);
style (switch_push_pull_choice, 3);
style (start_exchange, 3);
style (label_remaining_volume_mL, 3); style (label_remaining_volume_mL, 3);
...@@ -890,8 +877,8 @@ void style_syringe_filled_placement_on() ...@@ -890,8 +877,8 @@ void style_syringe_filled_placement_on()
Disable the calibration. Disable the calibration.
***/ ***/
{ {
ESPUI.print(status_syringe_filled, "En place"); ESPUI.print(status_syringe_filled_placement, "En place");
style (status_syringe_filled, 1); style (status_syringe_filled_placement, 1);
style (syringe_filled_placement, 1); style (syringe_filled_placement, 1);
ESPUI.setEnabled(calibration, false); ESPUI.setEnabled(calibration, false);
...@@ -907,8 +894,8 @@ void style_syringe_filled_placement_off() ...@@ -907,8 +894,8 @@ void style_syringe_filled_placement_off()
Enable the calibration. Enable the calibration.
***/ ***/
{ {
ESPUI.print(status_syringe_filled, "Enlevée"); ESPUI.print(status_syringe_filled_placement, "Enlevée");
style (status_syringe_filled, 2); style (status_syringe_filled_placement, 2);
style (syringe_filled_placement, 2); style (syringe_filled_placement, 2);
ESPUI.setEnabled(calibration, true); ESPUI.setEnabled(calibration, true);
...@@ -916,9 +903,27 @@ void style_syringe_filled_placement_off() ...@@ -916,9 +903,27 @@ void style_syringe_filled_placement_off()
} }
void style_initialisation(int style_choice)
{
style (fast_forward, style_choice);
style (fast_backward, style_choice);
style (slow_forward, style_choice);
style (slow_backward, style_choice);
style (confirm_initialisation, style_choice);
}
void style_exchange_configuration(int style_choice)
{
style (initial_volume_mL, style_choice);
style (initial_volume_mL_label, style_choice);
style (volume_exchange_mL_label, style_choice);
style (volume_exchange_mL, style_choice);
style (exchange_throughtput_uL_per_sec_label, style_choice);
style (exchange_throughtput_uL_per_sec, style_choice);
style (label_push_pull_choice, style_choice);
style (switch_push_pull_choice, style_choice);
style (start_exchange, style_choice);
}
//OTHER METHODS //OTHER METHODS
......
...@@ -21,7 +21,7 @@ uint16_t configurations, new_syringe, features; ...@@ -21,7 +21,7 @@ uint16_t configurations, new_syringe, features;
int status_syringe_pump; int status_syringe_pump;
uint16_t stop_syringe_pump; uint16_t stop_syringe_pump;
int status_syringe_filled; int status_syringe_filled_placement;
uint16_t syringe_filled_placement; uint16_t syringe_filled_placement;
int status_limit_switch; int status_limit_switch;
...@@ -122,13 +122,14 @@ void syringe_pump_on_off(); ...@@ -122,13 +122,14 @@ void syringe_pump_on_off();
//STYLE_METHODS //STYLE_METHODS
void style (uint16_t id, int style); void style (uint16_t id, int style);
void set_init_style(); void set_initial_style();
void set_theme(int theme); void set_theme(int theme);
void style_syringe_pump_on(); void style_syringe_pump_on();
void style_syringe_pump_off(); void style_syringe_pump_off();
void style_syringe_filled_placement_on(); void style_syringe_filled_placement_on();
void style_syringe_filled_placement_off(); void style_syringe_filled_placement_off();
void style_initialisation(int style_choice);
void style_exchange_configuration(int style_choice);
//OTHER_METHODS //OTHER_METHODS
......
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