From a156954b47952ce1f8c843035390c8f3cbc8047f Mon Sep 17 00:00:00 2001 From: zhaohe Date: Wed, 2 Jul 2025 10:42:12 +0800 Subject: [PATCH] =?UTF-8?q?v2.3.5=20|=20=E6=B7=BB=E5=8A=A0=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E9=A1=B5=E9=9D=A2=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zservice_container/zservice_container.hpp | 35 ++- appsrc/appconfig/basic/zappversion.hpp | 2 +- appsrc/baseservice/port/project_port.cpp | 22 +- appsrc/baseservice/port/project_port.hpp | 2 +- appsrc/main.cpp | 1 + .../disinfection_ctrl_service.cpp | 4 +- appsrc/service/app_core.cpp | 27 ++- appsrc/service/app_core.hpp | 1 + appsrc/service/hardware/device_io_ctrl_service.cpp | 6 +- .../disinfectant_weight_update_service.cpp | 4 +- .../service/hardware/sensor_state_sync_service.cpp | 57 +++++ .../service/hardware/sensor_state_sync_service.hpp | 79 ++++++ .../service/hardware/warning_light_controler.cpp | 4 +- appsrc/service/test_page_ctrl_service.cpp | 114 +++++++++ appsrc/service/test_page_ctrl_service.hpp | 67 ++++++ appsrc/service/test_page_mgr_service.cpp | 267 --------------------- appsrc/service/test_page_mgr_service.hpp | 57 ----- appsrc/service/test_page_service_v2.cpp | 60 ----- appsrc/service/test_page_service_v2.hpp | 54 ----- 19 files changed, 386 insertions(+), 477 deletions(-) create mode 100644 appsrc/service/hardware/sensor_state_sync_service.cpp create mode 100644 appsrc/service/hardware/sensor_state_sync_service.hpp create mode 100644 appsrc/service/test_page_ctrl_service.cpp create mode 100644 appsrc/service/test_page_ctrl_service.hpp delete mode 100644 appsrc/service/test_page_mgr_service.cpp delete mode 100644 appsrc/service/test_page_mgr_service.hpp delete mode 100644 appsrc/service/test_page_service_v2.cpp delete mode 100644 appsrc/service/test_page_service_v2.hpp diff --git a/appdep/components/zservice_container/zservice_container.hpp b/appdep/components/zservice_container/zservice_container.hpp index a74fb9a..59ff563 100644 --- a/appdep/components/zservice_container/zservice_container.hpp +++ b/appdep/components/zservice_container/zservice_container.hpp @@ -42,8 +42,7 @@ class ZserviceContainerAny { template explicit ZserviceContainerAny(const ValueType& value) : content_(new Holder(value)) {} - ZserviceContainerAny(const ZserviceContainerAny& other) - : content_(other.content_ ? other.content_->clone() : nullptr) {} + ZserviceContainerAny(const ZserviceContainerAny& other) : content_(other.content_ ? other.content_->clone() : nullptr) {} public: ZserviceContainerAny& swap(ZserviceContainerAny& rhs) { @@ -87,7 +86,7 @@ class ZserviceContainerAny { public: virtual const std::type_info& GetType() const = 0; - virtual ZPlaceHolder* clone() const = 0; + virtual ZPlaceHolder* clone() const = 0; }; template @@ -136,7 +135,7 @@ ValueType zany_cast(const ZserviceContainerAny& any) { class ServiceContrainer { map services; - ServiceContrainer(){}; + ServiceContrainer() {}; public: static ServiceContrainer& get(); @@ -148,7 +147,7 @@ class ServiceContrainer { } object->initialize(); type_index index = typeid(T); - services[index] = ZserviceContainerAny(object); + services[index] = ZserviceContainerAny(object); }; template void regService(shared_ptr object) { @@ -156,12 +155,12 @@ class ServiceContrainer { return; } type_index index = typeid(T); - services[index] = ZserviceContainerAny(object); + services[index] = ZserviceContainerAny(object); }; template shared_ptr getService() { - type_index index = typeid(T); - auto result = services.find(index); + type_index index = typeid(T); + auto result = services.find(index); if (result == services.end()) { return nullptr; } @@ -169,9 +168,19 @@ class ServiceContrainer { }; template + shared_ptr getService(string file, int line) { + auto service = getService(); + if (service == nullptr) { + printf("[%s:%d] getService(%s) fail\n", file.c_str(), line, typeid(T).name()); + exit(-1); + } + return service; + }; + + template void getToService(shared_ptr& service) { - type_index index = typeid(T); - auto result = services.find(index); + type_index index = typeid(T); + auto result = services.find(index); if (result == services.end()) { service = nullptr; } @@ -179,6 +188,8 @@ class ServiceContrainer { }; }; +#define SERVICE(type, name) shared_ptr name = ServiceContrainer::get().getService(__FILE__, __LINE__); + #define GET_SERVICE(type) (ServiceContrainer::get().getService()) #define GET_TO_SERVICE(value) \ ServiceContrainer::get().getToService(value); \ @@ -190,10 +201,10 @@ class ServiceContrainer { #define BUILD_AND_REG_SERRVICE(type, ...) \ logger->info("build {}.....", #type); \ shared_ptr type##_val(new type(__VA_ARGS__)); \ - ServiceContrainer::get().regService(type##_val);\ + ServiceContrainer::get().regService(type##_val); \ GET_SERVICE(type)->initialize(); -#define REG_SERRVICE(type,object) \ +#define REG_SERRVICE(type, object) \ shared_ptr type##_val(object); \ ServiceContrainer::get().regService(type##_val); diff --git a/appsrc/appconfig/basic/zappversion.hpp b/appsrc/appconfig/basic/zappversion.hpp index 1714eb8..d1a8ab0 100644 --- a/appsrc/appconfig/basic/zappversion.hpp +++ b/appsrc/appconfig/basic/zappversion.hpp @@ -1,3 +1,3 @@ #pragma once -#define VERSION "2.3.4" +#define VERSION "2.3.5" #define PROJECT_NAME "TRANSMIT_DM" \ No newline at end of file diff --git a/appsrc/baseservice/port/project_port.cpp b/appsrc/baseservice/port/project_port.cpp index 8359a05..c9a25f5 100644 --- a/appsrc/baseservice/port/project_port.cpp +++ b/appsrc/baseservice/port/project_port.cpp @@ -55,7 +55,7 @@ string ProjectPort::getProjTypeString() { return projectType; } void ProjectPort::initProjectSetting(int projectTypeInt) { this->projectTypeInt = projectTypeInt; // 设备ID初始化 - if (isLageSpaceDM() || isDT300N() || isDT300W() || isDT600B()) { + if (isDT600N() || isDT300N() || isDT300W() || isDT600B()) { // 加液泵 INSERT(HardwareComponent::AddLiquidPump, FIXBOARDID_LC_BOARD, kpumpid_add_liquid); // 喷雾泵 @@ -107,28 +107,28 @@ void ProjectPort::initProjectSetting(int projectTypeInt) { // 00003072 INFO [PxxSensor] Sensor[4] id:4 ptype:P100 precision:1 unit:kpa zero:-900 full:1000 加液 float ProjectPort::ACPostPS_To_Pa(int rawval) { - if (isLageSpaceDM() || isDT300N() || isDT300W()) { + if (isDT600N() || isDT300N() || isDT300W()) { return rawval / 10.0 * 1000; } else { THROW_APP_EXCEPTION(err::kappe_code_error, fmt::format("project [{}({})] not support: ", to_string(projectTypeInt).c_str(), projectTypeInt)); } } float ProjectPort::LiquidWeightPS_To_Pa(int rawval) { - if (isLageSpaceDM() || isDT300N() || isDT300W()) { + if (isDT600N() || isDT300N() || isDT300W()) { return rawval; } else { THROW_APP_EXCEPTION(err::kappe_code_error, fmt::format("project [{}({})] not support: ", to_string(projectTypeInt).c_str(), projectTypeInt)); } } float ProjectPort::SprayPumpPostPS_To_Pa(int rawval) { - if (isLageSpaceDM() || isDT300N() || isDT300W()) { + if (isDT600N() || isDT300N() || isDT300W()) { return rawval / 10.0 * 1000; } else { THROW_APP_EXCEPTION(err::kappe_code_error, fmt::format("project [{}({})] not support: ", to_string(projectTypeInt).c_str(), projectTypeInt)); } } float ProjectPort::AddLiquidPumpPostPS_To_Pa(int rawval) { - if (isLageSpaceDM() || isDT300N() || isDT300W()) { + if (isDT600N() || isDT300N() || isDT300W()) { return rawval / 10.0 * 1000; } else { THROW_APP_EXCEPTION(err::kappe_code_error, fmt::format("project [{}({})] not support: ", to_string(projectTypeInt).c_str(), projectTypeInt)); @@ -139,7 +139,7 @@ float ProjectPort::AirLeakDetectPS_To_Pa(int rawval) { return rawval; } double ProjectPort::getGpm2SpeedRadio() { float gpmToSpeedRadio = 0; - if (isLageSpaceDM()) { + if (isDT600N()) { gpmToSpeedRadio = LARGE_SPACE_DM__GPM_TO_SPEED_RADIO; } else if (isDT600B()) { gpmToSpeedRadio = DT600B__GPM_TO_SPEED_RADIO; @@ -165,7 +165,7 @@ double ProjectPort::speed2gpm(double speed) { } float ProjectPort::pressurePa2VolumeG(int pa) { - if (isLageSpaceDM()) { + if (isDT600N()) { return VolumeConvertor(VolumeConvertor::largeSpaceParam).pressurePa2VolumeG(pa); } if (isDT300N()) { @@ -182,7 +182,7 @@ float ProjectPort::pressurePa2VolumeG(int pa) { } int32_t ProjectPort::getMainH2O2SensorId() { return getId(HardwareComponent::MainH2O2Sensor).boardId; } int32_t ProjectPort::getSprayLiquidPumpMaxRPM() { - if (isLageSpaceDM()) { + if (isDT600N()) { return 600; } if (isDT600B()) { @@ -203,7 +203,7 @@ int32_t ProjectPort::getSprayLiquidPumpMaxRPM() { * @brief 获取消毒液剩余量 */ int32_t ProjectPort::getDisinfectantBucketCapacity() { - if (isLageSpaceDM()) { + if (isDT600N()) { return LARGE_SPACE_DM__DISINFECTANT_BUCKET_CAPACITY; } if (isDT300N()) { @@ -218,7 +218,7 @@ int32_t ProjectPort::getDisinfectantBucketCapacity() { return 0; } int32_t ProjectPort::getExtH2O2SensorNum() { - if (isLageSpaceDM()) { + if (isDT600N()) { return 2; } if (isDT300N()) { @@ -237,7 +237,7 @@ int32_t ProjectPort::getExtH2O2SensorNum() { } bool ProjectPort::isHasDisinfectantBucket() { - if (isLageSpaceDM()) { + if (isDT600N()) { return true; } if (isDT300N()) { diff --git a/appsrc/baseservice/port/project_port.hpp b/appsrc/baseservice/port/project_port.hpp index 906ee21..1bc4813 100644 --- a/appsrc/baseservice/port/project_port.hpp +++ b/appsrc/baseservice/port/project_port.hpp @@ -49,7 +49,7 @@ class ProjectPort { /******************************************************************************* * //设备类型判断 * *******************************************************************************/ - bool isLageSpaceDM() { return projectTypeInt == DT600N; } + bool isDT600N() { return projectTypeInt == DT600N; } bool isDT300N() { return projectTypeInt == DT300N; } bool isDT300W() { return projectTypeInt == DT300W; } bool isDT100N() { return projectTypeInt == DT100N; } diff --git a/appsrc/main.cpp b/appsrc/main.cpp index 8a140e6..78aa20f 100644 --- a/appsrc/main.cpp +++ b/appsrc/main.cpp @@ -142,6 +142,7 @@ int Main::main(int argc, char *argv[]) { logger->info("#"); logger->info("build {}.....", "Config"); + // logger->info("VolumeConvertor::largeSpaceParam:{}", VolumeConvertor(VolumeConvertor::largeSpaceParam).getFullVolumeG()); // logger->info("VolumeConvertor::smallSpaceParam:{}", VolumeConvertor(VolumeConvertor::smallSpaceParam).getFullVolumeG()); // logger->info("VolumeConvertor::pipeParam:{}", VolumeConvertor(VolumeConvertor::pipeParam).getFullVolumeG()); diff --git a/appsrc/service/app/disinfection_ctrl/disinfection_ctrl_service.cpp b/appsrc/service/app/disinfection_ctrl/disinfection_ctrl_service.cpp index dd14355..0ab27a8 100644 --- a/appsrc/service/app/disinfection_ctrl/disinfection_ctrl_service.cpp +++ b/appsrc/service/app/disinfection_ctrl/disinfection_ctrl_service.cpp @@ -565,7 +565,7 @@ void DisinfectionCtrlService::processStateDisinfection(DisinfectionEvent* event) // } // AppEventBus - if (PORT.isLageSpaceDM() || PORT.isDT300N() || PORT.isDT300W()) { + if (PORT.isDT600N() || PORT.isDT300N() || PORT.isDT300W()) { if (dwus->getWeight() < 10) { logger->error("DisinfectantBucket is empty"); pushSnapshot(createErrorSnapshot(err::kappe_disinfectant_insufficient)); @@ -673,7 +673,7 @@ void DisinfectionCtrlService::processStateFinished(DisinfectionEvent* event) { s_remaintime = 0; s_complete_tp = zsystem_clock().now(); - if (PORT.isLageSpaceDM() || PORT.isDT300N() || PORT.isDT300W()) { + if (PORT.isDT600N() || PORT.isDT300N() || PORT.isDT300W()) { s_afterDisinfectantVolume_g = GET_SERVICE(DisinfectantWeightUpdateService)->getWeight(); } else if (PORT.isDT100N()) { s_afterDisinfectantVolume_g = 0; diff --git a/appsrc/service/app_core.cpp b/appsrc/service/app_core.cpp index ad6753f..418cb9d 100644 --- a/appsrc/service/app_core.cpp +++ b/appsrc/service/app_core.cpp @@ -9,7 +9,7 @@ #include "service/front_end_realtime_display_content_mgr.hpp" #include "service/os_mgr_service.hpp" #include "service/setting_mgr_service.hpp" -#include "service/test_page_mgr_service.hpp" +#include "service/test_page_ctrl_service.hpp" #include "service/user_mgr_service.hpp" // #include "device_check_point_check_service.hpp" @@ -26,8 +26,8 @@ #include "baseservice/db/device_ext_setting_dao.hpp" #include "calibration/h2o2_liquid_weight_sensor_calibration_service.hpp" #include "equipment_usage_info_mgr_service.hpp" +#include "service/hardware/sensor_state_sync_service.hpp" #include "setting/ext_setting_mgr_service.hpp" -#include "test_page_service_v2.hpp" // DeviceExtSettingDAO @@ -141,6 +141,7 @@ void AppCore::initialize() { BUILD_AND_REG_SERRVICE(DisinfectantWeightUpdateService); BUILD_AND_REG_SERRVICE(WarningLightControler); + BUILD_AND_REG_SERRVICE(SensorStateSyncService); // BUILD_AND_REG_SERRVICE(PipelinePressureControl); BUILD_AND_REG_SERRVICE(UDiskMgrService); @@ -157,8 +158,7 @@ void AppCore::initialize() { BUILD_AND_REG_SERRVICE(SettingMgrService); BUILD_AND_REG_SERRVICE(DeviceInfoMgrService); BUILD_AND_REG_SERRVICE(OsMgrService); - BUILD_AND_REG_SERRVICE(TestPageMgrService); - BUILD_AND_REG_SERRVICE(TestPageServiceV2); + BUILD_AND_REG_SERRVICE(TestPageCtrlService); BUILD_AND_REG_SERRVICE(AddLiquidService); BUILD_AND_REG_SERRVICE(AirLeakDetectTest); @@ -288,14 +288,31 @@ void AppCore::startStateReport(shared_ptr cxt) { stateUpdateThread.reset(new Thread("stateUpdateThread", [this]() { while (!ThisThread().getExitFlag()) { + // logger->info("start report"); try { SEND_CLASS_REPORT(thisClass.className, "stateUpdate", getState()); } catch (const std::exception& e) { logger->error("stateUpdateThread error:{}", e.what()); } - ThisThread().sleepForMs(500); + ThisThread().sleepForMs(1000); + + // logger->info("end report"); + // ThisThread().sleepForMs(1); } })); + // stateUpdateThread2.reset(new Thread("stateUpdateThread", [this]() { + // while (!ThisThread().getExitFlag()) { + // logger->info("start report"); + // try { + // SEND_CLASS_REPORT(thisClass.className, "stateUpdate", getState()); + // } catch (const std::exception& e) { + // logger->error("stateUpdateThread error:{}", e.what()); + // } + // logger->info("end report"); + + // ThisThread().sleepForMs(1); + // } + // })); } void AppCore::stopStateReport(shared_ptr cxt) { if (stateUpdateThread) { diff --git a/appsrc/service/app_core.hpp b/appsrc/service/app_core.hpp index 19d072e..603f7bb 100644 --- a/appsrc/service/app_core.hpp +++ b/appsrc/service/app_core.hpp @@ -43,6 +43,7 @@ class AppCore : public enable_shared_from_this { list> appEventList; recursive_mutex appEventListMutex; unique_ptr stateUpdateThread; + unique_ptr stateUpdateThread2; public: AppCore() {}; diff --git a/appsrc/service/hardware/device_io_ctrl_service.cpp b/appsrc/service/hardware/device_io_ctrl_service.cpp index 403c163..899b4bb 100644 --- a/appsrc/service/hardware/device_io_ctrl_service.cpp +++ b/appsrc/service/hardware/device_io_ctrl_service.cpp @@ -96,7 +96,7 @@ void DeviceIoControlService::initialize() { * @brief 初始化所有硬件状态 */ try { - if (PORT.isDT600B() || PORT.isLageSpaceDM() || PORT.isDT300N() || PORT.isDT300W()) { + if (PORT.isDT600B() || PORT.isDT600N() || PORT.isDT300N() || PORT.isDT300W()) { // CAN_MASTER->clearResetFlag(kFixBoardId_LiquidCtrl); // CAN_MASTER->clearResetFlag(kFixBoardId_PowerControl); @@ -137,7 +137,7 @@ void DeviceIoControlService::initialize() { } catch (...) { \ } int DeviceIoControlService::forceStopDeviceWithoutExc() { - if (PORT.isDT600B() || PORT.isLageSpaceDM() || PORT.isDT300N() || PORT.isDT300W()) { + if (PORT.isDT600B() || PORT.isDT600N() || PORT.isDT300N() || PORT.isDT300W()) { TRY_DO(AddLiquidPump_stop()); TRY_DO(SprayPump_stop()); TRY_DO(Blower_close()); @@ -155,7 +155,7 @@ int DeviceIoControlService::forceStopDeviceWithoutExc() { int DeviceIoControlService::processHeartReportMsg(uint8_t from, report_heatpacket_data_t *report) { // if (from < 100) { - logger->info(" REPORT [Heat ][FROM:{}] HeatIndex:{:x} ToardType:{} flag:{}", from, report->heartIndex, BoardTypeId2Str(report->boardType), report->flag); + logger->info(" REPORT [心跳 ][FROM:{}] HeatIndex:{:x} ToardType:{} flag:{}", from, report->heartIndex, BoardTypeId2Str(report->boardType), report->flag); // } // #define CHECK_BOARD_IS_REBOOT(boardid, ecode) \ // { \ diff --git a/appsrc/service/hardware/disinfectant_weight_update_service.cpp b/appsrc/service/hardware/disinfectant_weight_update_service.cpp index 45da274..92cbd61 100644 --- a/appsrc/service/hardware/disinfectant_weight_update_service.cpp +++ b/appsrc/service/hardware/disinfectant_weight_update_service.cpp @@ -9,7 +9,7 @@ using namespace std; void DisinfectantWeightUpdateService::initialize() { // GET_TO_SERVICE(deviceIoControlService); - if (PORT.isLageSpaceDM() || PORT.isDT300N() || PORT.isDT300W()) { + if (PORT.isDT600N() || PORT.isDT300N() || PORT.isDT300W()) { updateThread.reset(new Thread("DisinfectantWeightUpdateService", [this]() { // updateWeightThread(); })); @@ -40,7 +40,7 @@ float DisinfectantWeightUpdateService::getRoughWeight() { void DisinfectantWeightUpdateService::updateWeightThread() { while (true) { - if (PORT.isLageSpaceDM() || PORT.isDT300N() || PORT.isDT300W()) { + if (PORT.isDT600N() || PORT.isDT300N() || PORT.isDT300W()) { if (DS->isTestMode()) { setNetWeight(1000); } diff --git a/appsrc/service/hardware/sensor_state_sync_service.cpp b/appsrc/service/hardware/sensor_state_sync_service.cpp new file mode 100644 index 0000000..23ce230 --- /dev/null +++ b/appsrc/service/hardware/sensor_state_sync_service.cpp @@ -0,0 +1,57 @@ +#include "sensor_state_sync_service.hpp" +using namespace iflytop; +using namespace std; +using namespace core; + +void SensorStateSyncService::initialize() { GET_TO_SERVICE(deviceIoControlService); } + +void SensorStateSyncService::startSync() { + if (updateThread && !updateThread->isWaitingForJoin()) { + logger->error("SensorStateSyncService update thread is already running"); + exit(-1); + } + updateThread.reset(new Thread("SensorStateSyncServiceUpdateThread", [this]() { // + updateThreadLoop(); + })); +} + +void SensorStateSyncService::updateThreadLoop() { + ThisThread thisThread; + while (true) { + try { + float airCompressorCurrent = 0; + float blowerCurrent = 0; + float heaterCurrent = 0; + float heaterTemperature = 0; + + if (PORT.isDT600N() || PORT.isDT300N() || PORT.isDT300W() || PORT.isDT600B()) { + airCompressorCurrent = deviceIoControlService->AC_readEI(); + thisThread.sleepForMs(10); + blowerCurrent = deviceIoControlService->Blower_readEI(); + thisThread.sleepForMs(10); + heaterCurrent = deviceIoControlService->Heater_readEI(); + thisThread.sleepForMs(10); + heaterTemperature = deviceIoControlService->Heater_readTemperature(); + thisThread.sleepForMs(10); + } + + { + lock_guard lock(m_mutex); + m_airCompressorCurrent = airCompressorCurrent; + m_blowerCurrent = blowerCurrent; + m_heaterCurrent = heaterCurrent; + m_heaterTemperature = heaterTemperature; + } + + } catch (const appexception& e) { + logger->error("SensorStateSyncService update thread error: {}", e.what()); + triggerError = true; + } + + if (triggerError) { + thisThread.sleepForMs(20 * 1000); + } else { + thisThread.sleepForMs(1 * 1000); + } + } +} \ No newline at end of file diff --git a/appsrc/service/hardware/sensor_state_sync_service.hpp b/appsrc/service/hardware/sensor_state_sync_service.hpp new file mode 100644 index 0000000..82ff0ec --- /dev/null +++ b/appsrc/service/hardware/sensor_state_sync_service.hpp @@ -0,0 +1,79 @@ +#pragma once +#include +#include +#include +#include +#include +#include +#include +#include +#include +// +#include "baseservice/baseservice.hpp" +#include "device_io_ctrl_service.hpp" +// +#include "base/can_packet_dumper.hpp" +#include "base/h2o2_sensor_data_mgr.hpp" +// +#include "appcomponents/algo/moving_average_filter.hpp" + +/** + * @brief + * + * service: SensorStateSyncService + * + * 监听事件: + * 依赖状态: + * 依赖服务: + * 作用: + * + */ + +namespace iflytop { +using namespace std; +using namespace core; + +class SensorStateSyncService : public enable_shared_from_this { + THISCLASS(SensorStateSyncService); + + unique_ptr updateThread; + shared_ptr deviceIoControlService; +shared_ptr h2o2SensorDataMgr; + + float m_airCompressorCurrent = 0; + float m_blowerCurrent = 0; + float m_heaterCurrent = 0; + float m_heaterTemperature = 0; + + recursive_mutex m_mutex; + bool triggerError = false; + + public: + void initialize(); + void startSync(); + + float getAirCompressorCurrent() { + lock_guard lock(m_mutex); + return m_airCompressorCurrent; + } + + float getBlowerCurrent() { + lock_guard lock(m_mutex); + return m_blowerCurrent; + } + + float getHeaterCurrent() { + lock_guard lock(m_mutex); + return m_heaterCurrent; + } + + float getHeaterTemperature() { + lock_guard lock(m_mutex); + return m_heaterTemperature; + } + + public: + void updateThreadLoop(); +}; + +}; // namespace iflytop diff --git a/appsrc/service/hardware/warning_light_controler.cpp b/appsrc/service/hardware/warning_light_controler.cpp index bdc30d7..89ba041 100644 --- a/appsrc/service/hardware/warning_light_controler.cpp +++ b/appsrc/service/hardware/warning_light_controler.cpp @@ -50,7 +50,7 @@ void WarningLightControler::initialize() { } void WarningLightControler::beepCtrl(lightState_t state) { - if (PORT.isDT600B() || PORT.isLageSpaceDM() || PORT.isDT300N() || PORT.isDT300W()) { + if (PORT.isDT600B() || PORT.isDT600N() || PORT.isDT300N() || PORT.isDT300W()) { switch (state) { case kstate_warning: m_beepState = !m_beepState; @@ -64,7 +64,7 @@ void WarningLightControler::beepCtrl(lightState_t state) { void WarningLightControler::changeLightState(lightState_t state) { m_nowState = state; - if (PORT.isDT600B() || PORT.isLageSpaceDM() || PORT.isDT300N() || PORT.isDT300W()) { + if (PORT.isDT600B() || PORT.isDT600N() || PORT.isDT300N() || PORT.isDT300W()) { switch (m_nowState) { case kstate_idle: // 绿色 diff --git a/appsrc/service/test_page_ctrl_service.cpp b/appsrc/service/test_page_ctrl_service.cpp new file mode 100644 index 0000000..7c37e0a --- /dev/null +++ b/appsrc/service/test_page_ctrl_service.cpp @@ -0,0 +1,114 @@ +#include "test_page_ctrl_service.hpp" + +#include "appdep/components/ziconv.hpp" +using namespace iflytop; +using namespace testpage; + +/** + * @brief + * + * + * WARNING: 这个页面接口的接口已经废弃,仅为了兼容老版本,接口不会再更新 + * Date: 2024-12-05 + * + */ + +void TestPageCtrlService::initialize() { + REG_EXTFN(sprayPumpDoForward, void(int32_t), gpm); + REG_EXTFN(sprayPumpDoBackward, void(int32_t), gpm); + REG_EXTFN_VOID(sprayPumpDoStop, void()); + REG_EXTFN_VOID(liquidFillingPumpDoLiquidFilling, void()); + REG_EXTFN_VOID(liquidFillingPumpDoLiquidDischarge, void()); + REG_EXTFN_VOID(liquidFillingPumpDoStop, void()); + REG_EXTFN_VOID(airCompressorDoOpen, void()); + REG_EXTFN_VOID(airCompressorDoClose, void()); + REG_EXTFN_VOID(blowerDoOpen, void()); + REG_EXTFN_VOID(blowerDoClose, void()); + REG_EXTFN_VOID(heatingDoOpen, void()); + REG_EXTFN_VOID(heatingDoClose, void()); + REG_EXTFN_VOID(printerDoTest, void()); + REG_EXTFN(airLeakDetectTestModeDoSetMode, void(string mode), mode); + REG_FN_VOID(readState, void()); + + m_thread.reset(new Thread("TestPageCtrlServiceReportThread", [this]() { + while (!ThisThread().getExitFlag()) { + ThisThread().sleepForMs(1000); + SEND_CLASS_REPORT(thisClass.className, "readState", readState()); + } + })); +} + +void TestPageCtrlService::sprayPumpDoForward(shared_ptr cxt, int32_t gpm) { + logger->info("sprayPumpDoForward gpm: {}", gpm); + deviceIoControlService->SprayPump_start(gpm); +} +void TestPageCtrlService::sprayPumpDoBackward(shared_ptr cxt, int32_t gpm) { + logger->info("sprayPumpDoBackward gpm: {}", gpm); + deviceIoControlService->SprayPump_start(-gpm); +} +void TestPageCtrlService::sprayPumpDoStop(shared_ptr cxt) { + logger->info("sprayPumpDoStop"); + deviceIoControlService->SprayPump_stop(); +} + +void TestPageCtrlService::liquidFillingPumpDoLiquidFilling(shared_ptr cxt) { + deviceIoControlService->setAddFluidChannelSelectorValve(true); + deviceIoControlService->AddLiquidPump_stop(); + usleep(500 * 1000); + deviceIoControlService->AddLiquidPump_addLiquid(); +} +void TestPageCtrlService::liquidFillingPumpDoLiquidDischarge(shared_ptr cxt) { + deviceIoControlService->setAddFluidChannelSelectorValve(true); + deviceIoControlService->AddLiquidPump_stop(); + usleep(500 * 1000); + deviceIoControlService->AddLiquidPump_drainLiquid(); +} +void TestPageCtrlService::liquidFillingPumpDoStop(shared_ptr cxt) { + deviceIoControlService->AddLiquidPump_stop(); + usleep(1500 * 1000); + deviceIoControlService->setAddFluidChannelSelectorValve(false); +} + +void TestPageCtrlService::airCompressorDoOpen(shared_ptr cxt) { deviceIoControlService->AC_ctrl(1); } +void TestPageCtrlService::airCompressorDoClose(shared_ptr cxt) { deviceIoControlService->AC_ctrl(0); } + +void TestPageCtrlService::blowerDoOpen(shared_ptr cxt) { deviceIoControlService->Blower_ctrl(90); } +void TestPageCtrlService::blowerDoClose(shared_ptr cxt) { deviceIoControlService->Blower_close(); } + +void TestPageCtrlService::heatingDoOpen(shared_ptr cxt) { deviceIoControlService->Heater_ctrl(1); } +void TestPageCtrlService::heatingDoClose(shared_ptr cxt) { deviceIoControlService->Heater_ctrl(0); } + +void TestPageCtrlService::printerDoTest(shared_ptr cxt) { + GET_SERVICE(UartPrinter)->print("abcdefghijklmn\n"); + usleep(100 * 1000); + GET_SERVICE(UartPrinter)->print("opqrstuvwxyz\n"); + usleep(100 * 1000); + GET_SERVICE(UartPrinter)->print("1234567890\n"); + usleep(100 * 1000); + GET_SERVICE(UartPrinter)->print(ZIconv::utf8_to_gb2312("打印机中文测试\n")); + usleep(100 * 1000); + GET_SERVICE(UartPrinter)->print("\n"); + GET_SERVICE(UartPrinter)->print("\n"); + GET_SERVICE(UartPrinter)->print("\n"); + GET_SERVICE(UartPrinter)->print("\n"); +} +void TestPageCtrlService::airLeakDetectTestModeDoSetMode(shared_ptr cxt, string mode) { + logger->info("airLeakDetectTestModeDoSetMode mode: {}", mode); + + if (mode == "disinfection") { // 消毒模式 + deviceIoControlService->AirLeakDetectTestModeCtrl_setMode({kAirLeakTestMode_disinfection}); + } else if (mode == "inflation") { // 充气模式 + deviceIoControlService->AirLeakDetectTestModeCtrl_setMode({kAirLeakTestMode_inflation}); + } else if (mode == "leakTest") { // 漏气检测模式 + deviceIoControlService->AirLeakDetectTestModeCtrl_setMode({kAirLeakTestMode_leakTest}); + } +} + +json TestPageCtrlService::readState() { + json state; + state["airCompressorCurrent"] = sensorStateSyncService->getAirCompressorCurrent(); + state["blowerCurrent"] = sensorStateSyncService->getBlowerCurrent(); + state["heaterCurrent"] = sensorStateSyncService->getHeaterCurrent(); + state["heaterTemperature"] = sensorStateSyncService->getHeaterTemperature(); + return state; +} diff --git a/appsrc/service/test_page_ctrl_service.hpp b/appsrc/service/test_page_ctrl_service.hpp new file mode 100644 index 0000000..f4e2c36 --- /dev/null +++ b/appsrc/service/test_page_ctrl_service.hpp @@ -0,0 +1,67 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +// +#include "appbase/appbean/test_page_iterm.hpp" +#include "baseservice/baseservice.hpp" +#include "service/hardware/device_io_ctrl_service.hpp" +#include "service/hardware/sensor_state_sync_service.hpp" +#include "testpage/test_page_processer.hpp" +namespace iflytop { +using namespace testpage; + +/** + * @brief + * + * + * WARNING: 这个页面接口的接口已经废弃,仅为了兼容老版本,接口不会再更新 + * Date: 2024-12-05 + * + */ + +class TestPageCtrlService : public enable_shared_from_this { + THISCLASS(TestPageCtrlService); + + SERVICE(SensorStateSyncService, sensorStateSyncService); + SERVICE(DeviceStateService, deviceStateService); + SERVICE(DeviceIoControlService, deviceIoControlService); + + unique_ptr m_thread; + + public: + void initialize(); + + private: + void sprayPumpDoForward(shared_ptr cxt, int32_t gpm); + void sprayPumpDoBackward(shared_ptr cxt, int32_t gpm); + void sprayPumpDoStop(shared_ptr cxt); + + void liquidFillingPumpDoLiquidFilling(shared_ptr cxt); + void liquidFillingPumpDoLiquidDischarge(shared_ptr cxt); + void liquidFillingPumpDoStop(shared_ptr cxt); + + void airCompressorDoOpen(shared_ptr cxt); + void airCompressorDoClose(shared_ptr cxt); + + void blowerDoOpen(shared_ptr cxt); + void blowerDoClose(shared_ptr cxt); + + void heatingDoOpen(shared_ptr cxt); + void heatingDoClose(shared_ptr cxt); + + void printerDoTest(shared_ptr cxt); + void airLeakDetectTestModeDoSetMode(shared_ptr cxt, string mode); + + private: + json readState(); +}; + +} // namespace iflytop diff --git a/appsrc/service/test_page_mgr_service.cpp b/appsrc/service/test_page_mgr_service.cpp deleted file mode 100644 index a307513..0000000 --- a/appsrc/service/test_page_mgr_service.cpp +++ /dev/null @@ -1,267 +0,0 @@ -#include "test_page_mgr_service.hpp" - -#include "appdep/components/ziconv.hpp" -using namespace iflytop; -using namespace testpage; - -/** - * @brief - * - * - * WARNING: 这个页面接口的接口已经废弃,仅为了兼容老版本,接口不会再更新 - * Date: 2024-12-05 - * - */ - -void TestPageMgrService::getTestPageCfgInfo(shared_ptr cxt) { cxt->rely["items"] = m_testPageItemMgr.getPageCfgInfo(); } -void TestPageMgrService::onButton(shared_ptr cxt, string groupName, string buttonName, json params) { m_testPageItemMgr.processOnButton(groupName, buttonName, params); } -void TestPageMgrService::readState(shared_ptr cxt) { cxt->rely = m_testPageItemMgr.readState(); } -void TestPageMgrService::startReportState(shared_ptr cxt) { m_testPageItemMgr.startReportState(1000); } -void TestPageMgrService::stopReportState(shared_ptr cxt) { m_testPageItemMgr.stopReportState(); } -int TestPageMgrService::PrinterTest_test() { - GET_SERVICE(UartPrinter)->print("abcdefghijklmn\n"); - usleep(100 * 1000); - GET_SERVICE(UartPrinter)->print("opqrstuvwxyz\n"); - usleep(100 * 1000); - GET_SERVICE(UartPrinter)->print("1234567890\n"); - usleep(100 * 1000); - GET_SERVICE(UartPrinter)->print(ZIconv::utf8_to_gb2312("打印机中文测试\n")); - usleep(100 * 1000); - GET_SERVICE(UartPrinter)->print("\n"); - GET_SERVICE(UartPrinter)->print("\n"); - GET_SERVICE(UartPrinter)->print("\n"); - GET_SERVICE(UartPrinter)->print("\n"); - return 0; -} - -void TestPageMgrService::initialize() { - GET_TO_SERVICE(m_ds); - GET_TO_SERVICE(dcs); - - REG_EXTFN_VOID(getTestPageCfgInfo, void()); - REG_EXTFN(onButton, void(string, string, json), goupName, buttonName, params); - REG_EXTFN_VOID(readState, void()); - REG_EXTFN_VOID(startReportState, void()); - REG_EXTFN_VOID(stopReportState, void()); - - REG_FN_VOID(PrinterTest_test, void()); - - auto SprayPumpCtrl = m_testPageItemMgr.createButtons({"SprayPumpCtrl", "喷液泵控制"}, // 模组名 - { - // 参数 - {{"pumpVel", "速度"}, "g/min", {{"5"}, {"10"}, {"15"}}}, // - }, - { - // 按键 - {"forward", "正转"}, - {"backward", "反转"}, - {"stop", "停止"}, - }, - [this](string buttonName, vector param) { // - logger->info("SprayPumpCtrl on button.{} ({})", buttonName, param[0]); - if (buttonName == "forward") { - dcs->SprayPump_start(atoi(param[0].c_str())); - } else if (buttonName == "backward") { - dcs->SprayPump_start(-atoi(param[0].c_str())); - } else if (buttonName == "stop") { - dcs->SprayPump_stop(); - } - }); - auto AddDischargePumpCtrl = m_testPageItemMgr.createButtons({"AddDischargePumpCtrl", "加液泵控制"}, // 模组名 - { - // 参数 - }, - { - // 按键 - {"addingLiquid", "加液"}, - {"drainLiquid", "排液"}, - {"stop", "停止"}, - }, - [this](string buttonName, vector param) { // - logger->info("on AddDischargePumpCtrl.{}", buttonName); - if (buttonName == "addingLiquid") { - dcs->setAddFluidChannelSelectorValve(true); - dcs->AddLiquidPump_stop(); - usleep(500 * 1000); - dcs->AddLiquidPump_addLiquid(); - } else if (buttonName == "drainLiquid") { - dcs->setAddFluidChannelSelectorValve(true); - dcs->AddLiquidPump_stop(); - usleep(500 * 1000); - dcs->AddLiquidPump_drainLiquid(); - } else { - dcs->AddLiquidPump_stop(); - usleep(1500 * 1000); - dcs->setAddFluidChannelSelectorValve(false); - } - }); - - auto AirCompressorCtrl = m_testPageItemMgr.createButtons({"AirCompressorCtrl", "空压机控制"}, // 模组名 - { - // 参数 - }, - { - // 按键 - {"on", "打开"}, - {"off", "关闭"}, - }, - [this](string buttonName, vector param) { // - logger->info("on AirCompressorCtrl.{}", buttonName); - if (buttonName == "on") { - dcs->AC_ctrl(1); - } else if (buttonName == "off") { - dcs->AC_close(); - } - }); - - auto ACState = m_testPageItemMgr.createStates({"ACState", "空压机状态"}, {{"current", "电流"}}, [this](string stateName) { // - return fmt::format("{:.2f}A", dcs->AC_readEI()); - }); - - auto BlowerCtrl = m_testPageItemMgr.createButtons({"BlowerCtrl", "风机控制"}, // 模组名 - { - // 参数 - }, - { - // 按键 - {"on", "打开"}, - {"off", "关闭"}, - }, - [this](string buttonName, vector param) { // - logger->info("on BlowerCtrl.{}", buttonName); - if (buttonName == "on") { - dcs->Blower_ctrl(90); - } else if (buttonName == "off") { - dcs->Blower_close(); - } - }); - - auto Blower = m_testPageItemMgr.createStates({"Blower", "风机状态"}, {{"current", "电流"}}, [this](string stateName) { // - return fmt::format("{:.2f}A", dcs->Blower_readEI()); - }); - - auto HeatingCtrl = m_testPageItemMgr.createButtons({"HeatingCtrl", "加热片控制"}, // 模组名 - { - // 参数 - }, - { - // 按键 - {"on", "打开"}, - {"off", "关闭"}, - }, - [this](string buttonName, vector param) { // - logger->info("on HeatingCtrl.{}", buttonName); - if (buttonName == "on") { - dcs->Heater_ctrl(1); - } else if (buttonName == "off") { - dcs->Heater_close(); - } - }); - - auto HeatingState = m_testPageItemMgr.createStates({"HeatingState", "加热片状态"}, {{"temperature", "温度"}, {"current", "电流"}}, [this](string stateName) { // - if (stateName == "temperature") { - return fmt::format("{:.2f}℃", dcs->Heater_readTemperature()); - } else if (stateName == "current") { - return fmt::format("{:.2f}A", dcs->Heater_readEI()); - } - return string("error"); - }); - - // 9 - - auto PrinterTest = m_testPageItemMgr.createButtons({"PrinterTest", "打印机测试"}, // 模组名 - { - // 参数 - }, - { - // 按键 - {"test", "测试"}, - }, - [this](string buttonName, vector param) { PrinterTest_test(); }); - - // 10 - - /******************************************************************************* - * 正负压力控制 * - *******************************************************************************/ - - auto AirLeakDetectTestModeCtrl = m_testPageItemMgr.createButtons({"AirLeakDetectTestModeCtrl", "气密性检测通道控制"}, // 模组名 - { - // 参数 - }, - { - // 按键 - {"disinfection", "正常模式"}, - {"inflation", "充气模式"}, - {"leakTest", "漏气检测模式"}, - }, - [this](string buttonName, vector param) { // - logger->info("AirLeakDetectTestModeCtrl buttonName:{} param:{}", buttonName, param); - if (buttonName == "disinfection") { - dcs->AirLeakDetectTestModeCtrl_setMode({kAirLeakTestMode_disinfection}); - } else if (buttonName == "inflation") { - dcs->AirLeakDetectTestModeCtrl_setMode({kAirLeakTestMode_inflation}); - } else if (buttonName == "leakTest") { - dcs->AirLeakDetectTestModeCtrl_setMode({kAirLeakTestMode_leakTest}); - } - }); - - auto PosiPressurePropCtrl = m_testPageItemMgr.createButtons({"PosiPressurePropCtrl", "正压比例阀控制"}, // 模组名 - { - // 参数 - {{"pumpVel", "百分比"}, "%", {{"0"}, {"10"}, {"20"}, {"30"}, {"40"}, {"50"}, {"60"}, {"70"}, {"80"}, {"90"}, {"100"}}}, // - }, - { - // 按键 - {"set", "设置"}, - {"close", "关闭"}, - }, - [this](string buttonName, vector param) { // - logger->info("PosiPressurePropCtrl buttonName:{} params:{}", buttonName, param); - if (buttonName == "set") { - dcs->PosiPressureProp_setValve(atoi(param[0].c_str())); - } else if (buttonName == "close") { - dcs->PosiPressureProp_setValve(0); - } - }); - - auto NegaPressurePropCtrl = m_testPageItemMgr.createButtons({"NegaPressurePropCtrl", "负压比例阀控制"}, // 模组名 - { - // 参数 - {{"pumpVel", "百分比"}, "%", {{"0"}, {"10"}, {"20"}, {"30"}, {"40"}, {"50"}, {"60"}, {"70"}, {"80"}, {"90"}, {"100"}}}, // - }, - { - // 按键 - {"set", "设置"}, - {"close", "关闭"}, - }, - [this](string buttonName, vector param) { // - logger->info("NegaPressurePropCtrl buttonName:{} params:{}", buttonName, param); - if (buttonName == "set") { - dcs->NegaPressureProp_setValve(atoi(param[0].c_str())); - } else if (buttonName == "close") { - dcs->NegaPressureProp_setValve(0); - } - }); - - m_testPageItemMgr.insert(SprayPumpCtrl); // 1 - m_testPageItemMgr.insert(AddDischargePumpCtrl); // 2 - m_testPageItemMgr.insert(AirCompressorCtrl); // 3 - m_testPageItemMgr.insert(ACState); // 4 - m_testPageItemMgr.insert(BlowerCtrl); // 5 - m_testPageItemMgr.insert(Blower); // 6 - m_testPageItemMgr.insert(HeatingCtrl); // 7 - m_testPageItemMgr.insert(HeatingState); // 8 - m_testPageItemMgr.insert(PrinterTest); // 9 - m_testPageItemMgr.insert(make_shared()); // 10 - - if (PORT.isDT300W()) { - m_testPageItemMgr.insert(AirLeakDetectTestModeCtrl); // 11 - m_testPageItemMgr.insert(PosiPressurePropCtrl); // 12 - m_testPageItemMgr.insert(NegaPressurePropCtrl); // 13 - } - - m_testPageItemMgr.onState.connect([this](json state) { // - GET_SERVICE(IflytopFrontEndService)->sendClassReport(thisClass.className, "onState", state); - }); -} diff --git a/appsrc/service/test_page_mgr_service.hpp b/appsrc/service/test_page_mgr_service.hpp deleted file mode 100644 index d3e2bdd..0000000 --- a/appsrc/service/test_page_mgr_service.hpp +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -// -#include "appbase/appbean/test_page_iterm.hpp" -#include "baseservice/baseservice.hpp" -#include "service/hardware/device_io_ctrl_service.hpp" -#include "testpage/test_page_processer.hpp" -namespace iflytop { -using namespace testpage; - - -/** - * @brief - * - * - * WARNING: 这个页面接口的接口已经废弃,仅为了兼容老版本,接口不会再更新 - * Date: 2024-12-05 - * - */ - -class TestPageMgrService : public enable_shared_from_this { - THISCLASS(TestPageMgrService); - - shared_ptr m_ds; - shared_ptr dcs; - - unique_ptr m_thread; - - TestPageItemMgr m_testPageItemMgr; - - public: - void initialize(); - - private: - void getTestPageCfgInfo(shared_ptr cxt); - void onButton(shared_ptr cxt, string groupName, string buttonName, json params); - void readState(shared_ptr cxt); - void startReportState(shared_ptr cxt); - void stopReportState(shared_ptr cxt); - - - private: - int PrinterTest_test(); -}; - -} // namespace iflytop diff --git a/appsrc/service/test_page_service_v2.cpp b/appsrc/service/test_page_service_v2.cpp deleted file mode 100644 index 839c63b..0000000 --- a/appsrc/service/test_page_service_v2.cpp +++ /dev/null @@ -1,60 +0,0 @@ -#include "test_page_service_v2.hpp" - -#include "appdep/components/ziconv.hpp" -using namespace iflytop; -using namespace testpage; - -void TestPageServiceV2::initialize() { - GET_TO_SERVICE(m_ds); - GET_TO_SERVICE(dcs); - - // REG_EXTFN_VOID(getSetting, json(void)); // 单位g - // REG_EXTFN(setDeviceId, void(string)); - - REG_EXTFN(doSprayPumpFroward, void(int), gpm); - REG_EXTFN(doSprayPumpBackward, void(int), gpm); - REG_EXTFN_VOID(doSprayPumpStop, void(void)); - - REG_EXTFN_VOID(doAddLiquid, void(void)); - REG_EXTFN_VOID(doDrainLiquid, void(void)); - REG_EXTFN_VOID(doStopAddLiquid, void(void)); - - REG_EXTFN_VOID(doPrinterTest, void(void)); -} -void TestPageServiceV2::doSprayPumpFroward(shared_ptr cxt, int gpm) { dcs->SprayPump_start(gpm); } -void TestPageServiceV2::doSprayPumpBackward(shared_ptr cxt, int gpm) { dcs->SprayPump_start(-gpm); } -void TestPageServiceV2::doSprayPumpStop(shared_ptr cxt) { dcs->SprayPump_stop(); } - -void TestPageServiceV2::doAddLiquid(shared_ptr cxt) { - dcs->setAddFluidChannelSelectorValve(true); - dcs->AddLiquidPump_stop(); - usleep(500 * 1000); - dcs->AddLiquidPump_addLiquid(); -} -void TestPageServiceV2::doDrainLiquid(shared_ptr cxt) { - dcs->setAddFluidChannelSelectorValve(true); - dcs->AddLiquidPump_stop(); - usleep(500 * 1000); - dcs->AddLiquidPump_drainLiquid(); -} -void TestPageServiceV2::doStopAddLiquid(shared_ptr cxt) { - dcs->AddLiquidPump_stop(); - usleep(1500 * 1000); - dcs->setAddFluidChannelSelectorValve(false); -} - -int TestPageServiceV2::doPrinterTest(shared_ptr cxt) { - GET_SERVICE(UartPrinter)->print("abcdefghijklmn\n"); - usleep(100 * 1000); - GET_SERVICE(UartPrinter)->print("opqrstuvwxyz\n"); - usleep(100 * 1000); - GET_SERVICE(UartPrinter)->print("1234567890\n"); - usleep(100 * 1000); - GET_SERVICE(UartPrinter)->print(ZIconv::utf8_to_gb2312("打印机中文测试\n")); - usleep(100 * 1000); - GET_SERVICE(UartPrinter)->print("\n"); - GET_SERVICE(UartPrinter)->print("\n"); - GET_SERVICE(UartPrinter)->print("\n"); - GET_SERVICE(UartPrinter)->print("\n"); - return 0; -} diff --git a/appsrc/service/test_page_service_v2.hpp b/appsrc/service/test_page_service_v2.hpp deleted file mode 100644 index 8149161..0000000 --- a/appsrc/service/test_page_service_v2.hpp +++ /dev/null @@ -1,54 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include -#include -// -#include "appbase/appbean/test_page_iterm.hpp" -#include "baseservice/baseservice.hpp" -#include "service/hardware/device_io_ctrl_service.hpp" -#include "testpage/test_page_processer.hpp" -namespace iflytop { -using namespace testpage; - -/** - * @brief - * - * - * WARNING: 这个页面接口的接口已经废弃,仅为了兼容老版本,接口不会再更新 - * Date: 2024-12-05 - * - */ - -class TestPageServiceV2 : public enable_shared_from_this { - THISCLASS(TestPageServiceV2); - - shared_ptr m_ds; - shared_ptr dcs; - - unique_ptr m_thread; - - TestPageItemMgr m_testPageItemMgr; - - public: - void initialize(); - - private: - int doPrinterTest(shared_ptr cxt); - - void doSprayPumpFroward(shared_ptr cxt, int gpm); - void doSprayPumpBackward(shared_ptr cxt, int gpm); - void doSprayPumpStop(shared_ptr cxt); - - void doAddLiquid(shared_ptr cxt); - void doDrainLiquid(shared_ptr cxt); - void doStopAddLiquid(shared_ptr cxt); -}; - -} // namespace iflytop