Skip to content
Snippets Groups Projects
syringefilled.cpp 1.9 KiB
Newer Older
Malaurie Bernard's avatar
Malaurie Bernard committed
//SET METHODS
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_syringe(int* id_syringe){
    SyringeFilledJSON["id_syringe"] = id_syringe;
Malaurie Bernard's avatar
Malaurie Bernard committed
//GET METHODS
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_syringe()
    return SyringeFilledJSON["id_syringe"].as<int*>();
void SyringeFilled :: setupJsonSyringeFilled(float exchange_throughput_uL_per_sec, float exchange_volume_mL, float remaining_volume_mL, bool push, int* id_syringe)
{
    
    //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_syringe"] = SyringeJSON["id"];


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

}