From 4380891d643be634c740cbc73b0a120f3fc8b75c Mon Sep 17 00:00:00 2001
From: Malaurie Bernard <mbernard@kinouby>
Date: Wed, 5 Jul 2023 15:08:51 +0200
Subject: [PATCH] creation of constructors of syringe and syringefilled (not
 finished but it is the first step

---
 syringe.cpp       | 10 ++++++++++
 syringe.h         |  3 +++
 syringefilled.cpp | 17 ++++++++++++++---
 syringefilled.h   |  6 +++---
 4 files changed, 30 insertions(+), 6 deletions(-)

diff --git a/syringe.cpp b/syringe.cpp
index 0fe5407..25a7a27 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 614777a..4f1d06f 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 b2e116f..27d7521 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 31167bd..6727883 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);
-- 
GitLab