|
|
@ -28,17 +28,16 @@ void DisinfectionService::initialize() { |
|
|
|
GET_TO_SERVICE(m_disinfectionLogsManager); |
|
|
|
GET_TO_SERVICE(m_disinfectionPrinterService); |
|
|
|
m_dvalueComputer.initialize(); |
|
|
|
m_deviceIoControlService->sprayLiquidPump_close(); |
|
|
|
|
|
|
|
#if (defined PROJECT_TYPE_LARGE_SPACE_DISINFECTION) || (defined PROJECT_TYPE_SMALL_SPACE_DISINFECTION) || (defined PROJECT_TYPE_PIPE_DISINFECTION)
|
|
|
|
m_deviceIoControlService->replenishingFluidsPump_close(); |
|
|
|
m_deviceIoControlService->sprayLiquidPump_close(); |
|
|
|
|
|
|
|
m_deviceIoControlService->heartingPlate_setPower(false); |
|
|
|
m_deviceIoControlService->airBlower_setState(false); |
|
|
|
m_deviceIoControlService->airCompressor_setState(false); |
|
|
|
#elif (defined PROJECT_TYPE_DRAW_BAR_BOX)
|
|
|
|
m_deviceIoControlService->DBDB__airTightnessTestAirCompressorPowerCtrl(false); |
|
|
|
m_deviceIoControlService->DBDB__sprayLiquidPump_run(0); |
|
|
|
m_deviceIoControlService->DBDB__sprayAirCompressorPowerCtrl(0); |
|
|
|
m_deviceIoControlService->DBDB__heaterCtrl(0); |
|
|
|
m_deviceIoControlService->DBDB__miniPwmBlowerCtrl(0); |
|
|
@ -51,7 +50,7 @@ void DisinfectionService::initialize() { |
|
|
|
sm.regStateProcesser(kstate_finished, bind(&DisinfectionService::processStateFinished, this, placeholders::_1)); |
|
|
|
sm.regStateProcesser(kstate_dehumidification_before_disinfection, bind(&DisinfectionService::processStateDehumidification_before_disinfection, this, placeholders::_1)); |
|
|
|
sm.regStateProcesser(kstate_dehumidification_after_disinfection, bind(&DisinfectionService::processStateDehumidification_after_disinfection, this, placeholders::_1)); |
|
|
|
|
|
|
|
sm.regStateProcesser(kstate_empty_liquid_from_the_line, bind(&DisinfectionService::processStateEmpytLiquidFromTheLine, this, placeholders::_1)); |
|
|
|
sm.regBfStateProcess(bind(&DisinfectionService::beforeStateProcess, this)); |
|
|
|
sm.startProcess(); |
|
|
|
} |
|
|
@ -199,7 +198,7 @@ void DisinfectionService::__dumpDisinfectionLogsToCSV(bool header) { |
|
|
|
if (header) { |
|
|
|
content += fmt::format(" {} ,", ZIconv::noChange("喷液泵(g/min)")); |
|
|
|
} else { |
|
|
|
content += fmt::format(" {} ,", ds->DBDB__sprayLiquidPump_readSpeed()); |
|
|
|
content += fmt::format(" {} ,", ds->sprayLiquidPump_getGPM()); |
|
|
|
} |
|
|
|
#endif
|
|
|
|
|
|
|
@ -236,7 +235,7 @@ void DisinfectionService::logstate() { |
|
|
|
#if (defined PROJECT_TYPE_LARGE_SPACE_DISINFECTION) || (defined PROJECT_TYPE_SMALL_SPACE_DISINFECTION) || (defined PROJECT_TYPE_PIPE_DISINFECTION)
|
|
|
|
logval += fmt::format("h:{},airB:{},airC:{},pump:{},", ds->heatingStrip_getstate(), ds->airBlower_getstate(), ds->airCompressor_getstate(), ds->sprayLiquidPump_getGPM()); |
|
|
|
#elif (defined PROJECT_TYPE_DRAW_BAR_BOX)
|
|
|
|
logval += fmt::format("pump:{},", ds->DBDB__sprayLiquidPump_readSpeed()); |
|
|
|
logval += fmt::format("pump:{},", ds->sprayLiquidPump_getGPM()); |
|
|
|
#endif
|
|
|
|
#if (defined PROJECT_TYPE_LARGE_SPACE_DISINFECTION) || (defined PROJECT_TYPE_SMALL_SPACE_DISINFECTION) || (defined PROJECT_TYPE_PIPE_DISINFECTION)
|
|
|
|
logval += fmt::format("g:{},remainS:{}", m_deviceIoControlService->getDisinfectantVolume_g(), formattimeS(remaintime)); |
|
|
@ -569,27 +568,27 @@ bool DisinfectionService::isTimeToResumeDisinfection() { |
|
|
|
|
|
|
|
void DisinfectionService::pauseDisinfection() { |
|
|
|
logger->info("pauseDisinfection"); |
|
|
|
#if (defined PROJECT_TYPE_LARGE_SPACE_DISINFECTION) || (defined PROJECT_TYPE_SMALL_SPACE_DISINFECTION) || (defined PROJECT_TYPE_PIPE_DISINFECTION)
|
|
|
|
|
|
|
|
m_deviceIoControlService->sprayLiquidPump_close(); |
|
|
|
usleep(1000 * 1000); |
|
|
|
|
|
|
|
#if (defined PROJECT_TYPE_LARGE_SPACE_DISINFECTION) || (defined PROJECT_TYPE_SMALL_SPACE_DISINFECTION) || (defined PROJECT_TYPE_PIPE_DISINFECTION)
|
|
|
|
m_deviceIoControlService->airCompressor_setState(false); |
|
|
|
#elif (defined PROJECT_TYPE_DRAW_BAR_BOX)
|
|
|
|
m_deviceIoControlService->DBDB__miniPwmBlowerCtrl(0); |
|
|
|
m_deviceIoControlService->DBDB__sprayLiquidPump_run(0); |
|
|
|
#endif
|
|
|
|
|
|
|
|
context.is_disinfection_take_break = true; |
|
|
|
} |
|
|
|
void DisinfectionService::resumeDisinfection() { |
|
|
|
logger->info("resumeDisinfection"); |
|
|
|
|
|
|
|
#if (defined PROJECT_TYPE_LARGE_SPACE_DISINFECTION) || (defined PROJECT_TYPE_SMALL_SPACE_DISINFECTION) || (defined PROJECT_TYPE_PIPE_DISINFECTION)
|
|
|
|
m_deviceIoControlService->sprayLiquidPump_open(cfg.injection_pump_speed); |
|
|
|
usleep(1000 * 1000); |
|
|
|
|
|
|
|
#if (defined PROJECT_TYPE_LARGE_SPACE_DISINFECTION) || (defined PROJECT_TYPE_SMALL_SPACE_DISINFECTION) || (defined PROJECT_TYPE_PIPE_DISINFECTION)
|
|
|
|
m_deviceIoControlService->airCompressor_setState(true); |
|
|
|
#elif (defined PROJECT_TYPE_DRAW_BAR_BOX)
|
|
|
|
m_deviceIoControlService->DBDB__miniPwmBlowerCtrl(0); |
|
|
|
m_deviceIoControlService->DBDB__sprayLiquidPump_run(cfg.injection_pump_speed); |
|
|
|
#endif
|
|
|
|
context.is_disinfection_take_break = false; |
|
|
|
} |
|
|
@ -732,7 +731,8 @@ void DisinfectionService::processStatePreheat(disinfection_event_t* event) { |
|
|
|
} |
|
|
|
|
|
|
|
void DisinfectionService::processStateDisinfection(disinfection_event_t* event) { |
|
|
|
disinfection_state_t next_state = kstate_dehumidification_after_disinfection; |
|
|
|
// disinfection_state_t next_state = kstate_dehumidification_after_disinfection;
|
|
|
|
disinfection_state_t next_state = kstate_empty_liquid_from_the_line; |
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief 状态逻辑 |
|
|
@ -866,6 +866,46 @@ void DisinfectionService::processStateDisinfection(disinfection_event_t* event) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void DisinfectionService::processStateEmpytLiquidFromTheLine(disinfection_event_t* event) { //
|
|
|
|
disinfection_state_t next_state = kstate_dehumidification_after_disinfection; |
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief 状态逻辑 |
|
|
|
* 1. 记录日志 |
|
|
|
* 2. 检查是否消毒完成 |
|
|
|
*/ |
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
* 进入状态 * |
|
|
|
*******************************************************************************/ |
|
|
|
if (event->event == kdisinfection_event_enter_state) { |
|
|
|
tryLogSatate(true); |
|
|
|
m_deviceIoControlService->sprayLiquidPump_open(-SPRAYLIQUID_PUMP_MAX_GPM); |
|
|
|
} |
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
* 离开状态 * |
|
|
|
*******************************************************************************/ |
|
|
|
else if (event->event == kdisinfection_event_exit_state) { |
|
|
|
m_deviceIoControlService->sprayLiquidPump_close(); |
|
|
|
} |
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
* 周期 * |
|
|
|
*******************************************************************************/ |
|
|
|
else if (event->event == kdisinfection_event_tmr_1s) { |
|
|
|
if (sm.getStateHasPassedTimeMs() > EMTPTY_LINE_WHEN_DISINFECTION * 1000) { |
|
|
|
sm.changeState(next_state); |
|
|
|
} |
|
|
|
} |
|
|
|
/*******************************************************************************
|
|
|
|
* 结束消毒 * |
|
|
|
*******************************************************************************/ |
|
|
|
else if (event->event == kdisinfection_event_stop) { |
|
|
|
sm.changeState(kstate_finished); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void DisinfectionService::processStateDehumidification_after_disinfection(disinfection_event_t* event) { |
|
|
|
disinfection_state_t next_state = kstate_degradation; |
|
|
|
|
|
|
|