From b5c5f3a43c6d9ea24ec54d85b642338875480e41 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Tue, 8 Jul 2025 18:43:30 +0800 Subject: [PATCH] =?UTF-8?q?v3.1.6|=20=E4=BF=AE=E6=94=B9=E9=A2=84=E7=83=AD?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E5=8D=95=E4=BD=8D=E4=B8=BAmin=20=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E4=BF=AE=E6=94=B9=E9=A3=8E=E6=9C=BA=E9=80=9F=E5=BA=A6?= =?UTF-8?q?=E7=AD=89=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- appsrc/appbase/appbean/device_ext_setting_id.hpp | 4 ++-- appsrc/appbase/appbean/setting_id.hpp | 2 +- appsrc/appconfig/basic/zappversion.hpp | 2 +- .../baseservice/db/device_ext_setting_dao_v2.cpp | 21 ++++++++++++++++++ .../baseservice/db/device_ext_setting_dao_v2.hpp | 2 ++ appsrc/baseservice/db/setting_db_dao.cpp | 8 +++---- .../disinfection_ctrl_service.cpp | 25 +++++++++------------- .../setting/device_ext_setting_mgr_service.cpp | 4 ++++ .../setting/device_ext_setting_mgr_service.hpp | 1 + 9 files changed, 46 insertions(+), 23 deletions(-) diff --git a/appsrc/appbase/appbean/device_ext_setting_id.hpp b/appsrc/appbase/appbean/device_ext_setting_id.hpp index 19a14e8..1e4bc38 100644 --- a/appsrc/appbase/appbean/device_ext_setting_id.hpp +++ b/appsrc/appbase/appbean/device_ext_setting_id.hpp @@ -24,7 +24,7 @@ marco(type, userBehaviorRecordDbMaxRecords) /*用户行为最大记录数*/ \ marco(type, gpmToSpeedRadio) /*喷液泵转速单位转换系数*/ \ marco(type, sprayLineEmptyTimeS) /*清空喷液管路时间*/ \ - marco(type, sprayLineEmptyVelRPM) /*清空管路速度*/ + marco(type, sprayLineEmptyVelRPM) /*清空管路速度*/ \ + marco(type, blowserDefaultVelLevel) /*风机速度等级*/ ZENUM_DECLAR(DeviceExtSettingId, DeviceExtSettingId_LIST); - diff --git a/appsrc/appbase/appbean/setting_id.hpp b/appsrc/appbase/appbean/setting_id.hpp index 87e4648..5fb21dd 100644 --- a/appsrc/appbase/appbean/setting_id.hpp +++ b/appsrc/appbase/appbean/setting_id.hpp @@ -12,7 +12,7 @@ marco(type, max_humidity) /**/ \ marco(type, drainage_pump_speed) /**/ \ marco(type, injection_pump_speed) /**/ \ - marco(type, pre_heat_time_s) /**/ \ + marco(type, pre_heat_time_min) /**/ \ marco(type, record_period_min) /**/ \ marco(type, record_printer_period_min) /**/ \ marco(type, loglevel) /*消毒等级*/ \ diff --git a/appsrc/appconfig/basic/zappversion.hpp b/appsrc/appconfig/basic/zappversion.hpp index a3e6aea..bcbd4ca 100644 --- a/appsrc/appconfig/basic/zappversion.hpp +++ b/appsrc/appconfig/basic/zappversion.hpp @@ -1,3 +1,3 @@ #pragma once -#define VERSION "3.1.5" +#define VERSION "3.1.6" #define PROJECT_NAME "TRANSMIT_DM" \ No newline at end of file diff --git a/appsrc/baseservice/db/device_ext_setting_dao_v2.cpp b/appsrc/baseservice/db/device_ext_setting_dao_v2.cpp index c526651..026b5a6 100644 --- a/appsrc/baseservice/db/device_ext_setting_dao_v2.cpp +++ b/appsrc/baseservice/db/device_ext_setting_dao_v2.cpp @@ -263,6 +263,24 @@ int DeviceExtSettingV2Dao::getSprayLineEmptyVelRPM() { return get(DeviceExtSettingId::sprayLineEmptyVelRPM.toString(), defaultVal); } +int DeviceExtSettingV2Dao::getBlowerDefaultVelLevel() { + ProjectTypeEnum projType = getProjectType(); + int defaultVal = 0; + if (ProjectTypeEnum::DT600N.eq(projType.id)) { + defaultVal = 90; + } else if (ProjectTypeEnum::DT300N.eq(projType.id)) { + defaultVal = 90; + } else if (ProjectTypeEnum::DT300W.eq(projType.id)) { + defaultVal = 90; + } else if (ProjectTypeEnum::DT600B.eq(projType.id)) { + defaultVal = 90; + } else if (ProjectTypeEnum::DT100N.eq(projType.id)) { + defaultVal = 90; + } + return get(DeviceExtSettingId::blowserDefaultVelLevel.toString(), defaultVal); +} +void DeviceExtSettingV2Dao::setBlowerDefaultVelLevel(int val) { set(DeviceExtSettingId::blowserDefaultVelLevel.toString(), val); } + void DeviceExtSettingV2Dao::initVal(ProjectTypeEnum projType, int year, int month, int day, int index) { // initVal(projType, fmt::format("{}{:0>2d}{:0>2d}{:0>2d}{:0>3d}", projType.toString(), year, month, day, index)); } @@ -296,6 +314,7 @@ void DeviceExtSettingV2Dao::initVal(ProjectTypeEnum projType, string deviceId) { setVal(DeviceExtSettingId::gpmToSpeedRadio, getGpmToSpeedRadio()); setVal(DeviceExtSettingId::sprayLineEmptyTimeS, getSprayLineEmptyTimeS()); setVal(DeviceExtSettingId::sprayLineEmptyVelRPM, getSprayLineEmptyVelRPM()); + setVal(DeviceExtSettingId::blowserDefaultVelLevel, getBlowerDefaultVelLevel()); } json DeviceExtSettingV2Dao::getSetting() { @@ -321,6 +340,7 @@ json DeviceExtSettingV2Dao::getSetting() { setting["gpmToSpeedRadio"] = getGpmToSpeedRadio(); setting["sprayLineEmptyTimeS"] = getSprayLineEmptyTimeS(); setting["sprayLineEmptyVelRPM"] = getSprayLineEmptyVelRPM(); + setting["blowerDefaultVelLevel"] = getBlowerDefaultVelLevel(); return setting; } @@ -347,5 +367,6 @@ json DeviceExtSettingV2Dao::getSettingCH() { settingCH["喷液泵转速单位转换系数"] = getGpmToSpeedRadio(); settingCH["喷液管路清空时间(秒)"] = getSprayLineEmptyTimeS(); settingCH["喷液管路清空速度(RPM)"] = getSprayLineEmptyVelRPM(); + settingCH["风机速度等级"] = getBlowerDefaultVelLevel(); return settingCH; } \ No newline at end of file diff --git a/appsrc/baseservice/db/device_ext_setting_dao_v2.hpp b/appsrc/baseservice/db/device_ext_setting_dao_v2.hpp index 4d8865b..8fe550a 100644 --- a/appsrc/baseservice/db/device_ext_setting_dao_v2.hpp +++ b/appsrc/baseservice/db/device_ext_setting_dao_v2.hpp @@ -98,6 +98,8 @@ class DeviceExtSettingV2Dao : public KeyValDBV2Dao { void setSprayLineEmptyTimeS(int val); void setSprayLineEmptyVelRPM(int val); int getSprayLineEmptyVelRPM(); + int getBlowerDefaultVelLevel(); + void setBlowerDefaultVelLevel(int val); }; }; // namespace iflytop diff --git a/appsrc/baseservice/db/setting_db_dao.cpp b/appsrc/baseservice/db/setting_db_dao.cpp index 6c960d9..03858c6 100644 --- a/appsrc/baseservice/db/setting_db_dao.cpp +++ b/appsrc/baseservice/db/setting_db_dao.cpp @@ -64,7 +64,7 @@ static Setting settingInitTable[] = { {.setting_id = SettingId::max_humidity}, {.setting_id = SettingId::drainage_pump_speed}, {.setting_id = SettingId::injection_pump_speed}, - {.setting_id = SettingId::pre_heat_time_s}, + {.setting_id = SettingId::pre_heat_time_min}, {.setting_id = SettingId::loglevel}, {.setting_id = SettingId::record_period_min}, {.setting_id = SettingId::record_printer_period_min}, @@ -123,9 +123,9 @@ void SettingDBDao::initSettingDefaultValTable() { setting.setVisibleRangeConfig(true, true, true, true); break; } - case SettingId::kpre_heat_time_s: { - setting.name_ch = "预热时间"; - setting.setValConfig("int", "120", "0", "1200"); + case SettingId::kpre_heat_time_min: { + setting.name_ch = "预热时间(分钟)"; + setting.setValConfig("int", "2", "0", "120"); setting.setVisibleRangeConfig(true, true, true, true); break; } diff --git a/appsrc/service/app/disinfection_ctrl/disinfection_ctrl_service.cpp b/appsrc/service/app/disinfection_ctrl/disinfection_ctrl_service.cpp index bd558e8..369ba78 100644 --- a/appsrc/service/app/disinfection_ctrl/disinfection_ctrl_service.cpp +++ b/appsrc/service/app/disinfection_ctrl/disinfection_ctrl_service.cpp @@ -8,7 +8,6 @@ using namespace iflytop; using namespace disinfection; -#define DEFAULT_BLOWSER_LEVEL 90 #define DVALUE_COMPUTEPERIOD_TIME_S (10.0) #define SETTING_DB SettingDBDao::ins() @@ -444,7 +443,7 @@ void DisinfectionCtrlService::processStateDehumidificationBeforeDisinfection(Dis tryLogState(true); ZASSERT(PORT.isDT100N()); - dics->Blower_ctrl(DEFAULT_BLOWSER_LEVEL); + dics->Blower_ctrl(DeviceExtSettingV2Dao::ins()->getBlowerDefaultVelLevel()); usleep(100 * 1000); dics->ExtChSelector_trySelectCh(kext_ch_dehumidification); s_remaintime = -1; @@ -476,18 +475,18 @@ void DisinfectionCtrlService::processStatePreheat(DisinfectionEvent* event) { if (event->event == kevent_enter_state) { tryLogState(true); - // dics->Blower_ctrl(90); - // usleep(1000 * 1000) + dics->Blower_ctrl(DeviceExtSettingV2Dao::ins()->getBlowerDefaultVelLevel()); + usleep(1000 * 1000); dics->Heater_ctrl(100); - s_remaintime = getSettingAsInt(SettingId::pre_heat_time_s); + s_remaintime = getSettingAsInt(SettingId::pre_heat_time_min) * 60; } else if (event->event == kevent_exit_state) { - // dics->Blower_ctrl(0); - // usleep(1000 * 1000); + dics->Blower_ctrl(0); + usleep(1000 * 1000); dics->Heater_ctrl(0); tryLogState(true); } else if (event->event == kevent_tmr_1s) { - int preHeatTimeS = getSettingAsInt(SettingId::pre_heat_time_s); + int preHeatTimeS = getSettingAsInt(SettingId::pre_heat_time_min) * 60; s_remaintime--; if (s_remaintime <= 0) { s_remaintime = 0; @@ -510,14 +509,10 @@ void DisinfectionCtrlService::processStateDisinfection(DisinfectionEvent* event) } dics->ExtChSelector_trySelectCh(kext_ch_disinfection); dics->AC_ctrl(1); - dics->Blower_ctrl(DEFAULT_BLOWSER_LEVEL); + dics->Blower_ctrl(DeviceExtSettingV2Dao::ins()->getBlowerDefaultVelLevel()); dics->Heater_ctrl(1); injectPumpSet(getSettingAsInt(SettingId::injection_pump_speed)); - - - - s_remaintime = m_tlog * 60 * 60 * 2; } else if (event->event == kevent_exit_state) { s_isDisinfectionTakeBreak = false; @@ -659,7 +654,7 @@ void DisinfectionCtrlService::processStateEmpytLiquidFromTheLine(DisinfectionEve void DisinfectionCtrlService::processStateDehumidificationAfterDisinfection(DisinfectionEvent* event) { if (event->event == kevent_enter_state) { tryLogState(true); - dics->Blower_ctrl(DEFAULT_BLOWSER_LEVEL); + dics->Blower_ctrl(DeviceExtSettingV2Dao::ins()->getBlowerDefaultVelLevel()); dics->ExtChSelector_trySelectCh(kext_ch_dehumidification); s_remaintime = -1; } else if (event->event == kevent_exit_state) { @@ -691,7 +686,7 @@ void DisinfectionCtrlService::processStateDegradation(DisinfectionEvent* event) if (event->event == kevent_enter_state) { tryLogState(true); dics->ExtChSelector_trySelectCh(kext_ch_degradation); - dics->Blower_ctrl(DEFAULT_BLOWSER_LEVEL); + dics->Blower_ctrl(DeviceExtSettingV2Dao::ins()->getBlowerDefaultVelLevel()); s_remaintime = -1; } else if (event->event == kevent_exit_state) { dics->Blower_close(); diff --git a/appsrc/service/setting/device_ext_setting_mgr_service.cpp b/appsrc/service/setting/device_ext_setting_mgr_service.cpp index 53f5d81..640bc4b 100644 --- a/appsrc/service/setting/device_ext_setting_mgr_service.cpp +++ b/appsrc/service/setting/device_ext_setting_mgr_service.cpp @@ -49,6 +49,7 @@ void DeviceExtSettingMgrService::setUserBehaviorRecordDbMaxRecords(shared_ptr cxt, float val) { DeviceExtSettingV2Dao::ins()->setGpmToSpeedRadio(val); } void DeviceExtSettingMgrService::setSprayLineEmptyTimeS(shared_ptr cxt, int val) { DeviceExtSettingV2Dao::ins()->setSprayLineEmptyTimeS(val); } void DeviceExtSettingMgrService::setSprayLineEmptyVelRPM(shared_ptr cxt, int val) { DeviceExtSettingV2Dao::ins()->setSprayLineEmptyVelRPM(val); } +void DeviceExtSettingMgrService::setBlowerDefaultVelLevel(shared_ptr cxt, int val) { DeviceExtSettingV2Dao::ins()->setBlowerDefaultVelLevel(val); } void DeviceExtSettingMgrService::rebootDevice(shared_ptr cxt) { system("reboot"); } @@ -123,6 +124,9 @@ void DeviceExtSettingMgrService::initialize() { REG_EXTFN(setSprayLineEmptyVelRPM, void(int), val); REG_EXTFN_DISPNAME(setSprayLineEmptyVelRPM, "设置喷液管道排空速度(RPM)", "val"); + REG_EXTFN(setBlowerDefaultVelLevel, void(int), val); + REG_EXTFN_DISPNAME(setBlowerDefaultVelLevel, "设置吹风机默认速度等级", "val"); + REG_EXTFN_VOID(rebootDevice, void(void)); REG_EXTFN_VOID_DISPNAME(rebootDevice, "重启设备"); diff --git a/appsrc/service/setting/device_ext_setting_mgr_service.hpp b/appsrc/service/setting/device_ext_setting_mgr_service.hpp index 1badb9b..6445cd0 100644 --- a/appsrc/service/setting/device_ext_setting_mgr_service.hpp +++ b/appsrc/service/setting/device_ext_setting_mgr_service.hpp @@ -43,6 +43,7 @@ class DeviceExtSettingMgrService : public enable_shared_from_this cxt, float val); void setSprayLineEmptyTimeS(shared_ptr cxt, int val); void setSprayLineEmptyVelRPM(shared_ptr cxt, int val); + void setBlowerDefaultVelLevel(shared_ptr cxt, int val); void rebootDevice(shared_ptr cxt); void restartProgram(shared_ptr cxt);