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

Caging the clockwise_equals_push to clockwise_equals_forward and adapt...

Caging the clockwise_equals_push to clockwise_equals_forward and adapt fast/slow forward/backward bbutton for them to really work with this new feature
parent e17dc40e
No related branches found
No related tags found
1 merge request!17Malaurie's work on UI + CLI interface + AccelStepper interface
...@@ -246,13 +246,12 @@ void Web :: fast_backward_callback (Control *sender, int type) ...@@ -246,13 +246,12 @@ void Web :: fast_backward_callback (Control *sender, int type)
digitalWrite(SLEEP, LOW); digitalWrite(SLEEP, LOW);
syringe_filled.move_to_mm(syringe_filled.get_clockwise_equals_push()? -50:50); syringe_filled.move_to_mm(-50);
syringe_filled.set_speed_mm_per_sec(50); syringe_filled.set_speed_mm_per_sec(50);
break; break;
case B_UP: case B_UP:
style_syringe_pump_off(); style_syringe_pump_off();
motor_release_action(); motor_release_action();
...@@ -278,18 +277,15 @@ void Web :: fast_forward_callback (Control *sender, int type) ...@@ -278,18 +277,15 @@ void Web :: fast_forward_callback (Control *sender, int type)
digitalWrite(SLEEP, LOW); digitalWrite(SLEEP, LOW);
syringe_filled.move_to_mm(syringe_filled.get_clockwise_equals_push()? 50:-50); syringe_filled.move_to_mm(50);
syringe_filled.set_speed_mm_per_sec(50); syringe_filled.set_speed_mm_per_sec(50);
break; break;
case B_UP: case B_UP:
style_syringe_pump_off(); style_syringe_pump_off();
motor_release_action(); motor_release_action();
break; break;
} }
...@@ -308,19 +304,16 @@ void Web :: slow_backward_callback (Control *sender, int type) ...@@ -308,19 +304,16 @@ void Web :: slow_backward_callback (Control *sender, int type)
case B_DOWN: case B_DOWN:
digitalWrite(SLEEP, LOW); digitalWrite(SLEEP, LOW);
syringe_filled.move_to_mm(syringe_filled.get_clockwise_equals_push()? -50:50); syringe_filled.move_to_mm(-50);
syringe_filled.set_speed_mm_per_sec(0.5); syringe_filled.set_speed_mm_per_sec(0.5);
break; break;
case B_UP: case B_UP:
style_syringe_pump_off(); style_syringe_pump_off();
motor_release_action(); motor_release_action();
break; break;
} }
...@@ -340,21 +333,18 @@ void Web :: slow_forward_callback (Control *sender, int type) ...@@ -340,21 +333,18 @@ void Web :: slow_forward_callback (Control *sender, int type)
case B_DOWN: case B_DOWN:
digitalWrite(SLEEP, LOW); digitalWrite(SLEEP, LOW);
syringe_filled.move_to_mm(syringe_filled.get_clockwise_equals_push()? 50:-50); syringe_filled.move_to_mm(50);
syringe_filled.set_speed_mm_per_sec(0.5); syringe_filled.set_speed_mm_per_sec(0.5);
break; break;
case B_UP: case B_UP:
style_syringe_pump_off(); style_syringe_pump_off();
motor_release_action(); motor_release_action();
break; break;
} }
serial_print ("Slow_forward", sender); serial_print ("Slow_forward", sender);
} }
...@@ -684,34 +674,33 @@ void Web :: syringe_pump_length_mm_callback(Control* sender, int type) ...@@ -684,34 +674,33 @@ void Web :: syringe_pump_length_mm_callback(Control* sender, int type)
Serial.println(""); Serial.println("");
} }
void Web :: clockwise_equals_push_callback(Control* sender, int value) void Web :: clockwise_equals_forward_callback(Control* sender, int value)
/*** /***
-Argument : Pointer to the controller calling the function, integer according to the controller type. -Argument : Pointer to the controller calling the function, integer according to the controller type.
-Return : / -Return : /
-Action : Print the value of the convention chosen via the serial port. -Action : Print the value of the convention chosen via the serial port.
Change the clockwise_equals_push_label to display the information. Change the clockwise_equals_forward_label to display the information.
***/ ***/
{ {
switch (value) switch (value)
{ {
case S_ACTIVE: case S_ACTIVE:
syringe_filled.set_clockwise_equals_push(true); syringe_filled.set_clockwise_equals_forward(true);
ESPUI.print(clockwise_equals_push_label, "Horaire = Injection"); ESPUI.print(clockwise_equals_forward_label, "Horaire = Injection");
syringe_filled.save_json(); syringe_filled.save_json();
break; break;
case S_INACTIVE: case S_INACTIVE:
syringe_filled.set_clockwise_equals_push(false); syringe_filled.set_clockwise_equals_forward(false);
ESPUI.print(clockwise_equals_push_label, "Horaire = Aspiration"); ESPUI.print(clockwise_equals_forward_label, "Horaire = Aspiration");
syringe_filled.save_json(); syringe_filled.save_json();
break; break;
} }
serial_print ("clockwise_equals_push (sender->value)", sender); serial_print ("clockwise_equals_forward (sender->value)", sender);
Serial.println("clockwise_equals_push (json value)"); Serial.println("clockwise_equals_forward (json value)");
Serial.println(String("Value: ") + String(syringe_filled.get_clockwise_equals_push())); Serial.println(String("Value: ") + String(syringe_filled.get_clockwise_equals_forward()));
Serial.println(""); Serial.println("");
} }
...@@ -893,20 +882,16 @@ void Web :: set_initial_style() ...@@ -893,20 +882,16 @@ void Web :: set_initial_style()
//features //features
style (syringe_pump_length_mm_value, 3); style (syringe_pump_length_mm_value, 3);
style (lead_screw_pitch_mm, 3); style (lead_screw_pitch_mm, 3);
style (clockwise_equals_push_label, 3); style (clockwise_equals_forward_label, 3);
style (clockwise_equals_push, 3); style (clockwise_equals_forward, 3);
style (microstep_configuration, 3); style (microstep_configuration, 3);
style (motor_steps, 3); style (motor_steps, 3);
style (motor_release_label, 3); style (motor_release_label, 3);
style (motor_release, 3); style (motor_release, 3);
// //
style (syringe_selection, 3); style (syringe_selection, 3);
......
...@@ -112,7 +112,7 @@ uint16_t get_id_status_limit_switch(); ...@@ -112,7 +112,7 @@ uint16_t get_id_status_limit_switch();
//features : Configurations avancées //features : Configurations avancées
void syringe_pump_length_mm_callback(Control* sender, int type); void syringe_pump_length_mm_callback(Control* sender, int type);
void clockwise_equals_push_callback(Control* sender, int value); void clockwise_equals_forward_callback(Control* sender, int value);
void microstep_configuration_callback(Control* sender, int type); void microstep_configuration_callback(Control* sender, int type);
void motor_steps_callback(Control* sender, int type); void motor_steps_callback(Control* sender, int type);
void motor_release_callback(Control* sender, int type); void motor_release_callback(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