You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
93 lines
1.9 KiB
93 lines
1.9 KiB
//
|
|
// Created by zwsd
|
|
//
|
|
|
|
#pragma once
|
|
#include <fstream>
|
|
#include <iostream>
|
|
#include <list>
|
|
#include <map>
|
|
#include <memory>
|
|
#include <mutex>
|
|
#include <set>
|
|
#include <sstream>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "iflytop/components/zcanreceiver/zcanhost.hpp"
|
|
#include "iflytop/core/core.hpp"
|
|
#include "zservice_container/zservice_container.hpp"
|
|
|
|
/**
|
|
* @brief
|
|
*
|
|
* service: SensorDataScan
|
|
*
|
|
* 监听事件:
|
|
* 依赖状态:
|
|
* 依赖服务:
|
|
* 作用:
|
|
*
|
|
*/
|
|
|
|
namespace iflytop {
|
|
using namespace std;
|
|
using namespace core;
|
|
|
|
class SensorDataScan : public enable_shared_from_this<SensorDataScan> {
|
|
ENABLE_LOGGER(SensorDataScan);
|
|
|
|
unique_ptr<Thread> m_workThread;
|
|
shared_ptr<ZCanHost> m_zcanHost;
|
|
|
|
//
|
|
ZCanHost::hpp272_data_t m_hpp272_data_1;
|
|
ZCanHost::huacheng_pressure_sensor_read_c1005_t m_pressure_sensor_data[4];
|
|
|
|
//
|
|
bool m_waterImmersionSensor1 = false; // 漏液检测
|
|
bool m_waterImmersionSensor2 = false; // 仓内液体检测
|
|
|
|
int m_adc_1 = 0; //
|
|
int m_adc_2 = 0;
|
|
int m_adc_3 = 0;
|
|
int m_adc_4 = 0;
|
|
int m_adc_5 = 0;
|
|
|
|
public:
|
|
SensorDataScan();
|
|
void initialize();
|
|
void startScan();
|
|
|
|
public:
|
|
int getAirCompressor_io1();
|
|
int getAirCompressor_io2();
|
|
int getAirCompressor_currentValue();
|
|
|
|
int getAirBlower_io1();
|
|
int getAirBlower_io2();
|
|
int getAirBlower_currentValue();
|
|
|
|
// heatingStrip
|
|
int getHeatingStrip_io1();
|
|
int getHeatingStrip_io2();
|
|
int getHeatingStrip_currentValue();
|
|
|
|
int getSprinkler_PumpRPM();
|
|
int getChargingPump_PumpRPM();
|
|
|
|
int getDisinfectantVolume(); // g
|
|
|
|
int getWaterImmersionSensor1();
|
|
int getWaterImmersionSensor2();
|
|
|
|
typedef struct {
|
|
int h2o2; // ppm
|
|
int temp; // 温度
|
|
int humid; // 湿度 %RS
|
|
int saturation; // 相对饱和度 %RS
|
|
} h2o2sensor_data_t;
|
|
|
|
h2o2sensor_data_t getH2O2SenSorData(int id);
|
|
};
|
|
} // namespace iflytop
|