Commit 264af495 authored by fmg005's avatar fmg005

Ability to capture and perform infusions

parent a3e04d8b
This diff is collapsed.
......@@ -6,10 +6,15 @@
#include <cstdio>
#include <chrono>
#include <thread>
#include <map>
#include <libconfig.h++>
#include "serial/serial.h"
#include "CLA_Logger.h"
#include "Environment.h"
#include "Action.h"
#include "Pump.h"
#include "Monitor.h"
#include "tcp_monitor_client.h"
/* Pulse header files */
#include "CommonDataModel.h"
......@@ -26,45 +31,51 @@ using namespace std::chrono;
class HardwareSimulator {
private:
serial::Serial* m_serial;
CLA::LOGGER* m_logger;
CLA::Environment* m_env;
void Clear();
size_t SendCommand(string);
string GetResponse();
double systolic_pressure;
double diastolic_pressure;
double heart_rate;
double advance_time;
double real_time;
Config cfg; // API for accessing configuration files
string mode;
/* chrono */
system_clock::time_point m_start;
system_clock::time_point m_end;
//system_clock::time_point m_command_start;
//system_clock::time_point m_command_end;
time_t m_delta;
time_t m_real_time;
time_t m_duration_ms;
//time_t m_command_duration_ms;
time_t m_real_time_duration_ms;
private:
serial::Serial* m_serial;
CLA::Environment m_env;
std::shared_ptr<CLA::LOGGER> m_logger;
CLA::Action m_action;
void Clear();
size_t SendCommand(string);
string GetResponse();
double systolic_pressure;
double diastolic_pressure;
double heart_rate;
double MAP;
double advance_time;
double secs;
double m_bpdrug_infusion_rate;
string mode;
/* chrono */
system_clock::time_point m_start;
system_clock::time_point m_end;
//system_clock::time_point m_command_start;
//system_clock::time_point m_command_end;
time_t m_delta;
time_t m_next_update_time;
time_t m_duration_ms;
//time_t m_command_duration_ms;
time_t m_next_update_time_duration_ms;
duration<double> m_next_start_in;
std::map<std::string, CLA::Pump*> m_pumps;
CLA::Monitor* m_monitor;
public:
HardwareSimulator(serial::Serial*, CLA::LOGGER*, CLA::Environment*);
HardwareSimulator(serial::Serial*, CLA::LOGGER*);
~HardwareSimulator();
bool isOpen();
void SetHeartRate(double);
void SetRespRate(double);
void SetOxygenSat(double);
void SetIBP(int, double, double);
void SetRemoteMode();
void SetLocalMode();
string GetCurrentMode();
void update(std::unique_ptr<PhysiologyEngine>&);
void LoadConfig(const char*);
public:
HardwareSimulator(std::shared_ptr<CLA::LOGGER>&,serial::Serial*,CLA::Environment&,std::map<std::string,CLA::Pump*>&);
HardwareSimulator(std::shared_ptr<CLA::LOGGER>&,serial::Serial*,std::map<std::string,CLA::Pump*>&);
~HardwareSimulator();
bool isOpen();
void SetHeartRate(double);
void SetRespRate(double);
void SetOxygenSat(double);
void SetIBP(int, double, double);
void SetRemoteMode();
void SetLocalMode();
string GetCurrentMode();
void update(std::unique_ptr<PhysiologyEngine>&);
void LoadConfig(std::unique_ptr<PhysiologyEngine>&);
};
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment