Browse Source

update

master
zhaohe 2 years ago
parent
commit
1b46df8634
  1. 3
      src/configs/gconfig.hpp
  2. 36
      src/service/device_io_control_service.cpp
  3. 8
      src/service/disinfection_ctl_service.cpp

3
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, //

36
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<recursive_mutex> 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<recursive_mutex> 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)); }

8
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);

Loading…
Cancel
Save