itom
Loading...
Searching...
No Matches
pythonPlugins.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 PYTHONPLUGINS
24#define PYTHONPLUGINS
25
26#include <string>
27
28#ifndef Q_MOC_RUN
29 #include "python/pythonWrapper.h"
30#endif
31
32#include "../common/addInInterface.h"
33//#include "pythonQtSignalMapper.h"
34
35namespace ito
36{
37 class PythonQtSignalMapper; //forward declaration
51{
52 public:
53 typedef struct
54 {
55 PyObject_HEAD
56 ito::AddInActuator *actuatorObj;
57 PyObject* base;
58 PyObject *weakreflist; /* List of weak references */
59 PythonQtSignalMapper *signalMapper;
61 }
63
64 typedef struct
65 {
66 PyObject_HEAD
67 ito::AddInDataIO *dataIOObj;
68 PyObject* base;
69 PyObject *weakreflist; /* List of weak references */
70 PythonQtSignalMapper *signalMapper;
72 }
74
75 // Actuator
77 static PyObject *PyActuatorPlugin_new(PyTypeObject *type, PyObject *args, PyObject *kwds);
78 static int PyActuatorPlugin_init(PyActuatorPlugin *self, PyObject *args, PyObject *kwds);
79 static PyObject* PyActuatorPlugin_repr(PyActuatorPlugin *self);
80
81 static PyObject *PyActuatorPlugin_name(PyActuatorPlugin *self);
82 static PyObject *PyActuatorPlugin_getParamList(PyActuatorPlugin *self);
83 static PyObject *PyActuatorPlugin_getParamListInfo(PyActuatorPlugin *self, PyObject *args);
85 static PyObject* PyActuatorPlugin_getExecFuncsInfo(PyActuatorPlugin* self, PyObject *args, PyObject *kwds);
86 static PyObject *PyActuatorPlugin_getParam(PyActuatorPlugin *self, PyObject *args);
87 static PyObject *PyActuatorPlugin_getParamInfo(PyActuatorPlugin *self, PyObject *args);
88 static PyObject *PyActuatorPlugin_setParam(PyActuatorPlugin *self, PyObject *args);
89 static PyObject *PyActuatorPlugin_getType(PyActuatorPlugin *self);
90 static PyObject *PyActuatorPlugin_execFunc(PyActuatorPlugin *self, PyObject *args, PyObject *kwds);
92 static PyObject *PyActuatorPlugin_showToolbox(PyActuatorPlugin *self);
93 static PyObject *PyActuatorPlugin_hideToolbox(PyActuatorPlugin *self);
94
95 static PyObject *PyActuatorPlugin_connect(PyActuatorPlugin *self, PyObject* args, PyObject* kwds);
96 static PyObject *PyActuatorPlugin_disconnect(PyActuatorPlugin *self, PyObject* args, PyObject* kwds);
97 static PyObject *PyActuatorPlugin_info(PyActuatorPlugin *self, PyObject* args);
98 static PyObject *PyActuatorPlugin_setInterrupt(PyActuatorPlugin *self);
99
100 static PyObject *PyActuatorPlugin_calib(PyActuatorPlugin *self, PyObject *args);
101 static PyObject *PyActuatorPlugin_setOrigin(PyActuatorPlugin *self, PyObject *args);
102 static PyObject *PyActuatorPlugin_getStatus(PyActuatorPlugin *self, PyObject *args);
103 static PyObject *PyActuatorPlugin_getPos(PyActuatorPlugin *self, PyObject *args);
104 static PyObject *PyActuatorPlugin_setPosAbs(PyActuatorPlugin *self, PyObject *args);
105 static PyObject *PyActuatorPlugin_setPosRel(PyActuatorPlugin *self, PyObject *args);
106
107 static PyObject *PyActuatorPlugin_userMutex_tryLock(PyActuatorPlugin* self, PyObject* args, PyObject* kwds);
108 static PyObject *PyActuatorPlugin_userMutex_unlock(PyActuatorPlugin* self);
109
110 static PyObject* PyActuatorPlugin_getCurrentStatus(PyActuatorPlugin *self, void *closure);
111 static PyObject* PyActuatorPlugin_getCurrentPositions(PyActuatorPlugin *self, void *closure);
112 static PyObject* PyActuatorPlugin_getTargetPositions(PyActuatorPlugin *self, void *closure);
113
114 static PyMemberDef PyActuatorPlugin_members[];
115 static PyMethodDef PyActuatorPlugin_methods[];
116 static PyGetSetDef PyActuatorPlugin_getseters[];
117 static PyTypeObject PyActuatorPluginType;
118 static PyModuleDef PyActuatorPluginModule;
119
120 static void paramBaseVectorDeleter(QVector<ito::ParamBase> *obj)
121 {
122 delete obj;
123 }
124
125 //DataIO
126 static void PyDataIOPlugin_dealloc(PyDataIOPlugin *self);
127 static PyObject *PyDataIOPlugin_new(PyTypeObject *type, PyObject *args, PyObject *kwds);
128 static int PyDataIOPlugin_init(PyDataIOPlugin *self, PyObject *args, PyObject *kwds);
129 static PyObject* PyDataIOPlugin_repr(PyDataIOPlugin *self);
130
131 static PyObject *PyDataIOPlugin_name(PyDataIOPlugin *self);
132 static PyObject *PyDataIOPlugin_getParamList(PyDataIOPlugin *self);
133 static PyObject* PyDataIOPlugin_getParamListInfo(PyDataIOPlugin* self, PyObject *args);
134 static PyObject* PyDataIOPlugin_getExecFuncsList(PyActuatorPlugin* self);
135 static PyObject* PyDataIOPlugin_getExecFuncsInfo(PyDataIOPlugin* self, PyObject *args, PyObject *kwds);
136 static PyObject *PyDataIOPlugin_getParam(PyDataIOPlugin *self, PyObject *args);
137 static PyObject *PyDataIOPlugin_getParamInfo(PyDataIOPlugin *self, PyObject *args);
138 static PyObject *PyDataIOPlugin_setParam(PyDataIOPlugin *self, PyObject *args);
139 static PyObject *PyDataIOPlugin_getType(PyDataIOPlugin *self);
140 static PyObject *PyDataIOPlugin_execFunc(PyDataIOPlugin *self, PyObject *args, PyObject *kwds);
141 static PyObject *PyDataIOPlugin_showConfiguration(PyDataIOPlugin *self);
142 static PyObject *PyDataIOPlugin_showToolbox(PyDataIOPlugin *self);
143 static PyObject *PyDataIOPlugin_hideToolbox(PyDataIOPlugin *self);
144
145 static PyObject *PyDataIOPlugin_startDevice(PyDataIOPlugin *self, PyObject *args);
146 static PyObject *PyDataIOPlugin_stopDevice(PyDataIOPlugin *self, PyObject *args);
147 static PyObject *PyDataIOPlugin_acquire(PyDataIOPlugin *self, PyObject *args);
148 static PyObject *PyDataIOPlugin_stop(PyDataIOPlugin *self);
149 static PyObject *PyDataIOPlugin_getVal(PyDataIOPlugin *self, PyObject *args);
150 static PyObject *PyDataIOPlugin_copyVal(PyDataIOPlugin *self, PyObject *args);
151 static PyObject *PyDataIOPlugin_setVal(PyDataIOPlugin *self, PyObject *args, PyObject* kwds);
152 static PyObject *PyDataIOPlugin_enableAutoGrabbing(PyDataIOPlugin *self, PyObject *args);
153 static PyObject *PyDataIOPlugin_disableAutoGrabbing(PyDataIOPlugin *self, PyObject *args);
154 static PyObject *PyDataIOPlugin_setAutoGrabbing(PyDataIOPlugin *self, PyObject *args);
155 static PyObject *PyDataIOPlugin_getAutoGrabbing(PyDataIOPlugin *self, PyObject *args);
156 static PyObject *PyDataIOPlugin_setAutoGrabbingInterval(PyDataIOPlugin *self, PyObject *args);
157 static PyObject *PyDataIOPlugin_getAutoGrabbingInterval(PyDataIOPlugin *self);
158 static PyObject *PyDataIOPlugin_connect(PyDataIOPlugin *self, PyObject *args, PyObject* kwds);
159 static PyObject *PyDataIOPlugin_disconnect(PyDataIOPlugin *self, PyObject *args, PyObject* kwds);
160 static PyObject *PyDataIOPlugin_info(PyDataIOPlugin* self, PyObject* args);
161
162 static PyObject *PyDataIOPlugin_userMutex_tryLock(PyDataIOPlugin* self, PyObject* args, PyObject* kwds);
163 static PyObject *PyDataIOPlugin_userMutex_unlock(PyDataIOPlugin* self);
164
165 static PyMemberDef PyDataIOPlugin_members[];
166 static PyMethodDef PyDataIOPlugin_methods[];
167 static PyTypeObject PyDataIOPluginType;
168 static PyModuleDef PyDataIOPluginModule;
169 static void PyDataIOPlugin_addTpDict(PyObject *tp_dict);
170 static void PyActuatorPlugin_addTpDict(PyObject* tp_dict);
171
172};
173
174} //end namespace ito
175
176#endif
base class for all actuator plugin classes
Definition addInInterface.h:739
base class for all dataIO plugin classes
Definition addInInterface.h:662
class summing up the functionality of itom - hardware python plugins
Definition pythonPlugins.h:51
static PyObject * PyActuatorPlugin_getExecFuncsInfo(PyActuatorPlugin *self, PyObject *args, PyObject *kwds)
Definition pythonPlugins.cpp:1719
static PyObject * PyDataIOPlugin_acquire(PyDataIOPlugin *self, PyObject *args)
Definition pythonPlugins.cpp:3850
static PyObject * PyActuatorPlugin_getParamInfo(PyActuatorPlugin *self, PyObject *args)
Definition pythonPlugins.cpp:1763
static PyObject * PyDataIOPlugin_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
Definition pythonPlugins.cpp:3273
static PyObject * PyDataIOPlugin_getParamList(PyDataIOPlugin *self)
Definition pythonPlugins.cpp:3505
static PyObject * PyDataIOPlugin_copyVal(PyDataIOPlugin *self, PyObject *args)
Definition pythonPlugins.cpp:4166
static PyObject * PyDataIOPlugin_setVal(PyDataIOPlugin *self, PyObject *args, PyObject *kwds)
Definition pythonPlugins.cpp:4315
static PyObject * PyDataIOPlugin_showToolbox(PyDataIOPlugin *self)
Definition pythonPlugins.cpp:5224
static PyObject * PyActuatorPlugin_setOrigin(PyActuatorPlugin *self, PyObject *args)
Definition pythonPlugins.cpp:1889
static PyObject * PyActuatorPlugin_showToolbox(PyActuatorPlugin *self)
Definition pythonPlugins.cpp:2294
static PyObject * PyDataIOPlugin_startDevice(PyDataIOPlugin *self, PyObject *args)
Definition pythonPlugins.cpp:3626
static PyObject * PyDataIOPlugin_stopDevice(PyDataIOPlugin *self, PyObject *args)
Definition pythonPlugins.cpp:3720
static PyObject * PyDataIOPlugin_setParam(PyDataIOPlugin *self, PyObject *args)
Definition pythonPlugins.cpp:3575
static PyObject * PyDataIOPlugin_getExecFuncsInfo(PyDataIOPlugin *self, PyObject *args, PyObject *kwds)
Definition pythonPlugins.cpp:3546
static PyObject * PyDataIOPlugin_getParamListInfo(PyDataIOPlugin *self, PyObject *args)
Definition pythonPlugins.cpp:3519
static PyObject * PyDataIOPlugin_getAutoGrabbing(PyDataIOPlugin *self, PyObject *args)
Definition pythonPlugins.cpp:4729
static PyObject * PyDataIOPlugin_getParam(PyDataIOPlugin *self, PyObject *args)
Definition pythonPlugins.cpp:3561
static PyObject * PyActuatorPlugin_setPosAbs(PyActuatorPlugin *self, PyObject *args)
Definition pythonPlugins.cpp:2723
static PyObject * PyActuatorPlugin_getType(PyActuatorPlugin *self)
Definition pythonPlugins.cpp:2243
static PyObject * PyDataIOPlugin_getType(PyDataIOPlugin *self)
Definition pythonPlugins.cpp:5065
static PyObject * PyDataIOPlugin_enableAutoGrabbing(PyDataIOPlugin *self, PyObject *args)
Definition pythonPlugins.cpp:4502
static PyObject * PyActuatorPlugin_setParam(PyActuatorPlugin *self, PyObject *args)
Definition pythonPlugins.cpp:1750
static PyObject * PyActuatorPlugin_getStatus(PyActuatorPlugin *self, PyObject *args)
Definition pythonPlugins.cpp:2010
static PyObject * PyActuatorPlugin_hideToolbox(PyActuatorPlugin *self)
Definition pythonPlugins.cpp:2604
static PyObject * PyDataIOPlugin_hideToolbox(PyDataIOPlugin *self)
Definition pythonPlugins.cpp:5236
static void PyActuatorPlugin_dealloc(PyActuatorPlugin *self)
Definition pythonPlugins.cpp:1370
static PyObject * PyDataIOPlugin_showConfiguration(PyDataIOPlugin *self)
Definition pythonPlugins.cpp:5212
static PyObject * PyDataIOPlugin_name(PyDataIOPlugin *self)
Definition pythonPlugins.cpp:3461
static PyObject * PyActuatorPlugin_setInterrupt(PyActuatorPlugin *self)
Definition pythonPlugins.cpp:2310
static PyObject * PyDataIOPlugin_getExecFuncsList(PyActuatorPlugin *self)
Definition pythonPlugins.cpp:3533
static int PyActuatorPlugin_init(PyActuatorPlugin *self, PyObject *args, PyObject *kwds)
Definition pythonPlugins.cpp:1487
static PyObject * PyActuatorPlugin_getPos(PyActuatorPlugin *self, PyObject *args)
Definition pythonPlugins.cpp:2135
static PyObject * PyActuatorPlugin_setPosRel(PyActuatorPlugin *self, PyObject *args)
Definition pythonPlugins.cpp:2832
static PyObject * PyActuatorPlugin_getParamList(PyActuatorPlugin *self)
Definition pythonPlugins.cpp:1675
static PyObject * PyDataIOPlugin_disableAutoGrabbing(PyDataIOPlugin *self, PyObject *args)
Definition pythonPlugins.cpp:4576
static PyObject * PyDataIOPlugin_stop(PyDataIOPlugin *self)
Definition pythonPlugins.cpp:3913
static PyObject * PyActuatorPlugin_calib(PyActuatorPlugin *self, PyObject *args)
Definition pythonPlugins.cpp:1796
static PyObject * PyActuatorPlugin_getExecFuncsList(PyActuatorPlugin *self)
Definition pythonPlugins.cpp:1704
static PyObject * PyDataIOPlugin_getVal(PyDataIOPlugin *self, PyObject *args)
Definition pythonPlugins.cpp:4010
static PyObject * PyActuatorPlugin_showConfiguration(PyActuatorPlugin *self)
Definition pythonPlugins.cpp:2280
static PyObject * PyActuatorPlugin_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
Definition pythonPlugins.cpp:1428
static PyObject * PyActuatorPlugin_getParamListInfo(PyActuatorPlugin *self, PyObject *args)
Definition pythonPlugins.cpp:1690
static PyObject * PyActuatorPlugin_name(PyActuatorPlugin *self)
Definition pythonPlugins.cpp:1661
static void PyDataIOPlugin_dealloc(PyDataIOPlugin *self)
Definition pythonPlugins.cpp:3216
static int PyDataIOPlugin_init(PyDataIOPlugin *self, PyObject *args, PyObject *kwds)
Definition pythonPlugins.cpp:3330
static PyObject * PyActuatorPlugin_getParam(PyActuatorPlugin *self, PyObject *args)
Definition pythonPlugins.cpp:1736
static PyObject * PyDataIOPlugin_getParamInfo(PyDataIOPlugin *self, PyObject *args)
Definition pythonPlugins.cpp:3588
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 pythonPlugins.h:54
bool userMutexLocked
true if the user mutex has been recently locked by Python
Definition pythonPlugins.h:60
Definition pythonPlugins.h:65
bool userMutexLocked
true if the user mutex has been recently locked by Python
Definition pythonPlugins.h:71