|
@ -23,7 +23,7 @@ using namespace std; |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
|
|
|
#define PRE_HEAT_TIME (2)
|
|
|
#define PRE_HEAT_TIME (2)
|
|
|
#define DVALUE_COMPUTEPERIOD_TIME_S (60.0)
|
|
|
|
|
|
|
|
|
#define DVALUE_COMPUTEPERIOD_TIME_S (15.0)
|
|
|
#define MAX_VOLUME (5000)
|
|
|
#define MAX_VOLUME (5000)
|
|
|
|
|
|
|
|
|
DisinfectionCtrlService::DisinfectionCtrlService() {} |
|
|
DisinfectionCtrlService::DisinfectionCtrlService() {} |
|
@ -90,7 +90,8 @@ void DisinfectionCtrlService::computeRemainTime(DisinfectionContext& context) { |
|
|
/**
|
|
|
/**
|
|
|
* @brief 计算Dvalue |
|
|
* @brief 计算Dvalue |
|
|
*/ |
|
|
*/ |
|
|
float dvalue = getDisinfectionDValue(context.h2o2data.min_h2o2); |
|
|
|
|
|
|
|
|
float dvalue = getDisinfectionDValue(context.h2o2data.min_h2o2); |
|
|
|
|
|
context.dvalue = dvalue; |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* @brief 计算 m_nowLoglevel |
|
|
* @brief 计算 m_nowLoglevel |
|
@ -113,6 +114,7 @@ void DisinfectionCtrlService::initContext(DisinfectionContext& context, int logl |
|
|
context.m_nowLoglevel = 0; |
|
|
context.m_nowLoglevel = 0; |
|
|
context.m_loglevel = loglevel; |
|
|
context.m_loglevel = loglevel; |
|
|
context.m_roomvol = roomVol; |
|
|
context.m_roomvol = roomVol; |
|
|
|
|
|
m_context.m_preheatFlag = true; |
|
|
|
|
|
|
|
|
context.stoped_gs = m_dbService->getSettingVal("stoped_gs"); |
|
|
context.stoped_gs = m_dbService->getSettingVal("stoped_gs"); |
|
|
context.continued_gs = m_dbService->getSettingVal("continued_gs"); |
|
|
context.continued_gs = m_dbService->getSettingVal("continued_gs"); |
|
@ -130,7 +132,7 @@ void DisinfectionCtrlService::initContext(DisinfectionContext& context, int logl |
|
|
m_zcanHost->warning_light_ctrl_c1002(1, 0, 0, 1, 0); |
|
|
m_zcanHost->warning_light_ctrl_c1002(1, 0, 0, 1, 0); |
|
|
m_deviceIoControlService->heartingPlate_setPower(true); |
|
|
m_deviceIoControlService->heartingPlate_setPower(true); |
|
|
context.csvlogger = m_disinfectionLogsManager->createNewLogger(context.m_disinfectionID); |
|
|
context.csvlogger = m_disinfectionLogsManager->createNewLogger(context.m_disinfectionID); |
|
|
context.csvlogger->write("time,h2o21,temp1,humi1,saturation1,h2o22,temp2,humi2,saturation2,h2o23,temp3,humi3,saturation3,dvalue,nowlog,targetlog,remaintime"); |
|
|
|
|
|
|
|
|
context.csvlogger->write("time,h2o21,temp1,humi1,saturation1,h2o22,temp2,humi2,saturation2,h2o23,temp3,humi3,saturation3,dvalue,nowlog,targetlog,remaintime\n"); |
|
|
} |
|
|
} |
|
|
void DisinfectionCtrlService::finishDisinfection(DisinfectionContext& context) { |
|
|
void DisinfectionCtrlService::finishDisinfection(DisinfectionContext& context) { |
|
|
context.m_remaintime = 0; |
|
|
context.m_remaintime = 0; |
|
@ -167,6 +169,29 @@ void DisinfectionCtrlService::processPreheatState(DisinfectionContext& context) |
|
|
context.sprayLiquidFlag = true; |
|
|
context.sprayLiquidFlag = true; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void DisinfectionCtrlService::dumpDisinfectionLogsToCSV(DisinfectionContext& context) { |
|
|
|
|
|
context.csvlogger->write(fmt::format("{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{}\n", |
|
|
|
|
|
zsteady_clock().elapsedTimeS(m_context.m_starttp), //
|
|
|
|
|
|
m_context.h2o2data.h2o2sensor_data[0].h2o2, //
|
|
|
|
|
|
m_context.h2o2data.h2o2sensor_data[0].temp, //
|
|
|
|
|
|
m_context.h2o2data.h2o2sensor_data[0].humid, //
|
|
|
|
|
|
m_context.h2o2data.h2o2sensor_data[0].saturation, //
|
|
|
|
|
|
m_context.h2o2data.h2o2sensor_data[1].h2o2, //
|
|
|
|
|
|
m_context.h2o2data.h2o2sensor_data[1].temp, //
|
|
|
|
|
|
m_context.h2o2data.h2o2sensor_data[1].humid, //
|
|
|
|
|
|
m_context.h2o2data.h2o2sensor_data[1].saturation, //
|
|
|
|
|
|
m_context.h2o2data.h2o2sensor_data[2].h2o2, //
|
|
|
|
|
|
m_context.h2o2data.h2o2sensor_data[2].temp, //
|
|
|
|
|
|
m_context.h2o2data.h2o2sensor_data[2].humid, //
|
|
|
|
|
|
m_context.h2o2data.h2o2sensor_data[2].saturation, //
|
|
|
|
|
|
m_context.dvalue, //
|
|
|
|
|
|
m_context.m_nowLoglevel, //
|
|
|
|
|
|
m_context.m_targetLoglevel, //
|
|
|
|
|
|
m_context.m_remaintime //
|
|
|
|
|
|
)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
void DisinfectionCtrlService::dumpDisinfectionLogs(DisinfectionContext& context) { |
|
|
void DisinfectionCtrlService::dumpDisinfectionLogs(DisinfectionContext& context) { |
|
|
logger->info("T:{},h2o21:{},t1:{},humi:{},s1:{},h2o22:{},t2:{},humi2:{},s2:{},h2o23:{},t3:{},humi3:{},s3:{},dvalue:{},nowlog:{},targetlog:{},remaintime:{}", |
|
|
logger->info("T:{},h2o21:{},t1:{},humi:{},s1:{},h2o22:{},t2:{},humi2:{},s2:{},h2o23:{},t3:{},humi3:{},s3:{},dvalue:{},nowlog:{},targetlog:{},remaintime:{}", |
|
|
zsteady_clock().elapsedTimeS(m_context.m_starttp), //
|
|
|
zsteady_clock().elapsedTimeS(m_context.m_starttp), //
|
|
@ -187,26 +212,6 @@ void DisinfectionCtrlService::dumpDisinfectionLogs(DisinfectionContext& context) |
|
|
m_context.m_targetLoglevel, //
|
|
|
m_context.m_targetLoglevel, //
|
|
|
m_context.m_remaintime //
|
|
|
m_context.m_remaintime //
|
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
context.csvlogger->write(fmt::format("{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{}", |
|
|
|
|
|
zsteady_clock().elapsedTimeS(m_context.m_starttp), //
|
|
|
|
|
|
m_context.h2o2data.h2o2sensor_data[0].h2o2, //
|
|
|
|
|
|
m_context.h2o2data.h2o2sensor_data[0].temp, //
|
|
|
|
|
|
m_context.h2o2data.h2o2sensor_data[0].humid, //
|
|
|
|
|
|
m_context.h2o2data.h2o2sensor_data[0].saturation, //
|
|
|
|
|
|
m_context.h2o2data.h2o2sensor_data[1].h2o2, //
|
|
|
|
|
|
m_context.h2o2data.h2o2sensor_data[1].temp, //
|
|
|
|
|
|
m_context.h2o2data.h2o2sensor_data[1].humid, //
|
|
|
|
|
|
m_context.h2o2data.h2o2sensor_data[1].saturation, //
|
|
|
|
|
|
m_context.h2o2data.h2o2sensor_data[2].h2o2, //
|
|
|
|
|
|
m_context.h2o2data.h2o2sensor_data[2].temp, //
|
|
|
|
|
|
m_context.h2o2data.h2o2sensor_data[2].humid, //
|
|
|
|
|
|
m_context.h2o2data.h2o2sensor_data[2].saturation, //
|
|
|
|
|
|
m_context.dvalue, //
|
|
|
|
|
|
m_context.m_nowLoglevel, //
|
|
|
|
|
|
m_context.m_targetLoglevel, //
|
|
|
|
|
|
m_context.m_remaintime //
|
|
|
|
|
|
)); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void DisinfectionCtrlService::processDisinfectionState(DisinfectionContext& context) { |
|
|
void DisinfectionCtrlService::processDisinfectionState(DisinfectionContext& context) { |
|
@ -221,6 +226,7 @@ void DisinfectionCtrlService::processDisinfectionState(DisinfectionContext& cont |
|
|
* @brief 周期性计算剩余时间 |
|
|
* @brief 周期性计算剩余时间 |
|
|
*/ |
|
|
*/ |
|
|
computeRemainTime(m_context); |
|
|
computeRemainTime(m_context); |
|
|
|
|
|
dumpDisinfectionLogsToCSV(m_context); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
dumpDisinfectionLogs(m_context); |
|
|
dumpDisinfectionLogs(m_context); |
|
|