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

Changing method move from syringe_filled to start_exchange to make it easier...

Changing method move from syringe_filled to start_exchange to make it easier to use (and more adapted to our need now.
parent 29b20f38
No related branches found
No related tags found
1 merge request!17Malaurie's work on UI + CLI interface + AccelStepper interface
...@@ -166,7 +166,7 @@ bool SyringeFilled :: is_running () //return true if the motor is currently run ...@@ -166,7 +166,7 @@ bool SyringeFilled :: is_running () //return true if the motor is currently run
return motor_is_running(); return motor_is_running();
} }
void SyringeFilled :: move() void SyringeFilled :: start_exchange()
/*** /***
-Argument : / (We're using informations stored in the class itself) -Argument : / (We're using informations stored in the class itself)
-Return : / -Return : /
...@@ -174,7 +174,6 @@ void SyringeFilled :: move() ...@@ -174,7 +174,6 @@ void SyringeFilled :: move()
***/ ***/
{ {
//Conversions of volumes //Conversions of volumes
float remaining_volume_mm3 = get_remaining_volume_mL()*1000;
float exchange_volume_mm3 = get_exchange_volume_mL()*1000; float exchange_volume_mm3 = get_exchange_volume_mL()*1000;
//Find the section //Find the section
...@@ -184,24 +183,16 @@ void SyringeFilled :: move() ...@@ -184,24 +183,16 @@ void SyringeFilled :: move()
set_speed_mm_per_sec(get_exchange_throughput_uL_per_sec()/section_mm2); set_speed_mm_per_sec(get_exchange_throughput_uL_per_sec()/section_mm2);
if (where_step() == 0) //If we are putting the syringe for the first time if (get_push()) //If we want to deliver some liquid
{ {
move_to_mm_limit_switch(get_syringe_pump_length_mm() - remaining_volume_mm3/section_mm2); move_mm_limit_switch(exchange_volume_mm3/section_mm2);
} }
else else //If we want to recover some liquid
{ {
float initial_position_mm = get_syringe_pump_length_mm() - remaining_volume_mm3/section_mm2; move_to_mm_limit_switch(exchange_volume_mm3/section_mm2);
}
if (get_push()) //If we want to deliver some liquid
{
move_to_mm_limit_switch(initial_position_mm + exchange_volume_mm3/section_mm2);
}
else //If we want to recover some liquid
{
move_to_mm_limit_switch(initial_position_mm - exchange_volume_mm3/section_mm2);
}
}
} }
......
...@@ -83,7 +83,7 @@ class SyringeFilled : public Motor ...@@ -83,7 +83,7 @@ class SyringeFilled : public Motor
//MOVEMENTS //MOVEMENTS
bool is_running (); bool is_running ();
void move(); void start_exchange();
void go_to_zero(); //CLI void go_to_zero(); //CLI
//LIMIT SWITCH //LIMIT SWITCH
......
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