diff --git a/README.md b/README.md index 62396fc..cae8ddb 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,9 @@ VERSION 1.1.7 1. 修复配方更新接口BUG 2. 修改ackinfo 为 message +VERSION 1.1.8 + 1. 增加运行时修改loggerlevel的功能 + TODO: 添加用户增加用户查重检查 diff --git a/appsrc/appsetting/project_port/basic/zappversion.hpp b/appsrc/appsetting/project_port/basic/zappversion.hpp index 1b9834c..15f627d 100644 --- a/appsrc/appsetting/project_port/basic/zappversion.hpp +++ b/appsrc/appsetting/project_port/basic/zappversion.hpp @@ -1,3 +1,3 @@ #pragma once -#define VERSION "1.1.7" +#define VERSION "1.1.8" #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 06f876f..4ec325f 100644 --- a/appsrc/service/app/disinfection_ctrl/disinfection_ctrl_service.cpp +++ b/appsrc/service/app/disinfection_ctrl/disinfection_ctrl_service.cpp @@ -110,6 +110,10 @@ bool DisinfectionCtrlService::isTimeToResumeDisinfection() { return false; } +void DisinfectionCtrlService::updateTargetLogLevel(float loglevel) { // + logger->info("updateTargetLogLevel:{}", loglevel); + m_tlog = loglevel; +} void DisinfectionCtrlService::initialize() { GET_TO_SERVICE(db); diff --git a/appsrc/service/app/disinfection_ctrl/disinfection_ctrl_service.hpp b/appsrc/service/app/disinfection_ctrl/disinfection_ctrl_service.hpp index 5476119..5022d5c 100644 --- a/appsrc/service/app/disinfection_ctrl/disinfection_ctrl_service.hpp +++ b/appsrc/service/app/disinfection_ctrl/disinfection_ctrl_service.hpp @@ -83,6 +83,7 @@ class DisinfectionCtrlService : public enable_shared_from_this& getRealtimeCfg() { return m_realtimeCfg; } DisinfectionState getState() { return sm.getState(); } diff --git a/appsrc/service/app/disinfection_ctrl_service_ext.cpp b/appsrc/service/app/disinfection_ctrl_service_ext.cpp index 44c1021..8b268a5 100644 --- a/appsrc/service/app/disinfection_ctrl_service_ext.cpp +++ b/appsrc/service/app/disinfection_ctrl_service_ext.cpp @@ -47,11 +47,11 @@ void DisinfectionCtrlServiceExt::initialize() { REG_EXTFN_VOID(stop, void()); REG_EXTFN_VOID(getState, void()); REG_EXTFN_VOID(getRealtimeConfig, void()); - REG_EXTFN(setRealtimeConfig, void(string, string), key, val); + REG_EXTFN(setRealtimeConfig, void(SettingId, string), key, val); + REG_EXTFN(updateTargetLogLevel, void(float), loglevel); REG_EXTFN_VOID(getServiceConfig, void()); REG_EXTFN_VOID(startStateReport, void()); REG_EXTFN_VOID(stopStateReport, void()); - } void DisinfectionCtrlServiceExt::start(shared_ptr cxt, string loglevel) { @@ -76,6 +76,9 @@ void DisinfectionCtrlServiceExt::getRealtimeConfig(shared_ptr rely[cfg.first] = cfg.second; } } + +void DisinfectionCtrlServiceExt::updateTargetLogLevel(shared_ptr cxt, float loglevel) { dcs->updateTargetLogLevel(loglevel); } + void DisinfectionCtrlServiceExt::setRealtimeConfig(shared_ptr cxt, string key, string val) { logger->info("setRealtimeConfig key:{} val:{}", key, val); dcs->getRealtimeCfg()[key] = val; diff --git a/appsrc/service/app/disinfection_ctrl_service_ext.hpp b/appsrc/service/app/disinfection_ctrl_service_ext.hpp index ca10720..5f3698f 100644 --- a/appsrc/service/app/disinfection_ctrl_service_ext.hpp +++ b/appsrc/service/app/disinfection_ctrl_service_ext.hpp @@ -44,6 +44,8 @@ class DisinfectionCtrlServiceExt : public enable_shared_from_this cxt); void setRealtimeConfig(shared_ptr cxt, string key, string val); + void updateTargetLogLevel(shared_ptr cxt, float loglevel); + /******************************************************************************* * 状态 * *******************************************************************************/ @@ -53,7 +55,6 @@ class DisinfectionCtrlServiceExt : public enable_shared_from_this cxt); json getState(DisinfectionState& state); - }; } // namespace iflytop \ No newline at end of file diff --git a/build.sh b/build.sh index 54c1570..d3e470c 100755 --- a/build.sh +++ b/build.sh @@ -1,7 +1,7 @@ #!/bin/bash # -# ./build.sh +# ./build.sh # # PROJECT_TYPE_LARGE_SPACE_DISINFECTION # PROJECT_TYPE_SMALL_SPACE_DISINFECTION @@ -10,11 +10,16 @@ # mkdir -p build && rm -rf build && mkdir -p build -cd build -cmake .. \ - -DCMAKE_C_COMPILER='aarch64-linux-gnu-gcc' \ - -DCMAKE_CXX_COMPILER='aarch64-linux-gnu-g++' \ - -DARCH=aarch64 \ +function build_target() { + cd build + cmake .. \ + -DCMAKE_C_COMPILER='aarch64-linux-gnu-gcc' \ + -DCMAKE_CXX_COMPILER='aarch64-linux-gnu-g++' \ + -DARCH=aarch64 -make -j8 -make install \ No newline at end of file + make -j8 + make install +} + +build_target +build_target #之所以执行两遍,是因为执行一边生成不了compile.json文件,导致vscode无法跳转到定义,原因未知 \ No newline at end of file