Skip to content
Snippets Groups Projects
syringefilled.cpp 1.84 KiB
Newer Older

#include "syringefilled.h"


//SET METHODES
void SyringeFilled :: set_exchange_throughput_uL_per_sec(float exchange_throughput_uL_per_sec)
{
    SyringeFilledJSON["throughput_uL_per_sec"] = exchange_throughput_uL_per_sec;
}

void SyringeFilled :: set_exchange_volume_mL(float exchange_volume_mL)
{
    SyringeFilledJSON["exchange_volume_mL"] = exchange_volume_mL;
}

void SyringeFilled :: set_remaining_volume_mL(float remaining_volume_mL)
{
    SyringeFilledJSON["remaining_volume_mL"] = remaining_volume_mL;
}

void SyringeFilled :: set_push(bool push)
{
    SyringeFilledJSON["push"] = push;
}

void SyringeFilled :: set_id(int* id){
    SyringeFilledJSON["id"] = id;
}


//GET METHODES
float SyringeFilled :: get_exchange_throughput_uL_per_sec()
{
    return SyringeFilledJSON["exchange_throughput_uL_per_sec"].as<float>();
}

float SyringeFilled :: get_exchange_volume_mL()
{
    return SyringeFilledJSON["exchange_volume_mL"].as<float>();
}

float SyringeFilled :: get_remaining_volume_mL()
{
    return SyringeFilledJSON["remaining_volume_mL"].as<float>();
}

bool SyringeFilled :: get_push()
{
    return SyringeFilledJSON["push"].as<bool>();
}

int* SyringeFilled :: get_id()
{
    return SyringeFilledJSON["id"].as<int*>();
}



void SyringeFilled :: setupJsonSyringeFilled(float exchange_throughput_uL_per_sec, float exchange_volume_mL, float remaining_volume_mL, bool push, int* id)
{
    
    //ADD INITIALISATION VALUES TO THE DOC
    SyringeFilledJSON["exchange_throughput_uL_per_sec"] = exchange_throughput_uL_per_sec;
    SyringeFilledJSON["exchange_volume_mL"] = exchange_volume_mL;
    SyringeFilledJSON["remaining_volume_mL"] = remaining_volume_mL;
    SyringeFilledJSON["push"] = push;
    SyringeFilledJSON["id"] = SyringeJSON["id"];


    //GENERATE THE MINIFIED JSON AND SEND IT TO THE SERIAL PORT
    serializeJson(SyringeFilledJSON, Serial);

}