Browse Source

update

master
zhaohe 1 year ago
parent
commit
4a7ed462f7
  1. 36
      protocol.md
  2. 9
      src/service/disfection_ctl/disinfection_service.cpp
  3. 8
      src/service/disinfection_printer_service.cpp

36
protocol.md

@ -110,4 +110,40 @@ ws://192.168.8.10:19001
"command": "DBDBTestPage__extValBoardIsOnline" "command": "DBDBTestPage__extValBoardIsOnline"
} }
{ "ack": { "isOnline": false }, "ackcode": 0, "messageId": null, "timeStamp": 1715942221499 } { "ack": { "isOnline": false }, "ackcode": 0, "messageId": null, "timeStamp": 1715942221499 }
```
```
{
"command": "selftest_setH2O2Val",
"params": {
"random": false,
"sensors": [
{
"sensorid": 0,
"h2o2": 0,
"humid": 50,
"temp": 50,
"sat": 50,
"state": 1
},
{
"sensorid": 1,
"h2o2": 0,
"humid": 51,
"temp": 51,
"sat": 51,
"state": 1
},
{
"sensorid": 2,
"h2o2": 0,
"humid": 52,
"temp": 52,
"sat": -1,
"state": 1
}
]
}
}
``` ```

9
src/service/disfection_ctl/disinfection_service.cpp

@ -38,6 +38,11 @@ void DisinfectionService::initialize() {
m_deviceIoControlService->airBlower_setState(false); m_deviceIoControlService->airBlower_setState(false);
m_deviceIoControlService->airCompressor_setState(false); m_deviceIoControlService->airCompressor_setState(false);
#elif (defined PROJECT_TYPE_DRAW_BAR_BOX) #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);
#endif #endif
sm.regStateProcesser(kstate_idle, bind(&DisinfectionService::processStateIdle, this, placeholders::_1)); sm.regStateProcesser(kstate_idle, bind(&DisinfectionService::processStateIdle, this, placeholders::_1));
@ -570,6 +575,8 @@ void DisinfectionService::pauseDisinfection() {
usleep(1000 * 1000); usleep(1000 * 1000);
m_deviceIoControlService->airCompressor_setState(false); m_deviceIoControlService->airCompressor_setState(false);
#elif (defined PROJECT_TYPE_DRAW_BAR_BOX) #elif (defined PROJECT_TYPE_DRAW_BAR_BOX)
m_deviceIoControlService->DBDB__miniPwmBlowerCtrl(0);
m_deviceIoControlService->DBDB__sprayLiquidPump_run(0);
#endif #endif
context.is_disinfection_take_break = true; context.is_disinfection_take_break = true;
@ -582,6 +589,8 @@ void DisinfectionService::resumeDisinfection() {
usleep(1000 * 1000); usleep(1000 * 1000);
m_deviceIoControlService->airCompressor_setState(true); m_deviceIoControlService->airCompressor_setState(true);
#elif (defined PROJECT_TYPE_DRAW_BAR_BOX) #elif (defined PROJECT_TYPE_DRAW_BAR_BOX)
m_deviceIoControlService->DBDB__miniPwmBlowerCtrl(0);
m_deviceIoControlService->DBDB__sprayLiquidPump_run(cfg.injection_pump_speed);
#endif #endif
context.is_disinfection_take_break = false; context.is_disinfection_take_break = false;
} }

8
src/service/disinfection_printer_service.cpp

@ -78,13 +78,17 @@ void DisinfectionPrinterService::printTask(shared_ptr<DisinfectionPrinterTask> t
dio->printerPrintf(fmt::format("降解中...\n")); dio->printerPrintf(fmt::format("降解中...\n"));
} else if (now_state == kstate_finished) { } else if (now_state == kstate_finished) {
dio->printerPrintf(fmt::format("结束...\n")); dio->printerPrintf(fmt::format("结束...\n"));
} else if (now_state == kstate_dehumidification_before_disinfection) {
dio->printerPrintf(fmt::format("消毒前除湿中...\n"));
} else if (now_state == kstate_dehumidification_after_disinfection) {
dio->printerPrintf(fmt::format("消毒后除湿中...\n"));
} }
dio->printerPrintf(fmt::format("{}ppm {}%RS {}%RH {}Log\n", ss->min_h2o2, ss->max_saturation, ss->max_humid, (int)ss->dloglevel));
dio->printerPrintf(fmt::format("{}ppm {}%RS {}%RH {}LOG\n", ss->min_h2o2, ss->max_saturation, ss->max_humid, (int)ss->dloglevel));
state = now_state; state = now_state;
} else { } else {
if (now_state == kstate_disinfection) { if (now_state == kstate_disinfection) {
dio->printerPrintf(fmt::format("{}\n", format_zsystem_tp(ss->time))); dio->printerPrintf(fmt::format("{}\n", format_zsystem_tp(ss->time)));
dio->printerPrintf(fmt::format("{}ppm {}%RS {}%RH {}Log\n", ss->min_h2o2, ss->max_saturation, ss->max_humid, (int)ss->dloglevel));
dio->printerPrintf(fmt::format("{}ppm {}%RS {}%RH {}LOG\n", ss->min_h2o2, ss->max_saturation, ss->max_humid, (int)ss->dloglevel));
this_thread::sleep_for(chrono::milliseconds(200)); this_thread::sleep_for(chrono::milliseconds(200));
} }
} }

Loading…
Cancel
Save