stec-platform
qwatch.h
1 #ifndef QWATCH_H
2 #define QWATCH_H
3 
4 #include "platform_global.h"
5 #include <QObject>
6 #include <QTimer>
7 
16 class PLATFORMSHARED_EXPORT QWatch : public QObject
17 {
18  Q_OBJECT
19 
20 
21 public :
22 
23  typedef quint64 QWHND;
24 
25 private :
26 
27  struct HWindow {
28  QWHND idHnd;
29  qint64 millisecondsDiffLimit;
30  QDateTime dateTime1;
31  QString logfile;
32  QString message;
33  } ;
34 
35  QMutex lock;
36  QWatch::QWHND idHnd;
37  QMap<QWatch::QWHND, HWindow> workingL;
38  QTimer *timer;
39  bool TimerRunning;
40 
41 public:
42 
47  explicit QWatch(QObject *parent = nullptr);
48 
50  virtual ~QWatch()
51  {
52  if ( this->timer != NULL)
53  {
54  timer->stop();
55  delete this->timer;
56  }
57  }
58  QWatch::QWHND startErrorTrap(qint64 msAllowed, QString message, QString logfile);
59 
60  void endErrorTrap(QWatch::QWHND idHnd );
61 
62 
63 
64 private slots:
65  void timeout();
66 
67 public Q_SLOTS:
68 
69 
70  void startTimer();
71 
72 
73 
74 Q_SIGNALS:
75 
76  void SignalActivateTimer();
77 
78 };
79 
80 #endif // QWATCH_H
The QWatch class.
Definition: qwatch.h:17
virtual ~QWatch()
destructor
Definition: qwatch.h:50