itom
Loading...
Searching...
No Matches
pythonProgressObserver.h
1/* ********************************************************************
2 itom software
3 URL: http://www.uni-stuttgart.de/ito
4 Copyright (C) 2020, Institut für Technische Optik (ITO),
5 Universität 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#ifndef PYTHONPROGRESSOBSERVER_H
24#define PYTHONPROGRESSOBSERVER_H
25
26/* includes */
27#ifndef Q_MOC_RUN
28 #define PY_ARRAY_UNIQUE_SYMBOL itom_ARRAY_API //see numpy help ::array api :: Miscellaneous :: Importing the api (this line must before include global.h)
29 #define NO_IMPORT_ARRAY
30
31 #include "python/pythonWrapper.h"
32#endif
33
34#include "common/functionCancellationAndObserver.h"
35#include <qsharedpointer.h>
36
37namespace ito
38{
39
40class PythonQtSignalMapper; //forward declaration
41
43{
44public:
45 typedef struct
46 {
47 PyObject_HEAD
48 QSharedPointer<ito::FunctionCancellationAndObserver> *progressObserver;
49 PythonQtSignalMapper *signalMapper;
50 }
52
53 #define PyProgressObserver_Check(op) PyObject_TypeCheck(op, &ito::PythonProgressObserver::PyProgressObserverType)
54
55 //-------------------------------------------------------------------------------------------------
56 // constructor, deconstructor, alloc, dellaoc
57 //-------------------------------------------------------------------------------------------------
58 static void PyProgressObserver_dealloc(PyProgressObserver *self);
59 static PyObject* PyProgressObserver_new(PyTypeObject *type, PyObject *args, PyObject *kwds);
60 static int PyProgressObserver_init(PyProgressObserver *self, PyObject *args, PyObject *kwds);
61
62 //-------------------------------------------------------------------------------------------------
63 // general members
64 //-------------------------------------------------------------------------------------------------
65 static PyObject* PyProgressObserver_repr(PyProgressObserver *self);
66 static PyObject* PyProgressObserver_requestCancellation(PyProgressObserver *self);
67 static PyObject* PyProgressObserver_reset(PyProgressObserver *self);
68
69 static PyObject* PyProgressObserver_connect(PyProgressObserver *self, PyObject* args, PyObject *kwds);
70 static PyObject* PyProgressObserver_disconnect(PyProgressObserver *self, PyObject* args, PyObject *kwds);
71 static PyObject* PyProgressObserver_info(PyProgressObserver* self, PyObject* args);
72
73 //-------------------------------------------------------------------------------------------------
74 // getter / setter
75 //-------------------------------------------------------------------------------------------------
76 static PyObject* PyProgressObserver_getProgressMinimum(PyProgressObserver *self, void *closure);
77 static int PyProgressObserver_setProgressMinimum(PyProgressObserver *self, PyObject *value, void *closure);
78
79 static PyObject* PyProgressObserver_getProgressMaximum(PyProgressObserver *self, void *closure);
80 static int PyProgressObserver_setProgressMaximum(PyProgressObserver *self, PyObject *value, void *closure);
81
82 static PyObject* PyProgressObserver_getProgressValue(PyProgressObserver *self, void *closure);
83 static int PyProgressObserver_setProgressValue(PyProgressObserver *self, PyObject *value, void *closure);
84
85 static PyObject* PyProgressObserver_getProgressText(PyProgressObserver *self, void *closure);
86 static int PyProgressObserver_setProgressText(PyProgressObserver *self, PyObject *value, void *closure);
87
88 static PyObject* PyProgressObserver_isCancelled(PyProgressObserver *self, void *closure);
89
90 //-------------------------------------------------------------------------------------------------
91 // type structures
92 //-------------------------------------------------------------------------------------------------
93 //static PyMemberDef PyProgressObserver_members[];
94 static PyMethodDef PyProgressObserver_methods[];
95 static PyGetSetDef PyProgressObserver_getseters[];
96 static PyTypeObject PyProgressObserverType;
97 static PyModuleDef PyProgressObserverModule;
98
99 static void PyProgressObserver_addTpDict(PyObject *tp_dict);
100};
101
102}; //end namespace ito
103
104
105#endif
Definition pythonProgressObserver.h:43
This class provides the possibility to redirect any signal emitted in an user-defined GUI to differen...
Definition pythonQtSignalMapper.h:162
Definition apiFunctionsGraph.cpp:40
Definition pythonProgressObserver.h:46