Newer
Older
{
ESPUI.print(status_syringe_pump, "En marche");
style (status_syringe_pump, 1);
style (stop_syringe_pump, 1);
}
Malaurie Bernard
committed
void Web :: style_syringe_pump_off()
/***
-Argument : /
-Return : /
-Action : Change the status_syringe_pump label to display the information.
Change the style of the controller involved.
Causes the stop of the syringe pump.
***/
{
ESPUI.print(status_syringe_pump, "A l'arrêt");
style (status_syringe_pump, 2);
style (stop_syringe_pump, 2);
syringe_filled.stop();
}
Malaurie Bernard
committed
void Web :: style_syringe_filled_placement_on()
/***
-Argument : /
-Return : /
-Action : Change the status_syringe_filled label to display the information.
Change the style of the controller involved.
Disable the calibration.
***/
{
Malaurie Bernard
committed
ESPUI.print(status_syringe_filled_placement, "En place");
style (status_syringe_filled_placement, 1);
style (syringe_filled_placement, 1);
ESPUI.setEnabled(calibration, false);
style (calibration, 2);
}
Malaurie Bernard
committed
void Web :: style_syringe_filled_placement_off()
/***
-Argument : /
-Return : /
-Action : Change the status_syringe_filled label to display the information.
Change the style of the controller involved.
Enable the calibration.
***/
{
Malaurie Bernard
committed
ESPUI.print(status_syringe_filled_placement, "Enlevée");
style (status_syringe_filled_placement, 2);
style (syringe_filled_placement, 2);
ESPUI.setEnabled(calibration, true);
style (calibration, 1);
}
Malaurie Bernard
committed
void Web :: style_initialisation(int style_choice)
Malaurie Bernard
committed
{
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);
}
Malaurie Bernard
committed
void Web :: style_exchange_configuration(int style_choice)
Malaurie Bernard
committed
{
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_min_or_duration_sec_label, style_choice);
style (exchange_throughtput_uL_per_min_or_duration_sec, style_choice);
Malaurie Bernard
committed
style (label_push_pull_choice, style_choice);
style (switch_push_pull_choice, style_choice);
style (start_exchange, style_choice);
}
//OTHER METHODS
/***
-Argument : The page on which the info must display.
-Return : /
-Action : Read the syringe_json file so it get/recover all the syringe models registered.
***/
{
JsonObject root = syringe.get_syringe_database_object();
for (JsonPair kv : root)
{
Malaurie Bernard
committed
uint16_t choice = ESPUI.addControl(ControlType::Option, kv.key().c_str(), kv.key().c_str(), ControlColor::None, syringe_selection);
style (choice, 3);
Malaurie Bernard
committed
Malaurie Bernard
committed
void Web :: number_max_min(int min, int max, uint16_t control)
Malaurie Bernard
committed
{
ESPUI.addControl(Min, "", String(min), ControlColor :: None, control);
ESPUI.addControl(Max, "", String(max), ControlColor :: None, control);
}
void Web :: motor_release_action()
{
if (syringe_filled.get_motor_release())
{
digitalWrite(SLEEP, LOW);
}
else
digitalWrite(SLEEP, HIGH);
}
Malaurie Bernard
committed
void Web :: serial_print (String name, Control* sender)
{
Serial.println(name);
Serial.println(String("Value: ") + String(sender->type));
Serial.println(String("ID: ") + sender->id);
Serial.println("");
}
Malaurie Bernard
committed
Malaurie Bernard
committed
void Web :: web_loop()
if(millis() > last_time + 4) {
last_time = millis();
//ESPUI.updateSlider(remaining_volume_mL, syringe_filled.step_to_mm(syringe_filled.where_step()*100/syringe_filled.get_syringe_pump_length_mm()));
Malaurie Bernard
committed
if (syringe_filled.is_running()==false)
style_syringe_pump_off();
syringe_filled.set_update_remaining_volume(false);
if (syringe_filled.get_motor_release())
digitalWrite(SLEEP, LOW);
if (syringe_filled.get_emergency())
{
ESPUI.print(status_limit_switch, "On");
style (status_limit_switch, 2);
}
else
{
ESPUI.print(status_limit_switch, "Off");
style (status_limit_switch, 1);
}
if (syringe_filled.get_update_remaining_volume())
ESPUI.updateSlider(remaining_volume_mL, syringe_filled.get_remaining_volume_mL() + syringe_filled.mm_to_volume(syringe_filled.step_to_mm(syringe_filled.where_step())));
}