Skip to content
Snippets Groups Projects
Commit 01753eb0 authored by Malaurie Bernard's avatar Malaurie Bernard
Browse files

Merging Class PumpSyringe and SyringeFilled into just SyringeFilled.

parent 97c0e7e5
No related branches found
No related tags found
1 merge request!17Malaurie's work on UI + CLI interface + AccelStepper interface
#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;
}
#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);
};
......@@ -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
......
......@@ -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);
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment