diff --git a/protocol.md b/protocol.md index 6f3bf42..5d73708 100644 --- a/protocol.md +++ b/protocol.md @@ -146,4 +146,110 @@ ws://192.168.8.10:19001 ] } } +``` + + +```json +// 消毒机拉杆箱 +{ + "command": "RealtimeSensorDataReport", + "sensor_data": { + "draw_bar_box_disinfection": { + "heatingStrip": { + "current": 0, + "temperature": 0 + }, + "pressure": [ + 0, + 0 + ] + }, + "h2o2_1": 0, + "h2o2_2": -1, + "h2o2_3": -1, + "h2o2_sensor_state_1": true, + "h2o2_sensor_state_2": false, + "h2o2_sensor_state_3": false, + "humid_1": 34, + "humid_2": -1, + "humid_3": -1, + "saturation_1": 32, + "saturation_2": 0, + "saturation_3": 0, + "temp_1": 30, + "temp_2": -1, + "temp_3": -1 + }, + "timeStamp": 1716281819391 +} + + +{ + "ackcode": 0, + "disinfectionConfig": { + "continued_gs": 0, + "continued_humi": 0, + "continued_satur": 0, + "injection_pump_speed": -441009434, + "loglevel": 0, + "stoped_gs": 0, + "stoped_humi": 0, + "stoped_satur": 0 + }, + "messageId": null, + "state": { + "disinfectionState": { + "dvalue": 0.0, + "estimatedRemainingTimeS": 0, + "id": "", + "nowlog": 0.0, + "preHeat": false, + "preHeatRaminTimeS": 0, + "targetlog": 0, + "workState": 5 + }, + "disinfectionWorkState": 5, + "disinfection_id": "", + "estimatedRemainingTimeS": 0, + "isLogin": false, + "loginuser": "", + "permissionLevel": 11, + "preHeat": false, + "preHeatRaminTimeS": 0, + "sensor_data": { + "draw_bar_box_disinfection": { + "heatingStrip": { + "current": 0, + "temperature": 0 + }, + "pressure": [ + 0, + 0 + ] + }, + "h2o2_1": 0, + "h2o2_2": -1, + "h2o2_3": -1, + "h2o2_sensor_state_1": true, + "h2o2_sensor_state_2": false, + "h2o2_sensor_state_3": false, + "humid_1": 35, + "humid_2": -1, + "humid_3": -1, + "saturation_1": 33, + "saturation_2": 0, + "saturation_3": 0, + "temp_1": 30, + "temp_2": -1, + "temp_3": -1 + } + }, + "subboardstate": { + "extChannelCtrlBoard": { + "online": 0 + } + }, + "timeStamp": 1716281920885 +} + ``` \ No newline at end of file diff --git a/src/api/cmds/device_state_cmd_impl.cpp b/src/api/cmds/device_state_cmd_impl.cpp index cff23fe..ef4e98c 100644 --- a/src/api/cmds/device_state_cmd_impl.cpp +++ b/src/api/cmds/device_state_cmd_impl.cpp @@ -48,7 +48,7 @@ json DeviceStateCmdImpl::createSensorDataJson() { report["humid_3"] = m_deviceIoControlService->H2O2Sensor_readHumid(2); report["saturation_3"] = m_deviceIoControlService->H2O2Sensor_readSaturation(2) + 1; //+1是为让曲线不重合 -#ifdef PROJECT_TYPE_PIPE_DISINFECTION +#if (defined PROJECT_TYPE_PIPE_DISINFECTION) report["AirInletProportionalValve"]["state"] = m_deviceIoControlService->AirInletProportionalValve_getState(); report["AirOutletProportionalValve"]["state"] = m_deviceIoControlService->AirOutletProportionalValve_getState(); @@ -60,6 +60,16 @@ json DeviceStateCmdImpl::createSensorDataJson() { report["pressure"][1] = m_deviceIoControlService->getPressureSensorData(2); // 空压机压力 report["pressure"][2] = m_deviceIoControlService->getPressureSensorData(3); // 加液泵 report["pressure"][3] = m_deviceIoControlService->getPressureSensorData(4); // 喷射泵 +#elif (defined PROJECT_TYPE_DRAW_BAR_BOX) + +#else +#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"]["heatingStrip"]["current"] = m_deviceIoControlService->DBDB__heaterReadElectricCurrent(); // 电流 + report["draw_bar_box_disinfection"]["heatingStrip"]["temperature"] = m_deviceIoControlService->DBDB__heaterReadTemperatureData(); // 温度 #endif return report; diff --git a/src/configs/project_setting.hpp b/src/configs/project_setting.hpp index 4b9b97a..a6261cd 100644 --- a/src/configs/project_setting.hpp +++ b/src/configs/project_setting.hpp @@ -9,10 +9,16 @@ #define REG_DEVICE_ID 0x0001 // 重启标识 #define REG_EXCEPTION_FLAG 0x0100 // 异常标志位 +#if (!defined PROJECT_TYPE_LARGE_SPACE_DISINFECTION) && \ +(!defined PROJECT_TYPE_SMALL_SPACE_DISINFECTION) && \ +(!defined PROJECT_TYPE_PIPE_DISINFECTION) && \ +(!defined PROJECT_TYPE_DRAW_BAR_BOX) + // #define PROJECT_TYPE_LARGE_SPACE_DISINFECTION 1 // 大空间 // #define PROJECT_TYPE_SMALL_SPACE_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) diff --git a/src/main_control_service.cpp b/src/main_control_service.cpp index cbb9186..04872bd 100644 --- a/src/main_control_service.cpp +++ b/src/main_control_service.cpp @@ -64,8 +64,16 @@ void MainControlService::initialize() { BUILD_AND_REG_SERRVICE(IflytopFrontEndService); GET_SERVICE(IflytopFrontEndService)->initialize("0.0.0.0"); GET_SERVICE(IflytopFrontEndService)->onMessage.connect([this](weak_ptr webSocket, json& cmd, json& receipt) { - string cmdstr = cmd["command"]; - if (cmdstr != "getState") logger->info("rx:{}", cmd.dump()); + string cmdstr = cmd["command"]; + bool disabledump = false; + if (cmdstr == "getState") disabledump = true; + if (cmdstr == "DBDBTestPage__heaterCtrlSafeValve") disabledump = true; + if (cmdstr == "DBDBTestPage__heaterReadElectricCurrent") disabledump = true; + if (cmdstr == "DBDBTestPage__readPressureSensor") disabledump = true; + + + if (!disabledump) logger->info("rx:{}", cmd.dump()); + m_frontMsgProcesser->processMsg(cmd, receipt); }); diff --git a/src/version.hpp b/src/version.hpp index cbc9a93..18d1017 100644 --- a/src/version.hpp +++ b/src/version.hpp @@ -1,2 +1,2 @@ #pragma once -#define VERSION "2.0" \ No newline at end of file +#define VERSION "2.1" \ No newline at end of file