Browse Source

v3.0.6

master
zhaohe 4 weeks ago
parent
commit
b482215e27
  1. 4
      appsrc/appbase/appbean/setting_id.hpp
  2. 2
      appsrc/appconfig/basic/zappversion.hpp
  3. 25
      appsrc/service/app/disinfection_ctrl/disinfection_ctrl_service.cpp
  4. 6
      appsrc/service/app/disinfection_ctrl/disinfection_ctrl_service.hpp
  5. 12
      appsrc/service/app/disinfection_ctrl_service_ext.cpp
  6. 5
      appsrc/service/app/disinfection_ctrl_service_ext.hpp
  7. 9
      appsrc/service/os_mgr_service.cpp
  8. 2
      packet_release.sh

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

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

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

6
appsrc/service/app/disinfection_ctrl/disinfection_ctrl_service.hpp

@ -61,6 +61,8 @@ class DisinfectionCtrlService : public enable_shared_from_this<DisinfectionCtrlS
int s_afterDisinfectantVolume_g = {}; // 消毒后消毒剂量
int s_disinfectantVolumeLevel = {}; // 消毒液位级别
bool handlePumpStopFlag = false; //
public:
void initialize();
@ -88,6 +90,10 @@ class DisinfectionCtrlService : public enable_shared_from_this<DisinfectionCtrlS
void getStateSafeBlock(function<void()> syncState) { sm.getStateSafeBlock(syncState); }
void clearHandleStopPumpInjectionFlag();
void setHandleStopPumpInjectionFlag();
bool getHandlePumpStopFlag() { return handlePumpStopFlag; }
map<string, string>& getRealtimeCfg() { return m_realtimeCfg; }
DisinfectionState getState() { return sm.getState(); }
int getCurStateRemainTimeS() { return s_remaintime; }

12
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<MsgProcessContext>
dcs->getRealtimeCfg()[key] = val;
dcs->updateCfg();
}
void DisinfectionCtrlServiceExt::clearHandleStopPumpInjectionFlag(shared_ptr<MsgProcessContext> cxt) {
dcs->clearHandleStopPumpInjectionFlag();
if (stateUpdateThread) stateUpdateThread->wake();
}
void DisinfectionCtrlServiceExt::setHandleStopPumpInjectionFlag(shared_ptr<MsgProcessContext> cxt) {
dcs->setHandleStopPumpInjectionFlag();
if (stateUpdateThread) stateUpdateThread->wake();
}
void DisinfectionCtrlServiceExt::getState(shared_ptr<MsgProcessContext> 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;
}

5
appsrc/service/app/disinfection_ctrl_service_ext.hpp

@ -44,6 +44,9 @@ class DisinfectionCtrlServiceExt : public enable_shared_from_this<DisinfectionCt
void setRealtimeConfig(shared_ptr<MsgProcessContext> cxt, string key, string val);
void updateTargetLogLevel(shared_ptr<MsgProcessContext> cxt, float loglevel);
void clearHandleStopPumpInjectionFlag(shared_ptr<MsgProcessContext> cxt);
void setHandleStopPumpInjectionFlag(shared_ptr<MsgProcessContext> cxt);
/*******************************************************************************
* *
*******************************************************************************/
@ -55,7 +58,7 @@ class DisinfectionCtrlServiceExt : public enable_shared_from_this<DisinfectionCt
json getState();
DisinfectionState getDisinfectionState() { return dcs->getState(); }
int64_t getDisinfectionStartTP() { return dcs->getStartTP(); }
int64_t getDisinfectionStartTP() { return dcs->getStartTP(); }
};
} // namespace iflytop

9
appsrc/service/os_mgr_service.cpp

@ -35,5 +35,12 @@ void OsMgrService::updateTime(shared_ptr<MsgProcessContext> cxt, int hour, int m
}
void OsMgrService::getTime(shared_ptr<MsgProcessContext> cxt) {
cxt->rely["time"] = duration_cast<milliseconds>(system_clock::now().time_since_epoch()).count();
// cxt->rely["time"] = duration_cast<milliseconds>(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;
}

2
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

Loading…
Cancel
Save