|
|
@ -44,7 +44,7 @@ void DisinfectionCtrlService::initialize() { |
|
|
|
m_deviceIoControlService->sprayLiquidPump_close(); |
|
|
|
|
|
|
|
m_deviceIoControlService->heartingPlate_setPower(false); |
|
|
|
m_deviceIoControlService->AirBlower_setState(false); |
|
|
|
m_deviceIoControlService->airBlower_setState(false); |
|
|
|
m_deviceIoControlService->airCompressor_setState(false); |
|
|
|
} |
|
|
|
|
|
|
@ -138,8 +138,27 @@ void DisinfectionCtrlService::initContext(DisinfectionContext& context, int logl |
|
|
|
m_zcanHost->warning_light_ctrl_c1002(1, 0, 0, 1, 0); |
|
|
|
m_deviceIoControlService->heartingPlate_setPower(true); |
|
|
|
context.csvlogger = m_disinfectionLogsManager->createNewLogger(context.m_disinfectionID); |
|
|
|
|
|
|
|
// zsteady_clock().elapsedTimeS(m_context.m_starttp), //
|
|
|
|
// sensors[0].h2o2, sensors[0].temp, sensors[0].humid, sensors[0].saturation, //
|
|
|
|
// sensors[1].h2o2, sensors[1].temp, sensors[1].humid, sensors[1].saturation, //
|
|
|
|
// sensors[2].h2o2, sensors[2].temp, sensors[2].humid, sensors[2].saturation, //
|
|
|
|
// m_context.dvalue, m_context.m_nowLoglevel, (int)m_context.m_targetLoglevel, //
|
|
|
|
// ds->heatingStrip_getstate(), ds->airBlower_getstate(), ds->airCompressor_getstate(), ds->sprayLiquidPump_getRPM(), //
|
|
|
|
// ds->getPressureSensorData(1), ds->getPressureSensorData(2), ds->getPressureSensorData(3), ds->getPressureSensorData(4), //
|
|
|
|
// m_deviceIoControlService->getDisinfectantVolume_g(), //
|
|
|
|
// m_context.m_remaintime
|
|
|
|
context.csvlogger->write( |
|
|
|
"time,h2o21,temp1,humi1,saturation1,h2o22,temp2,humi2,saturation2,h2o23,temp3,humi3,saturation3,dvalue,nowlog,targetlog,remaintime\n"); |
|
|
|
"time," //
|
|
|
|
"h2o21,temp1,humi1,saturation1," //
|
|
|
|
"h2o22,temp2,humi2,saturation2," //
|
|
|
|
"h2o23,temp3,humi3,saturation3," //
|
|
|
|
"dvalue,loglevel,targetloglevel," //
|
|
|
|
"heating,blower,compressor,pump," //
|
|
|
|
"pressure1,pressure2,pressure3,pressure4," //
|
|
|
|
"disinfectantVolume," //
|
|
|
|
"remaintime" //
|
|
|
|
); |
|
|
|
} |
|
|
|
void DisinfectionCtrlService::finishDisinfection(DisinfectionContext& context) { |
|
|
|
context.m_remaintime = 0; |
|
|
@ -152,7 +171,7 @@ void DisinfectionCtrlService::finishDisinfection(DisinfectionContext& context) { |
|
|
|
m_deviceIoControlService->airCompressor_setState(false); |
|
|
|
usleep(1000 * 1000); |
|
|
|
// blower_setPower(false);
|
|
|
|
m_deviceIoControlService->AirBlower_setState(false); |
|
|
|
m_deviceIoControlService->airBlower_setState(false); |
|
|
|
usleep(1000 * 1000); |
|
|
|
// heartingPlate_setPower(false);
|
|
|
|
m_deviceIoControlService->heartingPlate_setPower(false); |
|
|
@ -165,7 +184,7 @@ void DisinfectionCtrlService::processPreheatState(DisinfectionContext& context) |
|
|
|
if ((context.m_preheatFlag && zsteady_clock().elapsedTimeS(context.m_starttp) > PRE_HEAT_TIME) || !g_preheat) { |
|
|
|
logger->info("preheat finished {}", context.m_disinfectionID); |
|
|
|
// blower_setPower(true);
|
|
|
|
m_deviceIoControlService->AirBlower_setState(true); |
|
|
|
m_deviceIoControlService->airBlower_setState(true); |
|
|
|
usleep(1000 * 1000); |
|
|
|
// airCompressor(true);
|
|
|
|
m_deviceIoControlService->airCompressor_setState(true); |
|
|
@ -178,6 +197,7 @@ void DisinfectionCtrlService::processPreheatState(DisinfectionContext& context) |
|
|
|
} |
|
|
|
|
|
|
|
void DisinfectionCtrlService::dumpDisinfectionLogsToCSV(DisinfectionContext& context) { |
|
|
|
#if 0
|
|
|
|
context.csvlogger->write(fmt::format("{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{}\n", |
|
|
|
zsteady_clock().elapsedTimeS(m_context.m_starttp), //
|
|
|
|
m_context.h2o2data.h2o2sensor_data[0].h2o2, //
|
|
|
@ -197,10 +217,35 @@ void DisinfectionCtrlService::dumpDisinfectionLogsToCSV(DisinfectionContext& con |
|
|
|
m_context.m_targetLoglevel, //
|
|
|
|
m_context.m_remaintime //
|
|
|
|
)); |
|
|
|
#endif
|
|
|
|
auto* sensors = &m_context.h2o2data.h2o2sensor_data[0]; |
|
|
|
auto ds = m_deviceIoControlService; |
|
|
|
context.csvlogger->write( |
|
|
|
fmt::format("{}," //
|
|
|
|
"{},{},{},{}," //
|
|
|
|
"{},{},{},{}," //
|
|
|
|
"{},{},{},{}," //
|
|
|
|
"{},{},{}," //
|
|
|
|
"{},{},{},{}," //
|
|
|
|
"{},{},{},{}," //
|
|
|
|
"{}," //
|
|
|
|
"{}" //
|
|
|
|
, |
|
|
|
zsteady_clock().elapsedTimeS(m_context.m_starttp), //
|
|
|
|
sensors[0].h2o2, sensors[0].temp, sensors[0].humid, sensors[0].saturation, //
|
|
|
|
sensors[1].h2o2, sensors[1].temp, sensors[1].humid, sensors[1].saturation, //
|
|
|
|
sensors[2].h2o2, sensors[2].temp, sensors[2].humid, sensors[2].saturation, //
|
|
|
|
m_context.dvalue, m_context.m_nowLoglevel, (int)m_context.m_targetLoglevel, //
|
|
|
|
ds->heatingStrip_getstate(), ds->airBlower_getstate(), ds->airCompressor_getstate(), ds->sprayLiquidPump_getRPM(), //
|
|
|
|
ds->getPressureSensorData(1), ds->getPressureSensorData(2), ds->getPressureSensorData(3), ds->getPressureSensorData(4), //
|
|
|
|
m_deviceIoControlService->getDisinfectantVolume_g(), //
|
|
|
|
m_context.m_remaintime)); |
|
|
|
} |
|
|
|
|
|
|
|
void DisinfectionCtrlService::dumpDisinfectionLogs(DisinfectionContext& context) { |
|
|
|
logger->info("T:{},h2o21:{},t1:{},humi:{},s1:{},h2o22:{},t2:{},humi2:{},s2:{},h2o23:{},t3:{},humi3:{},s3:{},dvalue:{},nowlog:{},targetlog:{},remaintime:{}", |
|
|
|
float h2o2_g = m_deviceIoControlService->getDisinfectantVolume_g(); |
|
|
|
#if 0
|
|
|
|
logger->info("T:{},ho1:{},t1:{},hu1:{},s1:{},ho2:{},t2:{},hu2:{},s2:{},ho3:{},t3:{},hu3:{},s3:{},dv:{},log:{},tlog:{},rt:{}", |
|
|
|
zsteady_clock().elapsedTimeS(m_context.m_starttp), //
|
|
|
|
m_context.h2o2data.h2o2sensor_data[0].h2o2, //
|
|
|
|
m_context.h2o2data.h2o2sensor_data[0].temp, //
|
|
|
@ -219,6 +264,29 @@ void DisinfectionCtrlService::dumpDisinfectionLogs(DisinfectionContext& context) |
|
|
|
m_context.m_targetLoglevel, //
|
|
|
|
m_context.m_remaintime //
|
|
|
|
); |
|
|
|
#endif
|
|
|
|
auto* sensors = &m_context.h2o2data.h2o2sensor_data[0]; |
|
|
|
auto ds = m_deviceIoControlService; |
|
|
|
logger->info( |
|
|
|
"T:{}," //
|
|
|
|
"s1:({},{},{},{})," //
|
|
|
|
"s2:({},{},{},{})," //
|
|
|
|
"s3:({},{},{},{})," //
|
|
|
|
"D:{},log:({}:{})," //
|
|
|
|
"io:({},{},{},{})," //
|
|
|
|
"p:({},{},{},{})," //
|
|
|
|
"h2o2g:{}," //
|
|
|
|
"rt:{}" //
|
|
|
|
, |
|
|
|
zsteady_clock().elapsedTimeS(m_context.m_starttp), //
|
|
|
|
sensors[0].h2o2, sensors[0].temp, sensors[0].humid, sensors[0].saturation, //
|
|
|
|
sensors[1].h2o2, sensors[1].temp, sensors[1].humid, sensors[1].saturation, //
|
|
|
|
sensors[2].h2o2, sensors[2].temp, sensors[2].humid, sensors[2].saturation, //
|
|
|
|
m_context.dvalue, m_context.m_nowLoglevel, (int)m_context.m_targetLoglevel, //
|
|
|
|
ds->heatingStrip_getstate(), ds->airBlower_getstate(), ds->airCompressor_getstate(), ds->sprayLiquidPump_getRPM(), //
|
|
|
|
ds->getPressureSensorData(1), ds->getPressureSensorData(2), ds->getPressureSensorData(3), ds->getPressureSensorData(4), //
|
|
|
|
m_deviceIoControlService->getDisinfectantVolume_g(), //
|
|
|
|
m_context.m_remaintime); |
|
|
|
} |
|
|
|
|
|
|
|
void DisinfectionCtrlService::processDisinfectionState(DisinfectionContext& context) { |
|
|
|