From 398e1c7cfcf0482dda29542848bcecc014721c36 Mon Sep 17 00:00:00 2001 From: Malaurie Bernard <mbernard@kinouby> Date: Wed, 23 Aug 2023 16:02:00 +0200 Subject: [PATCH] Changing ckeck_configuration and show_configuration --- syringefilled.cpp | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/syringefilled.cpp b/syringefilled.cpp index 7c51b7c..eabd20f 100644 --- a/syringefilled.cpp +++ b/syringefilled.cpp @@ -354,16 +354,16 @@ bool SyringeFilled :: check_configuration() if (get_exchange_throughput_uL_per_min() <= 0) return false; - if (get_exchange_volume_mL() <= 0) + if (get_exchange_volume_mL() < 0) return false; - if (get_remaining_volume_mL() <= 0) + if (get_remaining_volume_mL() < 0) return false; - if ((get_push()==true) || (get_push()==false)) + if (!((get_push()==true) || (get_push()==false))) return false; - if (!(get_clockwise_equals_push()==true) || (get_clockwise_equals_push()==false)) + if (!((get_clockwise_equals_push()==true) || (get_clockwise_equals_push()==false))) return false; if (get_syringe_pump_length_mm() <= 0) @@ -378,10 +378,10 @@ bool SyringeFilled :: check_configuration() if (get_motor_steps() <= 0) return false; - if (!(get_motor_release()==true) || (get_motor_release()==false)) + if (!((get_motor_release()==true) || (get_motor_release()==false))) return false; - if (!(get_emergency()==true) || (get_emergency()==false)) + if (!((get_emergency()==true) || (get_emergency()==false))) return false; return true; @@ -397,22 +397,22 @@ void SyringeFilled :: show_configuration() //Motor::show_configuration(); //Syringe_filled -Serial.printf("Exchange_throughput : %d in uL/min\n", get_exchange_throughput_uL_per_min()); -Serial.printf("Exchange_volume : %d in mL\n", get_exchange_volume_mL()); -Serial.printf("Remaining_volume : %d in mL\n", get_remaining_volume_mL()); -Serial.printf("Push : %d\n", get_push()); -Serial.printf("Syringe_name : %s\n", get_syringe_name()); -Serial.printf("Clockwise_equals_push : %d\n", get_clockwise_equals_push()); -Serial.printf("Syringe_pump_length : %d in mm\n", get_syringe_pump_length_mm()); -Serial.printf("Lead_screw_pitch : %d in mm\n", get_lead_screw_pitch_mm()); -Serial.printf("Microstep_configuration : %d in step\n", get_microstep_configuration()); -Serial.printf("Motor_steps : %d in step\n", get_motor_steps()); -Serial.printf("Motor_release : %d\n", get_motor_release()); -Serial.printf("Emergency : %d\n", get_emergency()); +Serial.println(String("Exchange_throughput :") + String(get_exchange_throughput_uL_per_min()) + String(" in uL/min")); +Serial.println(String("Exchange_volume : ") + String(get_exchange_volume_mL())+ String(" in mL")); +Serial.println(String("Remaining_volume : ") + String(get_remaining_volume_mL())+ String(" in mL")); +Serial.println(String("Push : ") + String(get_push())); +Serial.println(String("Syringe_name : ") + String(get_syringe_name())); +Serial.println(String("Clockwise_equals_push : ") + String(get_clockwise_equals_push())); +Serial.println(String("Syringe_pump_length : ") + String(get_syringe_pump_length_mm()) + String(" in mm") ); +Serial.println(String("Lead_screw_pitch : ") + String(get_lead_screw_pitch_mm()) + String(" in mm")); +Serial.println(String("Microstep_configuration : ") + String(get_microstep_configuration()) + String(" in step")); +Serial.println(String("Motor_steps : ") + String(get_motor_steps()) + String(" in step")); +Serial.println(String("Motor_release : ") + String(get_motor_release())); +Serial.println(String("Emergency : ") + String(get_emergency())); //Syringe -//Serial.printf("Total_volume : %d\n", get_syringe_filled_data()[get_syringe_name()]["total_volume_mL"]); -//Serial.printf("Internal_diameter : %d\n", get_syringe_filled_data()[get_syringe_name()]["internal_diameter_mm"]); +Serial.println(String("Total_volume : ") + String(syringe.get_syringe_database()[syringe_filled.get_syringe_name().c_str()]["total_volume_mL"])); +Serial.println(String("Internal_diameter : ") + String(syringe.get_syringe_database()[syringe_filled.get_syringe_name().c_str()]["internal_diameter_mm"])); } -- GitLab