|
|
@ -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)); } |