diff --git a/src/api/cmds/device_state_cmd_impl.cpp b/src/api/cmds/device_state_cmd_impl.cpp index 7f12054..8d1be75 100644 --- a/src/api/cmds/device_state_cmd_impl.cpp +++ b/src/api/cmds/device_state_cmd_impl.cpp @@ -67,9 +67,9 @@ json DeviceStateCmdImpl::createSensorDataJson() { #endif #if (defined PROJECT_TYPE_DRAW_BAR_BOX) - report["draw_bar_box_disinfection"]["pressure"][0] = m_deviceIoControlService->DBDB__readPressureSensor(1); // 液位 - report["draw_bar_box_disinfection"]["pressure"][1] = m_deviceIoControlService->DBDB__readPressureSensor(2); // 空压机压力 - report["draw_bar_box_disinfection"]["pressure"][2] = m_deviceIoControlService->DBDB__readPressureSensor(3); // 空压机压力 + report["draw_bar_box_disinfection"]["pressure"][0] = m_deviceIoControlService->DBDB__readPressureSensor(1); + report["draw_bar_box_disinfection"]["pressure"][1] = m_deviceIoControlService->DBDB__readPressureSensor(2); + report["draw_bar_box_disinfection"]["pressure"][2] = m_deviceIoControlService->DBDB__readPressureSensor(3); report["draw_bar_box_disinfection"]["heatingStrip"]["current"] = m_deviceIoControlService->DBDB__heaterReadElectricCurrent(); // 电流 report["draw_bar_box_disinfection"]["heatingStrip"]["temperature"] = m_deviceIoControlService->DBDB__heaterReadTemperatureData(); // 温度 #endif diff --git a/src/configs/project_setting.hpp b/src/configs/project_setting.hpp index 869fad3..f79d8d2 100644 --- a/src/configs/project_setting.hpp +++ b/src/configs/project_setting.hpp @@ -13,7 +13,7 @@ // #define PROJECT_TYPE_LARGE_SPACE_DISINFECTION 1 // 大空间 // #define PROJECT_TYPE_SMALL_SPACE_DISINFECTION 1 // 小空间 -#define PROJECT_TYPE_PIPE_DISINFECTION 1 // 管道消毒机 +// #define PROJECT_TYPE_PIPE_DISINFECTION 1 // 管道消毒机 // #define PROJECT_TYPE_DRAW_BAR_BOX 1 // 拉感箱 #endif // #if (defined PROJECT_TYPE_LARGE_SPACE_DISINFECTION) || (defined PROJECT_TYPE_SMALL_SPACE_DISINFECTION) || (defined PROJECT_TYPE_PIPE_DISINFECTION) @@ -25,6 +25,9 @@ #define MIN_DISINFECTANT_VOLUME 500 #define DEVICE_IP "192.168.8.10" #define EMTPTY_LINE_WHEN_ADDING_DISINFECTANT_TIMES 80 +#define SPRAY_LIQUID_PUMP_MIRROR 0 +#define GPM_TO_SPEED(gpm) (gpm * 14.7) +#define SPEED_TO_GPM(speed) ((speed / 14.7) + 0.5) #endif #ifdef PROJECT_TYPE_SMALL_SPACE_DISINFECTION @@ -34,6 +37,9 @@ #define MIN_DISINFECTANT_VOLUME 500 #define DEVICE_IP "192.168.8.11" #define EMTPTY_LINE_WHEN_ADDING_DISINFECTANT_TIMES 80 +#define SPRAY_LIQUID_PUMP_MIRROR 0 +#define GPM_TO_SPEED(gpm) (gpm * 14.7) +#define SPEED_TO_GPM(speed) ((speed / 14.7) + 0.5) #endif #ifdef PROJECT_TYPE_PIPE_DISINFECTION @@ -43,6 +49,9 @@ #define MIN_DISINFECTANT_VOLUME 500 #define DEVICE_IP "192.168.8.12" #define EMTPTY_LINE_WHEN_ADDING_DISINFECTANT_TIMES 80 +#define SPRAY_LIQUID_PUMP_MIRROR 0 +#define GPM_TO_SPEED(gpm) (gpm * 14.7) +#define SPEED_TO_GPM(speed) ((speed / 14.7) + 0.5) #endif #ifdef PROJECT_TYPE_DRAW_BAR_BOX @@ -52,6 +61,9 @@ #define MIN_DISINFECTANT_VOLUME 0 #define DEVICE_IP "192.168.8.13" #define EMTPTY_LINE_WHEN_ADDING_DISINFECTANT_TIMES 80 +#define SPRAY_LIQUID_PUMP_MIRROR 1 +#define GPM_TO_SPEED(gpm) (gpm * 41.97) +#define SPEED_TO_GPM(speed) ((speed / 41.97) + 0.5) #endif #define SPRAYLIQUID_PUMP_MAX_GPM 40 diff --git a/src/db/db_service.cpp b/src/db/db_service.cpp index 950e43a..02f16a1 100644 --- a/src/db/db_service.cpp +++ b/src/db/db_service.cpp @@ -91,6 +91,8 @@ static Setting config_settings_table[] = { SETTING_ITEM(8, "pre_heat_time_s", /*******/ "预热时间", /*******************/ 0, 1200, 120), // SETTING_ITEM(9, "stoped_humi", /***********/ "消毒停止相对湿度", /************/ 0, 100, 85), // SETTING_ITEM(10, "continued_humi", /*******/ "消毒继续相对湿度", /************/ 0, 100, 60), // + SETTING_ITEM(11, "proportional_valve_default_value", "正负压默认开合比例", 0, 100, 10), // + }; #define ZARRARY_SIZE(val) (sizeof(val) / sizeof(val[0])) diff --git a/src/service/device_io_control_service.cpp b/src/service/device_io_control_service.cpp index eac6ae9..6b38a12 100644 --- a/src/service/device_io_control_service.cpp +++ b/src/service/device_io_control_service.cpp @@ -12,8 +12,6 @@ using namespace iflytop; using namespace std; -#define GPM_TO_SPEED(gpm) (gpm * 14.7) -#define SPEED_TO_GPM(speed) ((speed / 14.7) + 0.5) static inline int filter(int data) { static list q; @@ -363,6 +361,10 @@ void DeviceIoControlService::sprayLiquidPump_open(int gpm) { } else if (speed < -450) { speed = -450; } +#if SPRAY_LIQUID_PUMP_MIRROR + speed = -speed; +#endif + logger->info("sprayLiquidPump_open speed:{}", speed); m_zcanHost->pumpctrl_c1004(2, 100, speed, 1, 18); } @@ -381,6 +383,10 @@ void DeviceIoControlService::sprayLiquidPump_open_for_test(int gpm) { speed = -450; } SprayLiquidPump__gpm = gpm; +#if SPRAY_LIQUID_PUMP_MIRROR + speed = -speed; +#endif + logger->info("sprayLiquidPump_open speed:{}", speed); m_zcanHost->pumpctrl_c1004(2, 100, speed, 1, 15); } void DeviceIoControlService::sprayLiquidPump_close_for_test() {