//
// Created by xin on 25-3-31.
//

#ifndef TG_MANAGER_H
#define TG_MANAGER_H
#include <QObject>
enum WORKINGSTATUS{
  HEATING=1,
  COOLING=2,
  WINDOWS_OPEN=3,
  WINDOWS_CLOSE=4,

  NotWroking=0
};
// enum WINDOWS_STATUS{
//   WINDOWS_IS_READY_OPEN=1,
//   WINDOWS_IS_CLOSE=2,
//   WINDOWS_IS_OPENING=3,
//   WINDOWS_IS_CLOSING=4,
//   WINDOWS_IS_STOP=5
// };
class TG_Manager:public QObject {
  Q_OBJECT
public:

  void SetPin(int pin1_H=7, int pin1_L=10, int pin2_H=2, int pin2_L=4);
  void SetPin_V2(int Windows_Pin_H, int Windows_Pin_L, int COOLER_Pin_EN, int HOT_Pin_EN, int Fan_Pin_H, int Fan_Pin_L);
  void Set_Waite_time_for_Windows(int time_in_seconds);
  // void SetPin_V2
  void InitManger();

  bool Heating(bool isworking);
  bool Cooling(bool isworking);
  bool Windows_Open();
  bool Windows_Close();
  bool Stop();
  int GetManagerStatus();




private:
  bool SetTuiGan(int IS_High);
  bool SetSwitch1Status(bool status);
  bool SetSwitch2Status(bool status);
  int m_time_for_wait_windows=40;
  int pin1_H=7;
  int pin1_L=10;
  int pin2_H=2;
  int pin2_L=4;
  /*    "Pin": {
      "COOLER": {
        "Pin": 24
        },
      "Fan": {
        "Pin_H": 3,
        "Pin_L": 2
        },
      "HOT": {
        "Pin": 19
       },
      "WINDOWS": {
        "Pin_H": 7,
        "Pin_L": 10
       }
    }*/
  int Windows_Pin_H=7;
  int Windows_Pin_L=10;
  int COOLER_Pin_EN=24;
  int HOT_Pin_EN=19;
  int Fan_Pin_H=3;
  int Fan_Pin_L=2;


  bool ping1_status=false;
  int WorkingStatus=NotWroking;


};



#endif //TG_MANAGER_H
