diff --git a/app_protocols/appexception/appexception.hpp b/app_protocols/appexception/appexception.hpp index 8351cf2..8243477 100644 --- a/app_protocols/appexception/appexception.hpp +++ b/app_protocols/appexception/appexception.hpp @@ -34,7 +34,7 @@ class appexception : public std::exception { this->description = description; this->m_ecode = ecode; this->whatstr = fmt::format("[{}:{}] throw exception: {} {}", thisclass.className, func, ecode2str(ecode), description); - thisclass.logger->error(whatstr); + // thisclass.logger->error(whatstr); } appexception(ThisClass &thisclass, string func, int32_t ecode, const char *fmt, ...) { @@ -46,7 +46,7 @@ class appexception : public std::exception { this->description = buffer; this->m_ecode = ecode; this->whatstr = fmt::format("[{}:{}] throw exception: {} {}", thisclass.className, func, ecode2str(ecode), buffer); - thisclass.logger->error(whatstr); + // thisclass.logger->error(whatstr); } virtual ~appexception() {} diff --git a/appsrc/appcomponents/canchannel/com/zscanprotocol_com.cpp b/appsrc/appcomponents/canchannel/com/zscanprotocol_com.cpp index e465657..52849fc 100644 --- a/appsrc/appcomponents/canchannel/com/zscanprotocol_com.cpp +++ b/appsrc/appcomponents/canchannel/com/zscanprotocol_com.cpp @@ -195,19 +195,23 @@ shared_ptr ZSCanProtocolCom::base_callcmd(int32_t to, int32_t cmdid, ui shared_ptr ZSCanProtocolCom::callcmd(int32_t to, int32_t cmdid, uint8_t *param, int32_t paramLen, int32_t overtime) { shared_ptr receipt; + usleep(10 * 1000); for (size_t i = 0; i <= 3; i++) { try { - if (i != 0) logger->warn("callcmd overtime, retry {}", i); receipt = base_callcmd(to, cmdid, param, paramLen, overtime); } catch (const appexception &e) { if (e.ecode() == err::kerr_overtime) { + // sl + if (i != 0) logger->warn("callcmd cmdid[%d] to [%d] overtime, retry {}", cmdid, to, i); + usleep(100 * 1000); continue; } throw; } break; } + if (receipt == nullptr) THROW_APP_EXCEPTION(err::kerr_overtime, "overtime"); return receipt; } diff --git a/appsrc/appcomponents/canchannel/transmit_disinfection_can_master.hpp b/appsrc/appcomponents/canchannel/transmit_disinfection_can_master.hpp index 8a362d0..fbe6752 100644 --- a/appsrc/appcomponents/canchannel/transmit_disinfection_can_master.hpp +++ b/appsrc/appcomponents/canchannel/transmit_disinfection_can_master.hpp @@ -15,7 +15,7 @@ // #include "app_protocols/transmit_disfection_protocol/transmit_disfection_protocol.hpp" #include "appcomponents/canchannel/com/zscanprotocol_com.hpp" -#define DEFUALT_OVERTIME 30 +#define DEFUALT_OVERTIME 100 namespace iflytop { using namespace std; diff --git a/appsrc/service/app/add_liquid_service.cpp b/appsrc/service/app/add_liquid_service.cpp index 9d813cf..97e8e00 100644 --- a/appsrc/service/app/add_liquid_service.cpp +++ b/appsrc/service/app/add_liquid_service.cpp @@ -8,6 +8,11 @@ using namespace iflytop; void AddLiquidService::initialize() { logger->info("AddLiquidService initialize"); + GET_TO_SERVICE(m_db); + GET_TO_SERVICE(m_ds); + GET_TO_SERVICE(m_gConfig); + GET_TO_SERVICE(m_dics); + GET_TO_SERVICE(m_dwus); REG_EXTFN(start, void(int), stopatg); REG_EXTFN_VOID(stop, void()); @@ -151,5 +156,5 @@ void AddLiquidService::getServiceConfig(shared_ptr cxt) { cfg["maxLiquid"] = PORT.getDisinfectantBucketCapacity(); cfg["show"] = true; cfg["updatePeriod"] = 300; - cxt->rely = cfg; + cxt->rely = cfg; } diff --git a/appsrc/service/app/air_leak_detect_test.hpp b/appsrc/service/app/air_leak_detect_test.hpp index afadd28..462cb7c 100644 --- a/appsrc/service/app/air_leak_detect_test.hpp +++ b/appsrc/service/app/air_leak_detect_test.hpp @@ -13,7 +13,7 @@ #include "service/hardware/device_io_ctrl_service.hpp" namespace iflytop { class AirLeakDetectTest : public enable_shared_from_this { - THISCLASS(AddLiquidService); + THISCLASS(AirLeakDetectTest); public: typedef enum { diff --git a/appsrc/service/app/drain_liquid_service.cpp b/appsrc/service/app/drain_liquid_service.cpp index 3dec946..db7cd26 100644 --- a/appsrc/service/app/drain_liquid_service.cpp +++ b/appsrc/service/app/drain_liquid_service.cpp @@ -4,6 +4,13 @@ using namespace iflytop; void DrainLiquidService::initialize() { logger->info("DrainLiquidService initialize"); + + GET_TO_SERVICE(m_db); + GET_TO_SERVICE(m_ds); + GET_TO_SERVICE(m_gConfig); + GET_TO_SERVICE(m_dics); + GET_TO_SERVICE(m_dwus); + REG_EXTFN_VOID(start, void()); REG_EXTFN_VOID(stop, void()); REG_EXTFN_VOID(getState, void()); @@ -73,7 +80,7 @@ void DrainLiquidService::getServiceConfig(shared_ptr cxt) { cfg["maxLiquid"] = PORT.getDisinfectantBucketCapacity(); cfg["show"] = true; cfg["updatePeriod"] = 300; - cxt->rely = cfg; + cxt->rely = cfg; } void DrainLiquidService::workThread() { diff --git a/appsrc/service/app/drain_liquid_service.hpp b/appsrc/service/app/drain_liquid_service.hpp index 676cffb..37b24bc 100644 --- a/appsrc/service/app/drain_liquid_service.hpp +++ b/appsrc/service/app/drain_liquid_service.hpp @@ -15,7 +15,7 @@ // namespace iflytop { class DrainLiquidService : public enable_shared_from_this { - THISCLASS(AddLiquidService); + THISCLASS(DrainLiquidService); public: typedef enum { diff --git a/appsrc/service/device_info_mgr_service.cpp b/appsrc/service/device_info_mgr_service.cpp index 765296b..ed7c2f0 100644 --- a/appsrc/service/device_info_mgr_service.cpp +++ b/appsrc/service/device_info_mgr_service.cpp @@ -19,5 +19,5 @@ void DeviceInfoMgrService::getDeviceInfo(shared_ptr cxt) { / content["projectType"] = PORT.getProjTypeString(); content["appVersion"] = VERSION; content["mircoVersion"] = "3.0.0"; // TODO:换成真实的版本信息 - content["ip"] = "192.168.8.10"; + content["ip"] = "192.168.73.10"; } diff --git a/appsrc/service/front_end_realtime_display_content_mgr.cpp b/appsrc/service/front_end_realtime_display_content_mgr.cpp index 366e8c9..054ad83 100644 --- a/appsrc/service/front_end_realtime_display_content_mgr.cpp +++ b/appsrc/service/front_end_realtime_display_content_mgr.cpp @@ -8,7 +8,6 @@ void FrontEndRealtimeDisplayContentMgr::initialize() { // } void FrontEndRealtimeDisplayContentMgr::readH2O2SensorData(shared_ptr cxt) { - auto& content = cxt->rely; auto h2o2Mgr = GET_SERVICE(DeviceIoControlService)->getH2O2SensorMgr();