diff --git a/syringefilled.cpp b/syringefilled.cpp index f65ccfcf1cf36426e2e2136511c2618481c8334b..b278c73d02b96e80afdccc1eaeda156bf2cded8a 100644 --- a/syringefilled.cpp +++ b/syringefilled.cpp @@ -166,7 +166,7 @@ bool SyringeFilled :: is_running () //return true if the motor is currently run return motor_is_running(); } -void SyringeFilled :: move() +void SyringeFilled :: start_exchange() /*** -Argument : / (We're using informations stored in the class itself) -Return : / @@ -174,7 +174,6 @@ void SyringeFilled :: move() ***/ { //Conversions of volumes - float remaining_volume_mm3 = get_remaining_volume_mL()*1000; float exchange_volume_mm3 = get_exchange_volume_mL()*1000; //Find the section @@ -184,24 +183,16 @@ void SyringeFilled :: move() 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; - - 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); - } - } + move_to_mm_limit_switch(exchange_volume_mm3/section_mm2); + } + } diff --git a/syringefilled.h b/syringefilled.h index 4a5e224f4ab3aded6f4a491fd069e1de72db3470..e559d6304c428cf2bf119f53ab9980c9471e197a 100644 --- a/syringefilled.h +++ b/syringefilled.h @@ -83,7 +83,7 @@ class SyringeFilled : public Motor //MOVEMENTS bool is_running (); - void move(); + void start_exchange(); void go_to_zero(); //CLI //LIMIT SWITCH