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.

91 lines
1.8 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. //
  2. // Created by zwsd
  3. //
  4. #pragma once
  5. #include <fstream>
  6. #include <iostream>
  7. #include <list>
  8. #include <map>
  9. #include <memory>
  10. #include <mutex>
  11. #include <set>
  12. #include <sstream>
  13. #include <string>
  14. #include <vector>
  15. #include "iflytop/components/zcanreceiver/zcanhost.hpp"
  16. #include "iflytop/core/core.hpp"
  17. #include "zservice_container/zservice_container.hpp"
  18. /**
  19. * @brief
  20. *
  21. * service: SensorDataScan
  22. *
  23. * :
  24. * :
  25. * :
  26. * :
  27. *
  28. */
  29. namespace iflytop {
  30. using namespace std;
  31. using namespace core;
  32. class SensorDataScan : public enable_shared_from_this<SensorDataScan> {
  33. ENABLE_LOGGER(SensorDataScan);
  34. unique_ptr<Thread> m_workThread;
  35. shared_ptr<ZCanHost> m_zcanHost;
  36. //
  37. ZCanHost::hpp272_data_t m_hpp272_data_1;
  38. ZCanHost::huacheng_pressure_sensor_read_c1005_t m_pressure_sensor_data[4];
  39. //
  40. bool m_waterImmersionSensor1 = false; // 漏液检测
  41. bool m_waterImmersionSensor2 = false; // 仓内液体检测
  42. int m_adc_0 = 0; //
  43. int m_adc_1 = 0; //
  44. int m_adc_2 = 0;
  45. public:
  46. SensorDataScan();
  47. void initialize();
  48. void startScan();
  49. public:
  50. int getAirCompressor_io1();
  51. int getAirCompressor_io2();
  52. int getAirCompressor_currentValue();
  53. int getAirBlower_io1();
  54. int getAirBlower_io2();
  55. int getAirBlower_currentValue();
  56. // heatingStrip
  57. int getHeatingStrip_io1();
  58. int getHeatingStrip_io2();
  59. int getHeatingStrip_currentValue();
  60. int getSprinkler_PumpRPM();
  61. int getChargingPump_PumpRPM();
  62. int getDisinfectantVolume_g(); // g
  63. int getWaterImmersionSensor1();
  64. int getWaterImmersionSensor2();
  65. typedef struct {
  66. int h2o2; // ppm
  67. int temp; // 温度
  68. int humid; // 湿度 %RS
  69. int saturation; // 相对饱和度 %RS
  70. } h2o2sensor_data_t;
  71. h2o2sensor_data_t getH2O2SenSorData1();
  72. };
  73. } // namespace iflytop