diff --git a/src/configs/project_setting.hpp b/src/configs/project_setting.hpp index e36a30c..4b9b97a 100644 --- a/src/configs/project_setting.hpp +++ b/src/configs/project_setting.hpp @@ -11,7 +11,10 @@ // #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 // 拉感箱 +// #if (defined PROJECT_TYPE_LARGE_SPACE_DISINFECTION) || (defined PROJECT_TYPE_SMALL_SPACE_DISINFECTION) || (defined PROJECT_TYPE_PIPE_DISINFECTION) + #ifdef PROJECT_TYPE_SMALL_SPACE_DISINFECTION #define DISINFECTANT_BUCKET_CAPACITY 2500 @@ -31,5 +34,12 @@ #define MAX_H2O2_SENSOR_NUM (1) #endif +#ifdef PROJECT_TYPE_DRAW_BAR_BOX +#define DISINFECTANT_BUCKET_CAPACITY 0 +#define PROJECT_NAME "draw_bar_box_disinfection" +#define MAX_H2O2_SENSOR_NUM (1) +#endif + + #define MAX_DISINFECTIONLOGGER_FILE_NUM 5 // 最大日志文件数量 #define USER_BEHAVIOR_RECORD_DB_MAX_RECORDS 3000 diff --git a/src/main.cpp b/src/main.cpp index 1a1b5c7..ae71e71 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -43,6 +43,7 @@ int Main::main(int argc, char *argv[]) { } else { g_in_test = true; } + g_in_test = true; logger->info("test_mode:{}:{}", test_mode, g_in_test); /** diff --git a/src/main_control_service.cpp b/src/main_control_service.cpp index 34332f1..3baa91d 100644 --- a/src/main_control_service.cpp +++ b/src/main_control_service.cpp @@ -104,15 +104,16 @@ void MainControlService::initialize() { GET_SERVICE(PipelineDisinfectionCmdAppend)->initialize(); #endif - m_deviceIoControlService->warningLightCtrl(0, 1, 0, 0); //绿色灯亮 - +#if (defined PROJECT_TYPE_LARGE_SPACE_DISINFECTION) || (defined PROJECT_TYPE_SMALL_SPACE_DISINFECTION) || (defined PROJECT_TYPE_PIPE_DISINFECTION) + m_deviceIoControlService->warningLightCtrl(0, 1, 0, 0); // 绿色灯亮 m_deviceIoControlService->airCompressor_setState(0); m_deviceIoControlService->airBlower_setState(0); + m_deviceIoControlService->heartingPlate_setPower(false); + m_deviceIoControlService->drainingPump_close(); + m_deviceIoControlService->sprayLiquidPump_close(); #ifdef PROJECT_TYPE_PIPE_DISINFECTION m_deviceIoControlService->AirInletProportionalValve_setState(0); m_deviceIoControlService->AirOutletProportionalValve_setState(0); #endif - m_deviceIoControlService->heartingPlate_setPower(false); - m_deviceIoControlService->drainingPump_close(); - m_deviceIoControlService->sprayLiquidPump_close(); +#endif }; diff --git a/src/service/device_io_control_service.cpp b/src/service/device_io_control_service.cpp index 443a2da..a0a801f 100644 --- a/src/service/device_io_control_service.cpp +++ b/src/service/device_io_control_service.cpp @@ -14,6 +14,33 @@ using namespace std; #define GPM_TO_SPEED(gpm) (gpm * 14.7) #define SPEED_TO_GPM(speed) (speed / 14.7) +static inline int filter(int data) { + static list q; + q.push_back(data); + + if (q.size() > 50) { + q.pop_front(); + } + // 中值滤波 + int datacache[51]; + int ndata = 0; + for (auto& var : q) { + datacache[ndata] = var; + ndata++; + } + + for (int i = 0; i < ndata; i++) { + for (int j = i + 1; j < ndata; j++) { + if (datacache[i] > datacache[j]) { + int temp = datacache[i]; + datacache[i] = datacache[j]; + datacache[j] = temp; + } + } + } + return datacache[ndata / 2]; +} + DeviceIoControlService::DeviceIoControlService() {} void DeviceIoControlService::initialize() { GET_TO_SERVICE(m_zcanHost); @@ -25,17 +52,9 @@ void DeviceIoControlService::initialize() { startScan(); } -void DeviceIoControlService::updateDisinfectantVolumeSample(float _pa) { - float pa = _pa - 100; // 100当容器中没有液体时的压强 - if (pa < 0) pa = 0; - - float g = m_volumeConvertor.pressurePa2VolumeG(_pa) * m_config->get_disinfectantWeightCorrectionFactor(); - m_disinfectantVolumeSample_g = m_DisinfectantWeightFilter.filter(g); - - // logger->info("{} pa {} g", _pa, m_disinfectantVolumeSample_g); -} - void DeviceIoControlService::startScan() { +#if (defined PROJECT_TYPE_LARGE_SPACE_DISINFECTION) || (defined PROJECT_TYPE_SMALL_SPACE_DISINFECTION) || (defined PROJECT_TYPE_PIPE_DISINFECTION) + m_PressureSensorDataSampleThread.reset(new Thread("PressureSensorDataSampleThread", [this]() { ThisThread thisThread; @@ -70,17 +89,13 @@ void DeviceIoControlService::startScan() { thisThread.sleepForMs(100); - // if (m_zcanHost->huacheng_pressure_sensor_read_c1005(5, sdata) == 0) { - // lock_guard lock(lock_); - // m_pressure_sensor_data[5] = sdata; - // } - // thisThread.sleepForMs(10); - - /** - * @brief 计算并更新过氧化清重量 - */ { // - updateDisinfectantVolumeSample(m_pressure_sensor_data[1].value / 1.0 /*pa*/); + _pa = m_pressure_sensor_data[1].value / 1.0 /*pa*/; + + float pa = _pa - 100; // 100当容器中没有液体时的压强 + if (pa < 0) pa = 0; + float g = m_volumeConvertor.pressurePa2VolumeG(_pa) * m_config->get_disinfectantWeightCorrectionFactor(); + m_disinfectantVolumeSample_g = m_DisinfectantWeightFilter.filter(g); } } })); @@ -147,8 +162,119 @@ void DeviceIoControlService::startScan() { } } })); +#endif +} +/******************************************************************************* + * SensorState * + *******************************************************************************/ + +void DeviceIoControlService::printerPrintf(string str) { GET_SERVICE(UartPrinter)->print(ZIconv::utf8_to_gb2312(str)); } + +void DeviceIoControlService::processReportPacket(uint8_t* packet, size_t len) { // + auto* cmdpacket = (transmit_disinfection_protocol_header_t*)packet; + + /** + * @brief 更新过氧化氢传感器数据 + */ + if (cmdpacket->cmdid == kreport_h2o2_sensor_data) { + report_h2o2_data_t* h2o2data = (report_h2o2_data_t*)cmdpacket->data; + report_h2o2_data_t h2o2datacache = *h2o2data; + + m_workQueue->enQueue([this, h2o2datacache]() { // + report_h2o2_data_t h2o2datac_cpy = h2o2datacache; + + if (h2o2datac_cpy.sensorid > 100 && h2o2datac_cpy.sensorid < 200) { + H2O2Sensor_updateSensorData(h2o2datac_cpy.sensorid - 100, &h2o2datac_cpy); + } else if (h2o2datac_cpy.sensorid < 100) { + H2O2Sensor_updateSensorData(0, &h2o2datac_cpy); + } else { + logger->error("[h2o2 sensor] id:{} error sensorid", h2o2datac_cpy.sensorid); + } + + }); + } +} + +/******************************************************************************* + * H2O2 * + *******************************************************************************/ + +int32_t DeviceIoControlService::H2O2Sensor_readH2O2PPM(int32_t sensorid) { + std::lock_guard lck(m_h2o2_sensor_data_lock_); + if (sensorid > MAX_H2O2_SENSOR_NUM) return -1; + + h2o2_sensor_data_t* data = &m_h2o2_sensor_data[sensorid]; + if (data->updatetime == 0) return -1; + + if (zsys_haspassedms(data->updatetime) > 10 * 1000) return -1; + + return data->h2o2; +} +int32_t DeviceIoControlService::H2O2Sensor_readHumid(int32_t sensorid) { + std::lock_guard lck(m_h2o2_sensor_data_lock_); + if (sensorid > MAX_H2O2_SENSOR_NUM) return -1; + + h2o2_sensor_data_t* data = &m_h2o2_sensor_data[sensorid]; + if (data->updatetime == 0) return -1; + + if (zsys_haspassedms(data->updatetime) > 10 * 1000) return -1; + + return data->humid; +} +int32_t DeviceIoControlService::H2O2Sensor_readTemperature(int32_t sensorid) { + std::lock_guard lck(m_h2o2_sensor_data_lock_); + if (sensorid > MAX_H2O2_SENSOR_NUM) return -1; + + h2o2_sensor_data_t* data = &m_h2o2_sensor_data[sensorid]; + if (data->updatetime == 0) return -1; + + if (zsys_haspassedms(data->updatetime) > 10 * 1000) return -1; + + return data->temp; +} +int32_t DeviceIoControlService::H2O2Sensor_readSaturation(int32_t sensorid) { + std::lock_guard lck(m_h2o2_sensor_data_lock_); + if (sensorid > MAX_H2O2_SENSOR_NUM) return -1; + + h2o2_sensor_data_t* data = &m_h2o2_sensor_data[sensorid]; + if (data->updatetime == 0) return -1; + + if (zsys_haspassedms(data->updatetime) > 10 * 1000) return -1; + + return data->saturation; +} + +void DeviceIoControlService::H2O2Sensor_updateSensorData(int32_t sensorid, report_h2o2_data_t* data) { + std::lock_guard lck(m_h2o2_sensor_data_lock_); + if (sensorid > MAX_H2O2_SENSOR_NUM) { + logger->warn("H2O2Sensor_updateSensorData fail,sensorid:{} is invalid", sensorid); + return; + } + + h2o2_sensor_data_t* sensor_data = &m_h2o2_sensor_data[sensorid]; + + /** + * @brief 系统启动至少5分钟后,才开始更新数据 + */ + if (zsteady_clock().gets() > 5 * 60) { + sensor_data->h2o2 = data->h2o2 / 10; + sensor_data->temp = data->temp / 10; + sensor_data->humid = data->humid / 10; + sensor_data->saturation = data->saturation / 10; + sensor_data->sensorId = data->sensorid; + sensor_data->updatetime = zsys_get_ticket(); + } else { + sensor_data->h2o2 = 0; + sensor_data->temp = data->temp / 10; + sensor_data->humid = 0; + sensor_data->saturation = 0; + sensor_data->sensorId = data->sensorid; + sensor_data->updatetime = zsys_get_ticket(); + } } +#if (defined PROJECT_TYPE_LARGE_SPACE_DISINFECTION) || (defined PROJECT_TYPE_SMALL_SPACE_DISINFECTION) || (defined PROJECT_TYPE_PIPE_DISINFECTION) + void DeviceIoControlService::airCompressor_setState(bool val) { logger->info("airCompressor_setState:{}", val); if (val) { @@ -282,36 +408,6 @@ int DeviceIoControlService::sprayLiquidPump_getState() { // return (sprayLiquidPump_getRPM() != 0); } -/******************************************************************************* - * SensorState * - *******************************************************************************/ - -static int filter(int data) { - static list q; - q.push_back(data); - - if (q.size() > 50) { - q.pop_front(); - } - // 中值滤波 - int datacache[51]; - int ndata = 0; - for (auto& var : q) { - datacache[ndata] = var; - ndata++; - } - - for (int i = 0; i < ndata; i++) { - for (int j = i + 1; j < ndata; j++) { - if (datacache[i] > datacache[j]) { - int temp = datacache[i]; - datacache[i] = datacache[j]; - datacache[j] = temp; - } - } - } - return datacache[ndata / 2]; -} int DeviceIoControlService::getDisinfectantVolume_g() { // kpa; @@ -339,107 +435,8 @@ void DeviceIoControlService::warningLightCtrl(int r, int g, int b, int w) { lock_guard lock(lock_); m_zcanHost->warning_light_ctrl_c1002(1, r, g, b, w); } +#endif -void DeviceIoControlService::printerPrintf(string str) { GET_SERVICE(UartPrinter)->print(ZIconv::utf8_to_gb2312(str)); } - -void DeviceIoControlService::processReportPacket(uint8_t* packet, size_t len) { // - auto* cmdpacket = (transmit_disinfection_protocol_header_t*)packet; - - /** - * @brief 更新过氧化氢传感器数据 - */ - if (cmdpacket->cmdid == kreport_h2o2_sensor_data) { - report_h2o2_data_t* h2o2data = (report_h2o2_data_t*)cmdpacket->data; - report_h2o2_data_t h2o2datacache = *h2o2data; - - m_workQueue->enQueue([this, h2o2datacache]() { // - report_h2o2_data_t h2o2datac_cpy = h2o2datacache; - - if (h2o2datac_cpy.sensorid > 100 && h2o2datac_cpy.sensorid < 200) { - H2O2Sensor_updateSensorData(h2o2datac_cpy.sensorid - 100, &h2o2datac_cpy); - } else if (h2o2datac_cpy.sensorid < 100) { - H2O2Sensor_updateSensorData(0, &h2o2datac_cpy); - } else { - logger->error("[h2o2 sensor] id:{} error sensorid", h2o2datac_cpy.sensorid); - } - - }); - } -} - -int32_t DeviceIoControlService::H2O2Sensor_readH2O2PPM(int32_t sensorid) { - std::lock_guard lck(m_h2o2_sensor_data_lock_); - if (sensorid > MAX_H2O2_SENSOR_NUM) return -1; - - h2o2_sensor_data_t* data = &m_h2o2_sensor_data[sensorid]; - if (data->updatetime == 0) return -1; - - if (zsys_haspassedms(data->updatetime) > 10 * 1000) return -1; - - return data->h2o2; -} -int32_t DeviceIoControlService::H2O2Sensor_readHumid(int32_t sensorid) { - std::lock_guard lck(m_h2o2_sensor_data_lock_); - if (sensorid > MAX_H2O2_SENSOR_NUM) return -1; - - h2o2_sensor_data_t* data = &m_h2o2_sensor_data[sensorid]; - if (data->updatetime == 0) return -1; - - if (zsys_haspassedms(data->updatetime) > 10 * 1000) return -1; - - return data->humid; -} -int32_t DeviceIoControlService::H2O2Sensor_readTemperature(int32_t sensorid) { - std::lock_guard lck(m_h2o2_sensor_data_lock_); - if (sensorid > MAX_H2O2_SENSOR_NUM) return -1; - - h2o2_sensor_data_t* data = &m_h2o2_sensor_data[sensorid]; - if (data->updatetime == 0) return -1; - - if (zsys_haspassedms(data->updatetime) > 10 * 1000) return -1; - - return data->temp; -} -int32_t DeviceIoControlService::H2O2Sensor_readSaturation(int32_t sensorid) { - std::lock_guard lck(m_h2o2_sensor_data_lock_); - if (sensorid > MAX_H2O2_SENSOR_NUM) return -1; - - h2o2_sensor_data_t* data = &m_h2o2_sensor_data[sensorid]; - if (data->updatetime == 0) return -1; - - if (zsys_haspassedms(data->updatetime) > 10 * 1000) return -1; - - return data->saturation; -} - -void DeviceIoControlService::H2O2Sensor_updateSensorData(int32_t sensorid, report_h2o2_data_t* data) { - std::lock_guard lck(m_h2o2_sensor_data_lock_); - if (sensorid > MAX_H2O2_SENSOR_NUM) { - logger->warn("H2O2Sensor_updateSensorData fail,sensorid:{} is invalid", sensorid); - return; - } - - h2o2_sensor_data_t* sensor_data = &m_h2o2_sensor_data[sensorid]; - - /** - * @brief 系统启动至少5分钟后,才开始更新数据 - */ - if (zsteady_clock().gets() > 5 * 60) { - sensor_data->h2o2 = data->h2o2 / 10; - sensor_data->temp = data->temp / 10; - sensor_data->humid = data->humid / 10; - sensor_data->saturation = data->saturation / 10; - sensor_data->sensorId = data->sensorid; - sensor_data->updatetime = zsys_get_ticket(); - } else { - sensor_data->h2o2 = 0; - sensor_data->temp = data->temp / 10; - sensor_data->humid = 0; - sensor_data->saturation = 0; - sensor_data->sensorId = data->sensorid; - sensor_data->updatetime = zsys_get_ticket(); - } -} #ifdef PROJECT_TYPE_PIPE_DISINFECTION void DeviceIoControlService::AirInletProportionalValve_setState(int32_t val) { @@ -503,4 +500,26 @@ float DeviceIoControlService::airCompressor_getPressureDirect() { return ack / 10.0; } -#endif \ No newline at end of file +#endif + +#ifdef PROJECT_TYPE_DRAW_BAR_BOX +/******************************************************************************* + * 拉杆箱消毒机-喷液泵 * + *******************************************************************************/ +void DeviceIoControlService::DBDB__sprayLiquidPump_run(int gpm) {} + +int32_t DeviceIoControlService::DBDB__readPressureSensor(int index) { return 0; } +int32_t DeviceIoControlService::DBDB__sprayAirCompressorPowerCtrl(int index) { return 0; } +int32_t DeviceIoControlService::DBDB__airTightnessTestAirCompressorPowerCtrl(int index) { return 0; } + +int32_t DeviceIoControlService::DBDB__heaterCtrl(int index) { return 0; } +int32_t DeviceIoControlService::DBDB__heaterCtrlSafeValve(int index) { return 0; } +int32_t DeviceIoControlService::DBDB__heaterReadElectricCurrent() { return 0; } +int32_t DeviceIoControlService::DBDB__heaterReadTemperatureData() { return 0; } + +int32_t DeviceIoControlService::DBDB__miniPwmBlowerCtrl(int index) { return 0; } +int32_t DeviceIoControlService::DBDB__miniPwmBlowerReadFbcount() { return 0; } + +int32_t DeviceIoControlService::DBDB__extValveCtrl(int index) { return 0; } +int32_t DeviceIoControlService::DBDB__extValBoardIsOnline() { return 0; } +#endif diff --git a/src/service/device_io_control_service.hpp b/src/service/device_io_control_service.hpp index 2888e4a..67e50f4 100644 --- a/src/service/device_io_control_service.hpp +++ b/src/service/device_io_control_service.hpp @@ -114,6 +114,8 @@ class DeviceIoControlService : public IF_DeviceIoContrlService { void H2O2Sensor_updateSensorData(int32_t sensorid, report_h2o2_data_t* data); public: +#if (defined PROJECT_TYPE_LARGE_SPACE_DISINFECTION) || (defined PROJECT_TYPE_SMALL_SPACE_DISINFECTION) || (defined PROJECT_TYPE_PIPE_DISINFECTION) + /******************************************************************************* * 加热片控制 * *******************************************************************************/ @@ -201,9 +203,31 @@ class DeviceIoControlService : public IF_DeviceIoContrlService { virtual int32_t AirProportionalValve_getState(int32_t* inlet, int32_t* outlet) override; virtual int32_t AirProportionalValve_isBusy(int32_t* isbusy) override; #endif +#endif + +#ifdef PROJECT_TYPE_DRAW_BAR_BOX + /******************************************************************************* + * 拉杆箱消毒机-喷液泵 * + *******************************************************************************/ + virtual void DBDB__sprayLiquidPump_run(int gpm) override; + + virtual int32_t DBDB__readPressureSensor(int index) override; + virtual int32_t DBDB__sprayAirCompressorPowerCtrl(int index) override; + virtual int32_t DBDB__airTightnessTestAirCompressorPowerCtrl(int index) override; + + virtual int32_t DBDB__heaterCtrl(int index) override; + virtual int32_t DBDB__heaterCtrlSafeValve(int index) override; + virtual int32_t DBDB__heaterReadElectricCurrent() override; + virtual int32_t DBDB__heaterReadTemperatureData() override; + + virtual int32_t DBDB__miniPwmBlowerCtrl(int index) override; + virtual int32_t DBDB__miniPwmBlowerReadFbcount() override; + + virtual int32_t DBDB__extValveCtrl(int index) override; + virtual int32_t DBDB__extValBoardIsOnline() override; +#endif private: - void updateDisinfectantVolumeSample(float kpa); void processReportPacket(uint8_t* packet, size_t len); void startScan(); }; diff --git a/src/service/device_io_control_service_test.cpp b/src/service/device_io_control_service_test.cpp index 5825a2d..2dc13a4 100644 --- a/src/service/device_io_control_service_test.cpp +++ b/src/service/device_io_control_service_test.cpp @@ -26,6 +26,7 @@ int32_t DeviceIoControlServiceTest::H2O2Sensor_readSaturation(int32_t sensorid) /******************************************************************************* * 加热片控制 * *******************************************************************************/ +#if (defined PROJECT_TYPE_LARGE_SPACE_DISINFECTION) || (defined PROJECT_TYPE_SMALL_SPACE_DISINFECTION) || (defined PROJECT_TYPE_PIPE_DISINFECTION) static int heatingStrip_io1; static int heatingStrip_io2; @@ -113,6 +114,7 @@ int DeviceIoControlServiceTest::getWaterImmersionSensor2() { return 1; } int DeviceIoControlServiceTest::getDisinfectantVolume_g() { return 123; } // g int DeviceIoControlServiceTest::getPressureSensorData(int index) { return 456; } // g void DeviceIoControlServiceTest::warningLightCtrl(int r, int g, int b, int w) { logger->info("warningLightCtrl r:{} g:{} b:{} w:{}", r, g, b, w); } +#endif #ifdef PROJECT_TYPE_PIPE_DISINFECTION /******************************************************************************* @@ -170,4 +172,48 @@ int32_t DeviceIoControlServiceTest::AirProportionalValve_isBusy(int32_t* isbusy) *isbusy = 0; return 0; } +#endif + +#ifdef PROJECT_TYPE_DRAW_BAR_BOX +/******************************************************************************* + * 拉杆箱消毒机-喷液泵 * + *******************************************************************************/ +int32_t DBDB__sprayLiquidPump_state; +void DeviceIoControlServiceTest::DBDB__sprayLiquidPump_run(int gpm) { DBDB__sprayLiquidPump_state = 1; } + +int32_t DeviceIoControlServiceTest::DBDB__readPressureSensor(int index) { return index; } +int32_t DeviceIoControlServiceTest::DBDB__sprayAirCompressorPowerCtrl(int power) { + logger->info("DBDB__sprayAirCompressorPowerCtrl power:{}", power); + return 0; +} +int32_t DeviceIoControlServiceTest::DBDB__airTightnessTestAirCompressorPowerCtrl(int power) { + logger->info("DBDB__airTightnessTestAirCompressorPowerCtrl power:{}", power); + return 0; +} + +int32_t DeviceIoControlServiceTest::DBDB__heaterCtrl(int power) { + logger->info("DBDB__heaterCtrl power:{}", power); + return 0; +} +int32_t DeviceIoControlServiceTest::DBDB__heaterCtrlSafeValve(int power) { + logger->info("DBDB__heaterCtrlSafeValve index:{}", power); + return 0; +} +int32_t DeviceIoControlServiceTest::DBDB__heaterReadElectricCurrent() { return 123; } +int32_t DeviceIoControlServiceTest::DBDB__heaterReadTemperatureData() { return 45; } + +int32_t DeviceIoControlServiceTest::DBDB__miniPwmBlowerCtrl(int power) { + logger->info("DBDB__miniPwmBlowerCtrl power:{}", power); + return 0; +} +int32_t DeviceIoControlServiceTest::DBDB__miniPwmBlowerReadFbcount() { return 0; } + +int32_t DeviceIoControlServiceTest::DBDB__extValveCtrl(int index) { + logger->info("DBDB__extValveCtrl index:{}", index); + return 0; +} +int32_t DeviceIoControlServiceTest::DBDB__extValBoardIsOnline() { + logger->info("DBDB__extValBoardIsOnline"); + return 0; +} #endif \ No newline at end of file diff --git a/src/service/device_io_control_service_test.hpp b/src/service/device_io_control_service_test.hpp index 639956a..bd1abb5 100644 --- a/src/service/device_io_control_service_test.hpp +++ b/src/service/device_io_control_service_test.hpp @@ -51,6 +51,7 @@ class DeviceIoControlServiceTest : public IF_DeviceIoContrlService { virtual int32_t H2O2Sensor_readHumid(int32_t sensorid) override; virtual int32_t H2O2Sensor_readTemperature(int32_t sensorid) override; virtual int32_t H2O2Sensor_readSaturation(int32_t sensorid) override; +#if (defined PROJECT_TYPE_LARGE_SPACE_DISINFECTION) || (defined PROJECT_TYPE_SMALL_SPACE_DISINFECTION) || (defined PROJECT_TYPE_PIPE_DISINFECTION) /******************************************************************************* * 加热片控制 * @@ -114,6 +115,8 @@ class DeviceIoControlServiceTest : public IF_DeviceIoContrlService { virtual void warningLightCtrl(int r, int g, int b, int w) override; +#endif + #ifdef PROJECT_TYPE_PIPE_DISINFECTION virtual int airCompressor_channelSelect(int32_t val) override; virtual int airCompressor_getChannelIndex() override; @@ -139,5 +142,27 @@ class DeviceIoControlServiceTest : public IF_DeviceIoContrlService { virtual int32_t AirProportionalValve_getState(int32_t* inlet, int32_t* outlet) override; virtual int32_t AirProportionalValve_isBusy(int32_t* isbusy) override; #endif + +#ifdef PROJECT_TYPE_DRAW_BAR_BOX + /******************************************************************************* + * 拉杆箱消毒机-喷液泵 * + *******************************************************************************/ + virtual void DBDB__sprayLiquidPump_run(int gpm) override; + + virtual int32_t DBDB__readPressureSensor(int index) override; + virtual int32_t DBDB__sprayAirCompressorPowerCtrl(int index) override; + virtual int32_t DBDB__airTightnessTestAirCompressorPowerCtrl(int index) override; + + virtual int32_t DBDB__heaterCtrl(int index) override; + virtual int32_t DBDB__heaterCtrlSafeValve(int index) override; + virtual int32_t DBDB__heaterReadElectricCurrent() override; + virtual int32_t DBDB__heaterReadTemperatureData() override; + + virtual int32_t DBDB__miniPwmBlowerCtrl(int index) override; + virtual int32_t DBDB__miniPwmBlowerReadFbcount() override; + + virtual int32_t DBDB__extValveCtrl(int index) override; + virtual int32_t DBDB__extValBoardIsOnline() override; +#endif }; } // namespace iflytop \ No newline at end of file diff --git a/src/service/if_devoce_io_contrl_service.hpp b/src/service/if_devoce_io_contrl_service.hpp index 143e235..91098e5 100644 --- a/src/service/if_devoce_io_contrl_service.hpp +++ b/src/service/if_devoce_io_contrl_service.hpp @@ -65,6 +65,8 @@ class IF_DeviceIoContrlService { virtual int32_t H2O2Sensor_readTemperature(int32_t sensorid) = 0; virtual int32_t H2O2Sensor_readSaturation(int32_t sensorid) = 0; +#if (defined PROJECT_TYPE_LARGE_SPACE_DISINFECTION) || (defined PROJECT_TYPE_SMALL_SPACE_DISINFECTION) || (defined PROJECT_TYPE_PIPE_DISINFECTION) + /******************************************************************************* * 加热片控制 * *******************************************************************************/ @@ -165,5 +167,35 @@ class IF_DeviceIoContrlService { virtual int32_t AirProportionalValve_getState(int32_t* inlet, int32_t* outlet) = 0; virtual int32_t AirProportionalValve_isBusy(int32_t* isbusy) = 0; #endif + +#endif + // 喷液泵 + +#ifdef PROJECT_TYPE_DRAW_BAR_BOX + /******************************************************************************* + * 拉杆箱消毒机-喷液泵 * + *******************************************************************************/ + virtual void DBDB__sprayLiquidPump_run(int gpm) = 0; + + virtual int32_t DBDB__readPressureSensor(int index) = 0; + virtual int32_t DBDB__sprayAirCompressorPowerCtrl(int index) = 0; + virtual int32_t DBDB__airTightnessTestAirCompressorPowerCtrl(int index) = 0; + + virtual int32_t DBDB__heaterCtrl(int index) = 0; + virtual int32_t DBDB__heaterCtrlSafeValve(int index) = 0; + virtual int32_t DBDB__heaterReadElectricCurrent() = 0; + virtual int32_t DBDB__heaterReadTemperatureData() = 0; + + virtual int32_t DBDB__miniPwmBlowerCtrl(int index) = 0; + virtual int32_t DBDB__miniPwmBlowerReadFbcount() = 0; + + typedef enum { + kExtValveChannel_disinfectionChannel = 0, // 消毒通道 + kExtValveChannel_dehumidificationChannel = 1, // 除湿通道 + kExtValveChannel_degradationChannel = 2, // 降解通道 + } ExtValveChannel_t; + virtual int32_t DBDB__extValveCtrl(int index) = 0; + virtual int32_t DBDB__extValBoardIsOnline() = 0; +#endif }; } // namespace iflytop \ No newline at end of file diff --git a/src/utils/volume_convertor.hpp b/src/utils/volume_convertor.hpp index 67f7786..8e45db3 100644 --- a/src/utils/volume_convertor.hpp +++ b/src/utils/volume_convertor.hpp @@ -94,6 +94,26 @@ class VolumeConvertor { float density = 1000; // kg/m^3 #endif +#ifdef PROJECT_TYPE_DRAW_BAR_BOX + float container_h4 = 0; + float container_ru4 = 0; + float container_rb4 = 0; + + float container_h3 = 0; + float container_ru3 = 0; + float container_rb3 = 0; + + float container_h2 = 0; + float container_ru2 = 0; + float container_rb2 = 0; + + float container_h1 = 0; + float container_ru1 = 0; + float container_rb1 = 0; + + float density = 1000; // kg/m^3 +#endif + public: float pressurePa2VolumeG(float _pa); diff --git a/transmit_disinfection_public_code b/transmit_disinfection_public_code index eb94a3e..349cc71 160000 --- a/transmit_disinfection_public_code +++ b/transmit_disinfection_public_code @@ -1 +1 @@ -Subproject commit eb94a3e3ff0d276e96ca334b349a58bdd1458ab1 +Subproject commit 349cc71e9d3f14ec7bee878f9aed725e5cafac0a