Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cla_prosim_driver
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fmg005
cla_prosim_driver
Commits
264af495
Commit
264af495
authored
May 29, 2018
by
fmg005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ability to capture and perform infusions
parent
a3e04d8b
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
124 additions
and
111 deletions
+124
-111
HardwareSimulator.cpp
HardwareSimulator.cpp
+75
-73
include/HardwareSimulator.h
include/HardwareSimulator.h
+49
-38
No files found.
HardwareSimulator.cpp
View file @
264af495
This diff is collapsed.
Click to expand it.
include/HardwareSimulator.h
View file @
264af495
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment