|
|
@ -202,7 +202,7 @@ void DisinfectionCtrlService::initContext(DisinfectionContext& context, |
|
|
|
} |
|
|
|
|
|
|
|
shared_ptr<DisinfectionLogger> DisinfectionCtrlService::createCSVLogger(string log_file_name) { |
|
|
|
shared_ptr<DisinfectionLogger> logger = m_disinfectionLogsManager->createNewLogger(log_file_name); |
|
|
|
shared_ptr<DisinfectionLogger> _logger = m_disinfectionLogsManager->createNewLogger(log_file_name); |
|
|
|
// ZIconv::utf8_to_gb2312(str)
|
|
|
|
|
|
|
|
// context.csvlogger->write(
|
|
|
@ -216,14 +216,14 @@ shared_ptr<DisinfectionLogger> DisinfectionCtrlService::createCSVLogger(string l |
|
|
|
// "Remaining time (s)\n" // 22
|
|
|
|
// );
|
|
|
|
|
|
|
|
logger->write( |
|
|
|
_logger->write( |
|
|
|
fmt::format("{}," |
|
|
|
"{},{},{},{}," |
|
|
|
"{},{},{},{}," |
|
|
|
"{},{},{},{}," |
|
|
|
"{},{},{}," |
|
|
|
"{},{},{},{}," |
|
|
|
"{},{}", |
|
|
|
"{},{}" |
|
|
|
"\n", |
|
|
|
ZIconv::noChange("日期"), //
|
|
|
|
ZIconv::noChange("过氧化氢浓度(PPM)"), ZIconv::noChange("温度(C)"), ZIconv::noChange("相对湿度"), ZIconv::noChange("相对饱和度"), //
|
|
|
@ -232,7 +232,7 @@ shared_ptr<DisinfectionLogger> DisinfectionCtrlService::createCSVLogger(string l |
|
|
|
ZIconv::noChange("D值"), ZIconv::noChange("当前LOG"), ZIconv::noChange("目标LOG"), //
|
|
|
|
ZIconv::noChange("加热器电源"), ZIconv::noChange("风机电源"), ZIconv::noChange("空压机电源"), ZIconv::noChange("喷液泵(g/min)"), //
|
|
|
|
ZIconv::noChange("消毒剩余剂量(g)"), ZIconv::noChange("剩余时间(s)"))); |
|
|
|
return logger; |
|
|
|
return _logger; |
|
|
|
} |
|
|
|
|
|
|
|
void DisinfectionCtrlService::dumpDisinfectionLogsToCSV(DisinfectionContext& context) { |
|
|
@ -277,7 +277,7 @@ void DisinfectionCtrlService::dumpDisinfectionLogsToCSV(DisinfectionContext& con |
|
|
|
"{},{},{},{}," |
|
|
|
"{},{},{}," |
|
|
|
"{},{},{},{}," |
|
|
|
"{},{}", |
|
|
|
"{},{}" |
|
|
|
"\n", |
|
|
|
getTime(), //
|
|
|
|
h2o2str[0], tempstr[0], humidstr[0], satstr[0], //
|
|
|
@ -319,16 +319,15 @@ void DisinfectionCtrlService::log(DisinfectionContext& context) { |
|
|
|
|
|
|
|
int remaintime = getEstimatedRemainingTimeS(); |
|
|
|
|
|
|
|
context.csvlogger->write( |
|
|
|
logger->info( |
|
|
|
fmt::format("{}," |
|
|
|
"s0({},{},{},{})," |
|
|
|
"s1({},{},{},{})," |
|
|
|
"s2({},{},{},{})," |
|
|
|
"s2({},{},{},{})," |
|
|
|
"min_h2o2:{},max_h2o2:{},max_hum:{},max_sa:{}," |
|
|
|
"dv:{},log:{},tlog:{}," |
|
|
|
"h:{},airB:{},airC:{},pump:{}," |
|
|
|
"g:{},remainS:{}", |
|
|
|
"g:{},remainS:{}" |
|
|
|
"\n", |
|
|
|
getTime(), //
|
|
|
|
cx.h2o2[0], cx.temp[0], cx.humid[0], cx.saturation[0], //
|
|
|
@ -795,19 +794,19 @@ void DisinfectionCtrlService::stopDraining() { |
|
|
|
|
|
|
|
void DisinfectionCtrlService::updateH2O2SensorData(DisinfectionContext& context) { |
|
|
|
auto& cx = context; |
|
|
|
for (size_t i = 0; i < MAX_EXT_H2O2_SENSOR_NUM; i++) { |
|
|
|
for (size_t i = 0; i < MAX_H2O2_SENSOR_NUM; i++) { |
|
|
|
cx.h2o2[i] = m_deviceIoControlService->H2O2Sensor_readH2O2PPM(i); |
|
|
|
} |
|
|
|
|
|
|
|
for (size_t i = 0; i < MAX_EXT_H2O2_SENSOR_NUM; i++) { |
|
|
|
for (size_t i = 0; i < MAX_H2O2_SENSOR_NUM; i++) { |
|
|
|
cx.humid[i] = m_deviceIoControlService->H2O2Sensor_readHumid(i); |
|
|
|
} |
|
|
|
|
|
|
|
for (size_t i = 0; i < MAX_EXT_H2O2_SENSOR_NUM; i++) { |
|
|
|
for (size_t i = 0; i < MAX_H2O2_SENSOR_NUM; i++) { |
|
|
|
cx.temp[i] = m_deviceIoControlService->H2O2Sensor_readTemperature(i); |
|
|
|
} |
|
|
|
|
|
|
|
for (size_t i = 0; i < MAX_EXT_H2O2_SENSOR_NUM; i++) { |
|
|
|
for (size_t i = 0; i < MAX_H2O2_SENSOR_NUM; i++) { |
|
|
|
cx.saturation[i] = m_deviceIoControlService->H2O2Sensor_readSaturation(i); |
|
|
|
} |
|
|
|
|
|
|
@ -816,7 +815,7 @@ void DisinfectionCtrlService::updateH2O2SensorData(DisinfectionContext& context) |
|
|
|
cx.max_humid = cx.humid[0]; |
|
|
|
cx.max_saturation = cx.saturation[0]; |
|
|
|
|
|
|
|
for (size_t i = 0; i < MAX_EXT_H2O2_SENSOR_NUM; i++) { |
|
|
|
for (size_t i = 0; i < MAX_H2O2_SENSOR_NUM; i++) { |
|
|
|
if (cx.h2o2[i] < cx.min_h2o2) { |
|
|
|
cx.min_h2o2 = cx.h2o2[i]; |
|
|
|
} |
|
|
|