diff --git a/appsrc/appbase/appbean/setting_id.hpp b/appsrc/appbase/appbean/setting_id.hpp index 1d7693b..87e4648 100644 --- a/appsrc/appbase/appbean/setting_id.hpp +++ b/appsrc/appbase/appbean/setting_id.hpp @@ -7,12 +7,12 @@ marco(type, continued_gs) /**/ \ marco(type, stoped_satur) /**/ \ marco(type, continued_satur) /**/ \ + marco(type, stoped_humi) /**/ \ + marco(type, continued_humi) /**/ \ marco(type, max_humidity) /**/ \ marco(type, drainage_pump_speed) /**/ \ marco(type, injection_pump_speed) /**/ \ marco(type, pre_heat_time_s) /**/ \ - marco(type, stoped_humi) /**/ \ - marco(type, continued_humi) /**/ \ 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 72c9a3e..81c73bd 100644 --- a/appsrc/appconfig/basic/zappversion.hpp +++ b/appsrc/appconfig/basic/zappversion.hpp @@ -1,3 +1,3 @@ #pragma once -#define VERSION "3.0.4" +#define VERSION "3.0.6" #define PROJECT_NAME "TRANSMIT_DM" \ No newline at end of file diff --git a/appsrc/service/app/disinfection_ctrl/disinfection_ctrl_service.cpp b/appsrc/service/app/disinfection_ctrl/disinfection_ctrl_service.cpp index 6776225..060e04b 100644 --- a/appsrc/service/app/disinfection_ctrl/disinfection_ctrl_service.cpp +++ b/appsrc/service/app/disinfection_ctrl/disinfection_ctrl_service.cpp @@ -213,7 +213,7 @@ void DisinfectionCtrlService::checkBeforeStart() { void DisinfectionCtrlService::startWorkThread() { resetState(); - + handlePumpStopFlag = false; m_thread.reset(new Thread("DisinfectionStateMachineThread", [this]() { DS->setDeviceState(DeviceState::Disinfection); logger->info("DisinfectionStateMachineThread start"); @@ -549,8 +549,10 @@ void DisinfectionCtrlService::processStateDisinfection(DisinfectionEvent* event) } else { if (isTimeToResumeDisinfection()) { logger->info("resumeDisinfection"); - dics->AC_ctrl(1); - dics->SprayPump_start(getSettingAsInt(SettingId::injection_pump_speed)); + if (!handlePumpStopFlag) { + dics->AC_ctrl(1); + dics->SprayPump_start(getSettingAsInt(SettingId::injection_pump_speed)); + } s_isDisinfectionTakeBreak = false; tryLogState(true); } @@ -595,11 +597,26 @@ void DisinfectionCtrlService::processStateDisinfection(DisinfectionEvent* event) // 检查是否消毒完成 } else if (event->event == kevent_update_cfg) { - if (!s_isDisinfectionTakeBreak) { + if (!s_isDisinfectionTakeBreak && !handlePumpStopFlag) { + dics->AC_ctrl(1); dics->SprayPump_start(getSettingAsInt(SettingId::injection_pump_speed)); } + if (handlePumpStopFlag) { + dics->SprayPump_stop(); + dics->AC_close(); + } } } + +void DisinfectionCtrlService::setHandleStopPumpInjectionFlag() { + handlePumpStopFlag = true; + updateCfg(); +} +void DisinfectionCtrlService::clearHandleStopPumpInjectionFlag() { + handlePumpStopFlag = false; + updateCfg(); +} + void DisinfectionCtrlService::processStateEmpytLiquidFromTheLine(DisinfectionEvent* event) { if (event->event == kevent_enter_state) { tryLogState(true); diff --git a/appsrc/service/app/disinfection_ctrl/disinfection_ctrl_service.hpp b/appsrc/service/app/disinfection_ctrl/disinfection_ctrl_service.hpp index e5f0adf..ca10e57 100644 --- a/appsrc/service/app/disinfection_ctrl/disinfection_ctrl_service.hpp +++ b/appsrc/service/app/disinfection_ctrl/disinfection_ctrl_service.hpp @@ -61,6 +61,8 @@ class DisinfectionCtrlService : public enable_shared_from_this syncState) { sm.getStateSafeBlock(syncState); } + void clearHandleStopPumpInjectionFlag(); + void setHandleStopPumpInjectionFlag(); + bool getHandlePumpStopFlag() { return handlePumpStopFlag; } + map& getRealtimeCfg() { return m_realtimeCfg; } DisinfectionState getState() { return sm.getState(); } int getCurStateRemainTimeS() { return s_remaintime; } diff --git a/appsrc/service/app/disinfection_ctrl_service_ext.cpp b/appsrc/service/app/disinfection_ctrl_service_ext.cpp index e96e823..25b97a6 100644 --- a/appsrc/service/app/disinfection_ctrl_service_ext.cpp +++ b/appsrc/service/app/disinfection_ctrl_service_ext.cpp @@ -50,6 +50,8 @@ void DisinfectionCtrlServiceExt::initialize() { REG_EXTFN_VOID(getServiceConfig, void()); REG_EXTFN_VOID(startStateReport, void()); REG_EXTFN_VOID(stopStateReport, void()); + REG_EXTFN_VOID(clearHandleStopPumpInjectionFlag, void()); + REG_EXTFN_VOID(setHandleStopPumpInjectionFlag, void()); stateUpdateThread.reset(new Thread("DisinfectionCtrlServiceExt-stateUpdateThread", [this]() { ThisThread thisThread; @@ -107,7 +109,14 @@ void DisinfectionCtrlServiceExt::setRealtimeConfig(shared_ptr dcs->getRealtimeCfg()[key] = val; dcs->updateCfg(); } - +void DisinfectionCtrlServiceExt::clearHandleStopPumpInjectionFlag(shared_ptr cxt) { + dcs->clearHandleStopPumpInjectionFlag(); + if (stateUpdateThread) stateUpdateThread->wake(); +} +void DisinfectionCtrlServiceExt::setHandleStopPumpInjectionFlag(shared_ptr cxt) { + dcs->setHandleStopPumpInjectionFlag(); + if (stateUpdateThread) stateUpdateThread->wake(); +} void DisinfectionCtrlServiceExt::getState(shared_ptr cxt) { cxt->rely = getState(); } json DisinfectionCtrlServiceExt::getState() { json rely; @@ -121,6 +130,7 @@ json DisinfectionCtrlServiceExt::getState() { rely["injectedVelocity"] = dcs->getInjectedVelocity(); rely["startTimestamp"] = dcs->getStartTP(); rely["completeTimestamp"] = dcs->getCompleteTP(); + rely["handlePumpStopFlag"] = dcs->getHandlePumpStopFlag(); }); return rely; } diff --git a/appsrc/service/app/disinfection_ctrl_service_ext.hpp b/appsrc/service/app/disinfection_ctrl_service_ext.hpp index 4186d9d..e0f7a59 100644 --- a/appsrc/service/app/disinfection_ctrl_service_ext.hpp +++ b/appsrc/service/app/disinfection_ctrl_service_ext.hpp @@ -44,6 +44,9 @@ class DisinfectionCtrlServiceExt : public enable_shared_from_this cxt, string key, string val); void updateTargetLogLevel(shared_ptr cxt, float loglevel); + void clearHandleStopPumpInjectionFlag(shared_ptr cxt); + void setHandleStopPumpInjectionFlag(shared_ptr cxt); + /******************************************************************************* * 状态 * *******************************************************************************/ @@ -55,7 +58,7 @@ class DisinfectionCtrlServiceExt : public enable_shared_from_thisgetState(); } - int64_t getDisinfectionStartTP() { return dcs->getStartTP(); } + int64_t getDisinfectionStartTP() { return dcs->getStartTP(); } }; } // namespace iflytop \ No newline at end of file diff --git a/appsrc/service/os_mgr_service.cpp b/appsrc/service/os_mgr_service.cpp index 18c47a1..d9ee08a 100644 --- a/appsrc/service/os_mgr_service.cpp +++ b/appsrc/service/os_mgr_service.cpp @@ -35,5 +35,12 @@ void OsMgrService::updateTime(shared_ptr cxt, int hour, int m } void OsMgrService::getTime(shared_ptr cxt) { - cxt->rely["time"] = duration_cast(system_clock::now().time_since_epoch()).count(); + // cxt->rely["time"] = duration_cast(system_clock::now().time_since_epoch()).count(); + + struct timeval tv; + gettimeofday(&tv, NULL); + + // 计算毫秒级 Unix 时间戳 + long long timestamp_ms = (long long)tv.tv_sec * 1000 + tv.tv_usec / 1000; + cxt->rely["time"] = timestamp_ms; } diff --git a/packet_release.sh b/packet_release.sh index f9cda88..7030709 100755 --- a/packet_release.sh +++ b/packet_release.sh @@ -18,7 +18,7 @@ rm -rf $packetpath mkdir -p $packetpath/ cp ./build/app/* $packetpath/ -cp -rf html $packetpath/ +# cp -rf html $packetpath/ tar -czvf $packetpath.tar.gz -C /tmp/ $packetname