itom  4.1.0
pythonStatePublisher.h
1 /* ********************************************************************
2  itom software
3  URL: http://www.uni-stuttgart.de/ito
4  Copyright (C) 2020, Institut fuer Technische Optik (ITO),
5  Universitaet Stuttgart, Germany
6 
7  This file is part of itom.
8 
9  itom is free software; you can redistribute it and/or modify it
10  under the terms of the GNU Library General Public Licence as published by
11  the Free Software Foundation; either version 2 of the Licence, or (at
12  your option) any later version.
13 
14  itom is distributed in the hope that it will be useful, but
15  WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
17  General Public Licence for more details.
18 
19  You should have received a copy of the GNU Library General Public License
20  along with itom. If not, see <http://www.gnu.org/licenses/>.
21 *********************************************************************** */
22 
23 #pragma once
24 
25 #include <qobject.h>
26 #include <qevent.h>
27 
28 #include "../global.h"
29 
30 
31 namespace ito
32 {
33 
34 class PythonEngine;
35 
36 //-------------------------------------------------------------------------------------
57 class PythonStatePublisher : public QObject
58 {
59  Q_OBJECT
60 public:
61 
62  explicit PythonStatePublisher(const PythonEngine *engine);
64 
65 protected:
66  void timerEvent(QTimerEvent *event);
67 
68 private:
70  {
71  DelayedTransition() : timerId(-1) {}
72 
73  int timerId;
74  tPythonTransitions transition;
75  };
76 
77  DelayedTransition m_delayedTrans;
78  int m_delayMs;
79 
80 private Q_SLOTS:
81  void onPythonStateChanged(tPythonTransitions pyTransition, bool immediate);
82  void propertiesChanged();
83 
84 Q_SIGNALS:
85  void pythonStateChanged(tPythonTransitions pyTransition);
86 
87 };
88 
89 } //end namespace ito
90 
Definition: pythonEngine.h:114
One instance of this class is created by MainApplication::setupApplication and runs in the main threa...
Definition: pythonStatePublisher.h:57
int m_delayMs
delay time of non-immediate state changes in ms
Definition: pythonStatePublisher.h:78
Definition: apiFunctionsGraph.cpp:39
int timerId
-1 if no timer is currently set, else the timer id
Definition: pythonStatePublisher.h:73
tPythonTransitions transition
the scheduled transition
Definition: pythonStatePublisher.h:74
Definition: pythonStatePublisher.h:69