From 7f1e91f6a1c2b745a86da73b3e795465ddf4c995 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Thu, 23 May 2024 16:38:53 +0800 Subject: [PATCH] update --- src/api/cmds/disinfection_cmd_impl.cpp | 3 +-- src/configs/project_setting.hpp | 1 + src/service/device_alert_dectector_service.cpp | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/api/cmds/disinfection_cmd_impl.cpp b/src/api/cmds/disinfection_cmd_impl.cpp index 525c7bd..cec279b 100644 --- a/src/api/cmds/disinfection_cmd_impl.cpp +++ b/src/api/cmds/disinfection_cmd_impl.cpp @@ -79,7 +79,6 @@ void DisinfectionCmdImpl::getDehumidifyAfterDisinfectionThreshold(json& cmd, jso void DisinfectionCmdImpl::startDisinfection(json& cmd, json& receipt) { auto dfs = m_disinfectionCtrlService->getDisinfectionService(); - int disinfectantVolumeG = m_deviceIoControlService->getDisinfectantVolume_g(); #if (defined PROJECT_TYPE_LARGE_SPACE_DISINFECTION) || (defined PROJECT_TYPE_SMALL_SPACE_DISINFECTION) || (defined PROJECT_TYPE_PIPE_DISINFECTION) if (m_deviceIoControlService->getDeviceBottomWaterDetectionSensor()) { @@ -96,7 +95,7 @@ void DisinfectionCmdImpl::startDisinfection(json& cmd, json& receipt) { receipt["ackDisplayInfo"] = "蒸发仓有积水,请排水后再进行消毒"; return; } - + int disinfectantVolumeG = m_deviceIoControlService->getDisinfectantVolume_g(); if (disinfectantVolumeG < MIN_DISINFECTANT_VOLUME) { logger->error("start disinfection failed, disinfectant volume not enough {} < {}", disinfectantVolumeG, MIN_DISINFECTANT_VOLUME); receipt["ackcode"] = err::zecode(err::kce_disinfectant_insufficient); diff --git a/src/configs/project_setting.hpp b/src/configs/project_setting.hpp index fc8825d..ee28ead 100644 --- a/src/configs/project_setting.hpp +++ b/src/configs/project_setting.hpp @@ -48,6 +48,7 @@ #define DISINFECTANT_BUCKET_CAPACITY 0 #define PROJECT_NAME "draw_bar_box_disinfection" #define MAX_H2O2_SENSOR_NUM (1) +#define MIN_DISINFECTANT_VOLUME 0 #define DEVICE_IP "192.168.8.13" #endif diff --git a/src/service/device_alert_dectector_service.cpp b/src/service/device_alert_dectector_service.cpp index 19a2014..df96ec4 100644 --- a/src/service/device_alert_dectector_service.cpp +++ b/src/service/device_alert_dectector_service.cpp @@ -27,6 +27,7 @@ shared_ptr DeviceAlertDetectorService::getAlertWarningConte } void DeviceAlertDetectorService::detectAndProcessDeviceBottomWaterDetectAlert() { +#if (defined PROJECT_TYPE_LARGE_SPACE_DISINFECTION) || (defined PROJECT_TYPE_SMALL_SPACE_DISINFECTION) || (defined PROJECT_TYPE_PIPE_DISINFECTION) auto context = getAlertWarningContext(kDeviceBottomWaterDetectAlert); if (!context->getTriggerFlag()) { if (m_deviceIoControlService->getDeviceBottomWaterDetectionSensor()) { @@ -50,8 +51,11 @@ void DeviceAlertDetectorService::detectAndProcessDeviceBottomWaterDetectAlert() context->setTriggerFlag(false); } } +#endif } void DeviceAlertDetectorService::detectAndProcessDeviceEvaporationBinWaterDetectAlert() { +#if (defined PROJECT_TYPE_LARGE_SPACE_DISINFECTION) || (defined PROJECT_TYPE_SMALL_SPACE_DISINFECTION) || (defined PROJECT_TYPE_PIPE_DISINFECTION) + auto context = getAlertWarningContext(kDeviceEvaporationBinWaterDetectAlert); if (!context->getTriggerFlag()) { if (m_deviceIoControlService->getEvaporationBinWaterDetection()) { @@ -74,6 +78,7 @@ void DeviceAlertDetectorService::detectAndProcessDeviceEvaporationBinWaterDetect context->setTriggerFlag(false); } } +#endif } void DeviceAlertDetectorService::tryTriggerEvent() {