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.

92 lines
1.9 KiB

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_1 = 0; //
  43. int m_adc_2 = 0;
  44. int m_adc_3 = 0;
  45. int m_adc_4 = 0;
  46. int m_adc_5 = 0;
  47. public:
  48. SensorDataScan();
  49. void initialize();
  50. void startScan();
  51. public:
  52. int getAirCompressor_io1();
  53. int getAirCompressor_io2();
  54. int getAirCompressor_currentValue();
  55. int getAirBlower_io1();
  56. int getAirBlower_io2();
  57. int getAirBlower_currentValue();
  58. // heatingStrip
  59. int getHeatingStrip_io1();
  60. int getHeatingStrip_io2();
  61. int getHeatingStrip_currentValue();
  62. int getSprinkler_PumpRPM();
  63. int getChargingPump_PumpRPM();
  64. int getDisinfectantVolume(); // g
  65. int getWaterImmersionSensor1();
  66. int getWaterImmersionSensor2();
  67. typedef struct {
  68. int h2o2; // ppm
  69. int temp; // 温度
  70. int humid; // 湿度 %RS
  71. int saturation; // 相对饱和度 %RS
  72. } h2o2sensor_data_t;
  73. h2o2sensor_data_t getH2O2SenSorData(int id);
  74. };
  75. } // namespace iflytop