diff --git a/syringe.cpp b/syringe.cpp index 0fe5407e01d835881a74fd48ce6fb19dc7710704..25a7a27744391e9864e5cb359c0523584ce8bc15 100644 --- a/syringe.cpp +++ b/syringe.cpp @@ -3,6 +3,16 @@ #include "syringe.h" +//CONSTRUCTORS +Syringe :: Syringe(float total_volume_mL, float internal_diameter_mm, string id) +{ + set_total_volume_mL(total_volume_mL); + set_internal_diameter_mm(internal_diameter_mm); + set_id(id); +} + + + //SET METHODS void Syringe :: set_total_volume_mL(float total_volume_mL) diff --git a/syringe.h b/syringe.h index 614777ae32faf42a54cddee35e5f5739b7dc3395..4f1d06f65914431bfbe7271bc4a451cda47bac81 100644 --- a/syringe.h +++ b/syringe.h @@ -21,6 +21,9 @@ class Syringe public : + //CONSTRUCTORS + Syringe(float total_volume_mL, float internal_diameter_mm, string id); //There are arguments because we need to know what values to add in the Json document (no default syringe) + //SET METHODS void set_total_volume_mL(float total_volume_mL); void set_internal_diameter_mm(float internal_diameter_mm); diff --git a/syringefilled.cpp b/syringefilled.cpp index b2e116fd9b52f5714273bd8ee0c25a9f900e35fa..27d7521d98a21576863a2c2e38de412ff12fe8a8 100644 --- a/syringefilled.cpp +++ b/syringefilled.cpp @@ -1,10 +1,21 @@ #include "syringefilled.h" -/* + //CONSTRUCTORS -SyringeFilled :: SyringeFilled() : Motor(&ISRStepper) _exchange_throughput_uL_per_sec(0), _exchange_volume_mL(0), _remaining_volume_mL(0), _push(true), id_syringe(SyringeJSON["1"]) -*/ +SyringeFilled :: SyringeFilled() : Motor (&ISRStepper) //pb with my motor constructor +{ + set_exchange_throughput_uL_per_sec(1); + set_exchange_volume_mL(1); + set_remaining_volume_mL(1); + set_push(true); + set_id_syringe(??); //put one of the syringes stored by default, undefined for now + set_screw_thread_mm(4); + set_clockwise_equals_push(true); + set_emergency(false); + +} + //SET METHODS void SyringeFilled :: set_exchange_throughput_uL_per_sec(float exchange_throughput_uL_per_sec) diff --git a/syringefilled.h b/syringefilled.h index 31167bd1181420f88f3e645967fb55d1014ca4a0..6727883e465de31038b3664395ce6f5692d7ce10 100644 --- a/syringefilled.h +++ b/syringefilled.h @@ -1,6 +1,7 @@ #pragma once #include "syringe.h" +#include "motor.h" #include <ArduinoJson.h> #include "math.h" #include <interrupts.h> // InterruptLock @@ -38,11 +39,10 @@ class SyringeFilled : public Motor bool _emergency; public : - /* + //CONSTRUCTORS SyringeFilled(); - SyringeFilled(float exchange_throughput_uL_per_sec, float exchange_volume_mL, float remaining_volume_mL, bool push, int* id); -*/ + //SET METHODS void set_exchange_throughput_uL_per_sec(float exchange_throughput_uL_per_sec);