From d1071aeaebe8692d1e02d4d50de3c0af20658247 Mon Sep 17 00:00:00 2001
From: Malaurie Bernard <mbernard@kinouby>
Date: Wed, 28 Jun 2023 13:58:32 +0200
Subject: [PATCH] Deletion of the findZero variable in the syringe class and
 adaptation of the manageEmergency function

---
 syringe.cpp | 4 ----
 syringe.h   | 2 --
 2 files changed, 6 deletions(-)

diff --git a/syringe.cpp b/syringe.cpp
index 17189c4..f0a2923 100644
--- a/syringe.cpp
+++ b/syringe.cpp
@@ -29,7 +29,6 @@ void Syringe::showConfiguration (const Syringe_configuration_t& conf)
                   mm3ToMm(conf.rate_ul_per_s),
                   conf.volume_value * conf.volume_unit_ul,
                   conf.direction > 0? "infuse": "withdraw",
-                  conf.findZero,
                   emergency(),
                   stepToMm(step), mmToMm3(stepToMm(step)), step); //Current position of syringe pump in terms of displacement, volume and motor pitch
 }
@@ -142,7 +141,6 @@ void Syringe::findZero (float mmPerSec, float maxCourseMm)
         setSpeedMmPerSec(mm3ToMm(current_configuration.rate_ul_per_s));
     resetPosition();
     moveToMm(-maxCourseMm);
-    current_configuration.findZero = true;
 }
 
 void Syringe::runFromEmergency (float mmPerSec, float maxCourseMm)
@@ -154,7 +152,6 @@ void Syringe::runFromEmergency (float mmPerSec, float maxCourseMm)
 {
     if (emergency())
     {
-        current_configuration.findZero = true;
         Serial.printf("EMERGENCY: running away slowly\n");
         setSpeedMmPerSec(mmPerSec);
         resetPosition();
@@ -169,7 +166,6 @@ void Syringe::resetPosition ()
 -Action   : Changes the zero position as the current one
 ***/
 {
-  //current_configuration.findZero = false;
   Motor::resetPosition();
 }
 
diff --git a/syringe.h b/syringe.h
index 963f5c8..45b2ead 100644
--- a/syringe.h
+++ b/syringe.h
@@ -17,7 +17,6 @@ public:
 		float volume_value; // see volume_unit_ul    /***************************a quoi sert cette variable ? pk pas avoir directement fait volume_in_ul**************/
 		float volume_unit_ul; // volume in ul = volume_value * volume_unit_ul
 		int direction;
-    bool findZero; //to know when we are initializing the pump position
 	} Syringe_configuration_t;
 
 
@@ -103,7 +102,6 @@ private:
 	    .volume_value = 50,
 	    .volume_unit_ul = 1,
 	    .direction = 1,  // 1 = push, -1 = pull
-      .findZero = false,
 	};
 
 	bool is_configured = false;
-- 
GitLab