diff --git a/pumpsyringe.cpp b/pumpsyringe.cpp deleted file mode 100644 index 14b00be0d21db42e1c95332632fba4df8e0d4598..0000000000000000000000000000000000000000 --- a/pumpsyringe.cpp +++ /dev/null @@ -1,61 +0,0 @@ - -#include "pumpsyringe.h" - -//SET METHODS -void PumpSyringe :: set_screw_thread_mm(float screw_thread_mm) -{ - PumpSyringeJSON["screw_thread_mm"] = screw_thread_mm; -} - -void PumpSyringe :: set_clockwise_equals_forward(bool clockwise_equals_forward) -{ - PumpSyringeJSON["clockwise_equals_forward"] = clockwise_equals_forward; -} - -void PumpSyringe :: set_id(int id) -{ - PumpSyringeJSON["id"] = id; -} - - - -//GET METHODS -float PumpSyringe :: get_screw_thread_mm() -{ - return PumpSyringeJSON["screw_thread_mm"].as<float>(); -} - -bool PumpSyringe :: get_clockwise_equals_forward() -{ - return PumpSyringeJSON["clockwise_equals_forward"].as<float>(); -} - -int PumpSyringe :: get_id() -{ - return PumpSyringeJSON["id"].as<float>(); -} - - - - - -void PumpSyringe :: setupJsonPumpSyringe(float screw_thread_mm, bool clockwise_equals_forward, int id) -{ - - //ADD INITIALISATION VALUES TO THE DOC - PumpSyringeJSON["screw_thread_mm"] = screw_thread_mm; - PumpSyringeJSON["clockwise_equals_forward"] = clockwise_equals_forward; - PumpSyringeJSON["id"] = id; - - - -} - - - - - - - - - diff --git a/pumpsyringe.h b/pumpsyringe.h deleted file mode 100644 index b990f194fb3071a7bb78d411fba78118bab9e205..0000000000000000000000000000000000000000 --- a/pumpsyringe.h +++ /dev/null @@ -1,30 +0,0 @@ -#pragma once - -#include <ArduinoJson.h> - -class PumpSyringe -{ - private : - - float _screw_thread_mm; - bool _clockwise_equals_forward; - int _id; - - public : - - //SET METHODS - void set_screw_thread_mm(float screw_thread_mm); - void set_clockwise_equals_forward(bool clockwise_equals_forward); - void set_id(int id); - - //GET METHODS - float get_screw_thread_mm(); - bool get_clockwise_equals_forward(); - int get_id(); - - //JSON DOCUMENT - StaticJsonDocument<200> PumpSyringeJSON; //200 = RAM allocated to this document - - void setupJsonPumpSyringe(float screw_thread_mm, bool clockwise_equals_forward, int id); - -}; diff --git a/syringefilled.cpp b/syringefilled.cpp index 575f2e5f822ccbb7377de6d180429ddb321ac518..808193a7296467599892adef2ec1e7c94aebc5a9 100644 --- a/syringefilled.cpp +++ b/syringefilled.cpp @@ -31,6 +31,16 @@ void SyringeFilled :: set_id_syringe(int* id_syringe){ SyringeFilledJSON["id_syringe"] = id_syringe; } +void SyringeFilled :: set_screw_thread_mm(float screw_thread_mm) +{ + SyringeFilledJSON["screw_thread_mm"] = screw_thread_mm; +} + +void SyringeFilled :: set_clockwise_equals_forward(bool clockwise_equals_forward) +{ + SyringeFilledJSON["clockwise_equals_forward"] = clockwise_equals_forward; +} + //GET METHODS float SyringeFilled :: get_exchange_throughput_uL_per_sec() @@ -58,9 +68,19 @@ int* SyringeFilled :: get_id_syringe() return SyringeFilledJSON["id_syringe"].as<int*>(); } +float SyringeFilled :: get_screw_thread_mm() +{ + return SyringeFilledJSON["screw_thread_mm"].as<float>(); +} + +bool SyringeFilled :: get_clockwise_equals_forward() +{ + return SyringeFilledJSON["clockwise_equals_forward"].as<float>(); +} + -void SyringeFilled :: setupJsonSyringeFilled(float exchange_throughput_uL_per_sec, float exchange_volume_mL, float remaining_volume_mL, bool push, int* id_syringe) +void SyringeFilled :: setupJsonSyringeFilled(float exchange_throughput_uL_per_sec, float exchange_volume_mL, float remaining_volume_mL, bool push, int* id_syringe, float screw_thread_mm, bool clockwise_equals_forward) { //ADD INITIALISATION VALUES TO THE DOC @@ -69,6 +89,8 @@ void SyringeFilled :: setupJsonSyringeFilled(float exchange_throughput_uL_per_se SyringeFilledJSON["remaining_volume_mL"] = remaining_volume_mL; SyringeFilledJSON["push"] = push; SyringeFilledJSON["id_syringe"] = SyringeJSON["id"]; + SyringeFilledJSON["screw_thread_mm"] = screw_thread_mm; + SyringeFilledJSON["clockwise_equals_forward"] = clockwise_equals_forward; //GENERATE THE MINIFIED JSON AND SEND IT TO THE SERIAL PORT diff --git a/syringefilled.h b/syringefilled.h index aa87d8ed784b602b5df048565d8783d1dfe9083c..49aacc77f14113473d36a8766ae3545687fd16b5 100644 --- a/syringefilled.h +++ b/syringefilled.h @@ -5,25 +5,46 @@ class SyringeFilled : Motor { - + /*** + * Role of this class : + * -Store information about liquid + * -Get informations about movement required + * -Manage movements + + ***/ private : + //SyringeFilled float _exchange_throughput_uL_per_sec; float _exchange_volume_mL; float _remaining_volume_mL; bool _push; //false means pull - int* _id_syringe; + + //Syringe + int* _id_syringe; //Not sure how to manage it + + //Pump-Syringe + float _screw_thread_mm; + bool _clockwise_equals_forward; + 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); void set_exchange_volume_mL(float exchange_volume_mL); void set_remaining_volume_mL(float remaining_volume_mL); void set_push(bool push); void set_id_syringe(int* id_syringe); + void set_screw_thread_mm(float screw_thread_mm); + void set_clockwise_equals_forward(bool clockwise_equals_forward); //GET METHODS @@ -32,12 +53,14 @@ class SyringeFilled : Motor float get_remaining_volume_mL(); bool get_push(); int* get_id_syringe(); + float get_screw_thread_mm(); + bool get_clockwise_equals_forward(); //JSON DOCUMENT StaticJsonDocument<200> SyringeFilledJSON; //200 = RAM allocated to this document - void setupJsonSyringeFilled(float exchange_throughput_uL_per_sec, float exchange_volume_mL, float remaining_volume_mL, bool push, int* id_syringe); + void setupJsonSyringeFilled(float exchange_throughput_uL_per_sec, float exchange_volume_mL, float remaining_volume_mL, bool push, int* id_syringe, float screw_thread_mm, bool clockwise_equals_forward); };