12 changed files with 166 additions and 130 deletions
-
2appsrc/appconfig/basic/zappversion.hpp
-
24appsrc/baseservice/db/calibrate_info_dao.cpp
-
11appsrc/baseservice/db/calibrate_info_dao.hpp
-
11appsrc/service/app/air_leak_detect_test.cpp
-
2appsrc/service/app/air_leak_detect_test.hpp
-
25appsrc/service/app/disinfection_ctrl/disinfection_ctrl_service.cpp
-
72appsrc/service/app/disinfection_ctrl/disinfection_ctrl_service.hpp
-
4appsrc/service/app_core.cpp
-
31appsrc/service/calibration/h2o2_liquid_weight_sensor_calibration_service.cpp
-
48appsrc/service/calibration/sensor_calibration_service.cpp
-
10appsrc/service/calibration/sensor_calibration_service.hpp
@ -1,3 +1,3 @@ |
|||
#pragma once
|
|||
#define VERSION "3.0.8"
|
|||
#define VERSION "3.0.9"
|
|||
#define PROJECT_NAME "TRANSMIT_DM"
|
@ -1,31 +0,0 @@ |
|||
#include "h2o2_liquid_weight_sensor_calibration_service.hpp"
|
|||
|
|||
using namespace iflytop; |
|||
using namespace std; |
|||
using namespace core; |
|||
|
|||
void H2O2LiquidWeightSensorCalibrationService::initialize() { |
|||
GET_TO_SERVICE(m_disinfectantWeightUpdateService); |
|||
REG_EXTFN_VOID(getWeight, json(void)); //
|
|||
|
|||
REG_EXTFN_VOID(tare, void(void)); // 去皮
|
|||
REG_EXTFN(setBiasDirect, void(float), bias); //
|
|||
REG_EXTFN_VOID(getBias, void(void)); //
|
|||
} |
|||
void H2O2LiquidWeightSensorCalibrationService::tare(shared_ptr<MsgProcessContext> cxt) { //
|
|||
float weight = m_disinfectantWeightUpdateService->getRoughWeight(); |
|||
CalibrationInfoDao::ins()->setH2O2LiquidWeightSensorZeroBias(weight + 10); |
|||
} |
|||
void H2O2LiquidWeightSensorCalibrationService::getWeight(shared_ptr<MsgProcessContext> cxt) { |
|||
float weight = m_disinfectantWeightUpdateService->getWeight(); |
|||
float roughWeight = m_disinfectantWeightUpdateService->getRoughWeight(); |
|||
cxt->rely["weight"] = weight; |
|||
cxt->rely["roughWeight"] = roughWeight; |
|||
} |
|||
|
|||
void H2O2LiquidWeightSensorCalibrationService::getBias(shared_ptr<MsgProcessContext> cxt) { |
|||
float bias = CalibrationInfoDao::ins()->getH2O2LiquidWeightSensorZeroBias(); |
|||
cxt->rely["bias"] = bias; |
|||
} |
|||
|
|||
void H2O2LiquidWeightSensorCalibrationService::setBiasDirect(shared_ptr<MsgProcessContext> cxt, float bias) { CalibrationInfoDao::ins()->setH2O2LiquidWeightSensorZeroBias(bias); } |
@ -0,0 +1,48 @@ |
|||
#include "sensor_calibration_service.hpp"
|
|||
|
|||
using namespace iflytop; |
|||
using namespace std; |
|||
using namespace core; |
|||
|
|||
void SensorCalibrationService::initialize() { |
|||
GET_TO_SERVICE(m_disinfectantWeightUpdateService); |
|||
REG_EXTFN_VOID(getWeight, json(void)); //
|
|||
|
|||
REG_EXTFN_VOID(tare, void(void)); // 去皮
|
|||
REG_EXTFN(setBiasDirect, void(float), bias); //
|
|||
REG_EXTFN_VOID(getBias, void(void)); //
|
|||
|
|||
REG_EXTFN(setACPressureSensorZeroBiasKpa, void(float), val); // 设置AC压力传感器零点偏置
|
|||
REG_EXTFN_VOID(getACPressureSensorZeroBiasKpa, void(void)); // 获取AC压力传感器零点偏置
|
|||
REG_EXTFN_VOID(getACPressureSensorVal, void(void)); // 获取AC压力传感器去皮后的值
|
|||
} |
|||
void SensorCalibrationService::tare(shared_ptr<MsgProcessContext> cxt) { //
|
|||
float weight = m_disinfectantWeightUpdateService->getRoughWeight(); |
|||
CalibrationInfoDao::ins()->setH2O2LiquidWeightSensorZeroBias(weight + 10); |
|||
} |
|||
void SensorCalibrationService::getWeight(shared_ptr<MsgProcessContext> cxt) { |
|||
float weight = m_disinfectantWeightUpdateService->getWeight(); |
|||
float roughWeight = m_disinfectantWeightUpdateService->getRoughWeight(); |
|||
cxt->rely["weight"] = weight; |
|||
cxt->rely["roughWeight"] = roughWeight; |
|||
} |
|||
|
|||
void SensorCalibrationService::getBias(shared_ptr<MsgProcessContext> cxt) { |
|||
float bias = CalibrationInfoDao::ins()->getH2O2LiquidWeightSensorZeroBias(); |
|||
cxt->rely["bias"] = bias; |
|||
} |
|||
|
|||
void SensorCalibrationService::setBiasDirect(shared_ptr<MsgProcessContext> cxt, float bias) { CalibrationInfoDao::ins()->setH2O2LiquidWeightSensorZeroBias(bias); } |
|||
|
|||
void SensorCalibrationService::setACPressureSensorZeroBiasKpa(shared_ptr<MsgProcessContext> cxt, float val) { CalibrationInfoDao::ins()->setACPressureSensorZeroBiasKpa(val); } |
|||
void SensorCalibrationService::getACPressureSensorZeroBiasKpa(shared_ptr<MsgProcessContext> cxt) { |
|||
float bias = CalibrationInfoDao::ins()->getACPressureSensorZeroBiasKpa(); |
|||
cxt->rely["bias"] = bias; //
|
|||
} |
|||
|
|||
void SensorCalibrationService::getACPressureSensorVal(shared_ptr<MsgProcessContext> cxt) { |
|||
float weight = GET_SERVICE(DeviceIoControlService)->ACPostPS_readPa() / 1000.0; |
|||
float aftare = CalibrationInfoDao::ins()->acPressureSensorTare(weight); |
|||
cxt->rely["afterTare"] = aftare; // 去皮后的值
|
|||
cxt->rely["rawVal"] = weight; // 原始值
|
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue