timeout.h 837 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef TIMEOUT_H
  2. #define TIMEOUT_H
  3. #include <QObject>
  4. #include <QTimerEvent>
  5. #include <QDateTime>
  6. #define TIMER_LOCKNOTCLOSED 1000 * 1 // 物资柜未关闭检测定时器
  7. #define TIMER_HTTPSENDRELAY 1000 * 1 // 发送至服务器检测定时器
  8. class timeout : public QObject
  9. {
  10. Q_OBJECT
  11. public:
  12. timeout();
  13. void timerEvent(QTimerEvent *event);
  14. private:
  15. // void timeoutRun(int epoch);
  16. // void timeoutEnd();
  17. signals:
  18. // 超时进行
  19. void signal_timeoutRun(int);
  20. // 超时开始
  21. void signal_timeoutStart();
  22. // 超时结束
  23. void signal_timeoutEnd();
  24. private:
  25. int m_iLockTimeout; // 锁超时未关检测定时器
  26. int m_iHttpTimeout; // 锁超时未关检测定时器
  27. qint64 m_epochLaseHttpPost = 0; // 向服务器发消息的时间戳
  28. };
  29. #endif // TIMEOUT_H