Browse Source

v3.1.6| 修改预热时间单位为min 支持修改风机速度等级

try_support_dt100n
zhaohe 4 weeks ago
parent
commit
b5c5f3a43c
  1. 4
      appsrc/appbase/appbean/device_ext_setting_id.hpp
  2. 2
      appsrc/appbase/appbean/setting_id.hpp
  3. 2
      appsrc/appconfig/basic/zappversion.hpp
  4. 21
      appsrc/baseservice/db/device_ext_setting_dao_v2.cpp
  5. 2
      appsrc/baseservice/db/device_ext_setting_dao_v2.hpp
  6. 8
      appsrc/baseservice/db/setting_db_dao.cpp
  7. 25
      appsrc/service/app/disinfection_ctrl/disinfection_ctrl_service.cpp
  8. 4
      appsrc/service/setting/device_ext_setting_mgr_service.cpp
  9. 1
      appsrc/service/setting/device_ext_setting_mgr_service.hpp

4
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);

2
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) /*消毒等级*/ \

2
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"

21
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;
}

2
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

8
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;
}

25
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();

4
appsrc/service/setting/device_ext_setting_mgr_service.cpp

@ -49,6 +49,7 @@ void DeviceExtSettingMgrService::setUserBehaviorRecordDbMaxRecords(shared_ptr<Ms
void DeviceExtSettingMgrService::setGpmToSpeedRadio(shared_ptr<MsgProcessContext> cxt, float val) { DeviceExtSettingV2Dao::ins()->setGpmToSpeedRadio(val); }
void DeviceExtSettingMgrService::setSprayLineEmptyTimeS(shared_ptr<MsgProcessContext> cxt, int val) { DeviceExtSettingV2Dao::ins()->setSprayLineEmptyTimeS(val); }
void DeviceExtSettingMgrService::setSprayLineEmptyVelRPM(shared_ptr<MsgProcessContext> cxt, int val) { DeviceExtSettingV2Dao::ins()->setSprayLineEmptyVelRPM(val); }
void DeviceExtSettingMgrService::setBlowerDefaultVelLevel(shared_ptr<MsgProcessContext> cxt, int val) { DeviceExtSettingV2Dao::ins()->setBlowerDefaultVelLevel(val); }
void DeviceExtSettingMgrService::rebootDevice(shared_ptr<MsgProcessContext> 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, "重启设备");

1
appsrc/service/setting/device_ext_setting_mgr_service.hpp

@ -43,6 +43,7 @@ class DeviceExtSettingMgrService : public enable_shared_from_this<DeviceExtSetti
void setGpmToSpeedRadio(shared_ptr<MsgProcessContext> cxt, float val);
void setSprayLineEmptyTimeS(shared_ptr<MsgProcessContext> cxt, int val);
void setSprayLineEmptyVelRPM(shared_ptr<MsgProcessContext> cxt, int val);
void setBlowerDefaultVelLevel(shared_ptr<MsgProcessContext> cxt, int val);
void rebootDevice(shared_ptr<MsgProcessContext> cxt);
void restartProgram(shared_ptr<MsgProcessContext> cxt);

Loading…
Cancel
Save