Commit 2cf6433c authored by fmg005's avatar fmg005

method should log only the infusion rates

parent a29255e8
......@@ -10,8 +10,7 @@ CLA::LOGGER::LOGGER(const string& name): m_patient_name(move(name)){
<<"Level"<<setw(9)<<"Message"<<endl;
m_logstream[1]<<"start time,"<<"engine adv duration(s),"<<"command duration(s),"\
<<"infusion duration(s),"<<"totals duration(s),"<<"next_update time"<<endl;
m_logstream[2]<<"Time,"<<"Systolic,"<<"Diastolic,"<<"MAP,"<<"bpdrug rate,"\
<<"saline rate"<<endl;
m_logstream[2]<<" Engine Time,"<<"bpdrug rate,"<<"saline rate"<<endl;
/* mapping strings to levels */
logging_levels["DEBUG"] = CLA::LOGGER::DEBUG;
logging_levels["INFO"] = CLA::LOGGER::INFO;
......@@ -30,8 +29,7 @@ m_patient_name(move(name)) {
<<"Level"<<setw(9)<<"Message"<<endl;
m_logstream[1]<<"start time,"<<"engine adv duration(s),"<<"command duration(s),"\
<<"infusion duration(s),"<<"totals duration(s),"<<"next_update time"<<endl;
m_logstream[2]<<"Time,"<<"Systolic,"<<"Diastolic,"<<"MAP,"<<"bpdrug rate,"\
<<"saline rate"<<endl;
m_logstream[2]<<"Engine Time,"<<"bpdrug rate,"<<"saline rate"<<endl;
/* mapping strings to levels */
logging_levels["DEBUG"] = CLA::LOGGER::DEBUG;
logging_levels["INFO"] = CLA::LOGGER::INFO;
......@@ -112,16 +110,10 @@ next_update_time) {
ss.str("");
}
void CLA::LOGGER::log_data(system_clock::time_point _time, double systolic, \
double diastolic, double MAP, double bpdrug_rate, double saline_rate) {
ss<< format_chrono_time(_time);
void CLA::LOGGER::log_data(double engine_time, double bpdrug_rate, double \
saline_rate) {
ss<< engine_time;
ss<< ",";
ss<< systolic;
ss<< ",";
ss<< diastolic;
ss<< ",";
ss<<MAP;
ss<<",";
ss<<bpdrug_rate;
ss<<",";
ss<<saline_rate;
......
......@@ -3,7 +3,7 @@
HardwareSimulator::HardwareSimulator( std::shared_ptr<CLA::LOGGER>& logger,
serial::Serial* my_serial,CLA::Environment& env, std::map<std::string, CLA::Pump*>&
pumps) : m_serial(my_serial), m_logger(logger), m_env(env),
m_pumps(pumps), m_action(logger, pumps, env) {
m_pumps(pumps), m_action(logger, pumps) {
m_monitor = new CLA::Monitor(logger, "/monitor", "std_msgs/Float64");
}
......@@ -48,8 +48,8 @@ void HardwareSimulator::update(std::unique_ptr<PhysiologyEngine>& engine) {
/* total duration */
m_total_duration_ms = duration_cast<milliseconds>(m_infusion_end - m_start).count();
/* log data */
m_logger->log_data(m_start, systolic_pressure, diastolic_pressure, MAP, \
m_env.bpdrug_rate, m_env.saline_rate);
m_logger->log_data(engine->GetSimulationTime(TimeUnit::s), \
m_action.get_bpdrug_rate(), m_action.get_saline_rate());
/* log durations */
m_logger->log_duration(m_start,m_engine_duration_ms,m_command_duration_ms, \
m_infusion_duration_ms, m_total_duration_ms, m_next_update_time);
......
......@@ -43,8 +43,7 @@ namespace CLA {
~LOGGER();
void log_duration(system_clock::time_point, time_t, time_t, time_t, \
time_t, time_t);
void log_data(system_clock::time_point, double, double, double, double, \
double);
void log_data(double, double, double);
void setLevel(const string&);
void setVerbosity(bool);
template <typename T>
......
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