From 1b46df8634809fb519d2c2465ec97aa19b2b6c58 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Tue, 26 Dec 2023 19:15:19 +0800 Subject: [PATCH] update --- src/configs/gconfig.hpp | 3 ++- src/service/device_io_control_service.cpp | 36 +++++++++++-------------------- src/service/disinfection_ctl_service.cpp | 8 +++++++ 3 files changed, 23 insertions(+), 24 deletions(-) diff --git a/src/configs/gconfig.hpp b/src/configs/gconfig.hpp index ced91c8..beda902 100644 --- a/src/configs/gconfig.hpp +++ b/src/configs/gconfig.hpp @@ -20,7 +20,8 @@ marco(int32_t /* */, iflytopSubDeviceCanBitrate, 500000) /*子设备Can设备波特率*/ \ marco(string /* */, pipettingRobotCanIFName, "can1") /*移液臂Can设备名称*/ \ marco(int32_t /* */, pipettingRobotCanBitrate, 500000) /*移液臂Can设备波特率*/ \ - marco(int32_t /* */, preHeatLastTimeS, 60) /*预热时间*/ + marco(int32_t /* */, preHeatLastTimeS, 60) /*预热时间*/ \ + marco(int32_t /* */, disinfectantBucketCapacity_g, 2300) /*消毒桶容积*/ configTemplateDEFILE_CONFIG_SERVICE2( // GConfig, // diff --git a/src/service/device_io_control_service.cpp b/src/service/device_io_control_service.cpp index 278d3b7..2d3669a 100644 --- a/src/service/device_io_control_service.cpp +++ b/src/service/device_io_control_service.cpp @@ -238,7 +238,6 @@ static int filter(int data) { if (q.size() > 50) { q.pop_front(); } - // ��ֵ�˲� int datacache[51]; int ndata = 0; for (auto& var : q) { @@ -263,8 +262,14 @@ int DeviceIoControlService::getDisinfectantVolume_g() { lock_guard lock(lock_); float kpa = m_pressure_sensor_data[1].value / 1000.0; - int g = 2.11 * kpa * 1000 * 1.3; - if (g < 450) { /*���*/ + /** + * @brief + * int g = 2.11 * kpa * 1000 * 1.3; //直径 164 ,82 + */ + + int g = 2.11 * (67 * 67 / 82.0 / 82.0) * kpa * 1000 * 1.3; // 直径 134 ,67 + + if (g < 450) { /**/ return 0; } else { g -= 450; @@ -293,10 +298,10 @@ int DeviceIoControlService::getWaterImmersionSensor2() { DeviceIoControlService::h2o2sensor_data_t DeviceIoControlService::getH2O2SenSorData1() { lock_guard lock(lock_); DeviceIoControlService::h2o2sensor_data_t data; - // int16_t hydrogen_peroxide_volume; // ppm 0x0100 ��������Ũ�� - // int16_t h2o_h2o2_rs; // %RS * 100 0x0101 ����������Ա��Ͷ� - // int16_t temperature1; // ��C * 100 0x0102 �¶� - // int16_t relative_humidity; // %RH * 100 0x0103 ���ʪ�� + // int16_t hydrogen_peroxide_volume; // ppm 0x0100 + // int16_t h2o_h2o2_rs; // %RS * 100 0x0101 + // int16_t temperature1; // ��C * 100 0x0102 + // int16_t relative_humidity; // %RH * 100 0x0103 data.h2o2 = m_hpp272_data_1.hydrogen_peroxide_volume; data.humid = m_hpp272_data_1.relative_humidity / 100; data.temp = m_hpp272_data_1.temperature1 / 100; @@ -304,7 +309,6 @@ DeviceIoControlService::h2o2sensor_data_t DeviceIoControlService::getH2O2SenSorD /** * @brief - * TODO:������δ��ʼ�����ʱ�������¶��⣬��ȡ�������ݶ���С���㣬��������һ���򵥵Ĵ�����������Ҫ�޸� * */ if (data.h2o2 < 0) { @@ -330,9 +334,6 @@ bool DeviceIoControlService::getAllSensorData(DeviceIoControlService::all_h2o2se data.h2o2sensor_status[1] = false; data.h2o2sensor_status[2] = false; - /** - * @brief �ҵ���С�Ĺ�������Ũ�� - */ data.min_h2o2 = -1; for (size_t i = 0; i < ZARRAYSIZE(data.h2o2sensor_data); i++) { if (data.h2o2sensor_status[i]) { @@ -356,7 +357,6 @@ bool DeviceIoControlService::getAllSensorData(DeviceIoControlService::all_h2o2se } /** - * @brief �ҵ����Ĺ���������Ա��Ͷ� */ data.max_saturation = -1; for (size_t i = 0; i < ZARRAYSIZE(data.h2o2sensor_data); i++) { @@ -370,7 +370,6 @@ bool DeviceIoControlService::getAllSensorData(DeviceIoControlService::all_h2o2se } /** - * @brief �ҵ��������ʪ�� */ data.max_humid = -1; @@ -386,14 +385,5 @@ bool DeviceIoControlService::getAllSensorData(DeviceIoControlService::all_h2o2se return true; } -void DeviceIoControlService::printerTest() { - // printerPrintf("* * * * * * * * * * * * * * * \n"); - // printerPrintf("123456789123456789\n"); - // printerPrintf("abcdefghijk lmnopqr\n"); - // printerPrintf("ABCDEF GHIJ KLMN OPQR\n"); - // printerPrintf("全思美特"); - // printerPrintf("打印测试"); - // printerPrintf("\n"); - // printerPrintf("\n"); -} +void DeviceIoControlService::printerTest() {} void DeviceIoControlService::printerPrintf(string str) { GET_SERVICE(UartPrinter)->print(ZIconv::utf8_to_gb2312(str)); } diff --git a/src/service/disinfection_ctl_service.cpp b/src/service/disinfection_ctl_service.cpp index 0b86349..0a6744f 100644 --- a/src/service/disinfection_ctl_service.cpp +++ b/src/service/disinfection_ctl_service.cpp @@ -645,6 +645,14 @@ void DisinfectionCtrlService::startReplenishingFluids(int stopatg) { m_disinfectionThread->join(); m_disinfectionThread = nullptr; } + + int maxg = GET_SERVICE(GConfig)->get_disinfectantBucketCapacity_g(); + + if (stopatg > maxg) { + logger->warn("start Replenishing fail, stopatg {} > maxg {}", stopatg, maxg); + stopatg = maxg; + } + int32_t nowvolume = m_deviceIoControlService->getDisinfectantVolume_g(); if (nowvolume > stopatg) { logger->warn("start Replenishing fail, nowvolume {} > stopatg {}", nowvolume, stopatg);