itom
Loading...
Searching...
No Matches
pluginThreadCtrl.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 and its software development toolkit (SDK).
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 In addition, as a special exception, the Institut für Technische
15 Optik (ITO) gives you certain additional rights.
16 These rights are described in the ITO LGPL Exception version 1.0,
17 which can be found in the file LGPL_EXCEPTION.txt in this package.
18
19 itom is distributed in the hope that it will be useful, but
20 WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
22 General Public Licence for more details.
23
24 You should have received a copy of the GNU Library General Public License
25 along with itom. If not, see <http://www.gnu.org/licenses/>.
26*********************************************************************** */
27
28#ifndef PLUGINTHREADCTRL_H
29#define PLUGINTHREADCTRL_H
30
31#include "typeDefs.h"
32#include "addInInterface.h"
33#include "sharedStructures.h"
34
35#if !defined(Q_MOC_RUN) || defined(ITOMCOMMONQT_MOC) //only moc this file in itomCommonQtLib but not in other libraries or executables linking against this itomCommonQtLib
36
37namespace ito
38{
39
40//----------------------------------------------------------------------------------------------------------------------------------
49class ITOMCOMMONQT_EXPORT PluginThreadCtrl
50{
51protected:
55public:
58
60
71 PluginThreadCtrl(const ito::ParamBase &pluginParameter, ito::RetVal *retval = NULL);
72
74
83 PluginThreadCtrl(ito::AddInBase *plugin, ito::RetVal *retval = NULL);
84
87
89 virtual ~PluginThreadCtrl();
90
92 PluginThreadCtrl& operator =(const PluginThreadCtrl &other);
93
94 ito::RetVal getParam(ito::Param &val, int timeOutMS = PLUGINWAIT);
95 ito::RetVal setParam(ito::ParamBase val, int timeOutMS = PLUGINWAIT);
97 ito::RetVal waitForSemaphore(int timeOutMS = PLUGINWAIT);
98};
99
100
101//-----------------------------------------------------------------------------------
149class ITOMCOMMONQT_EXPORT DataIOThreadCtrl : public PluginThreadCtrl
150{
151public:
154
156
167 DataIOThreadCtrl(const ito::ParamBase &pluginParameter, ito::RetVal *retval = NULL);
168
170
179 DataIOThreadCtrl(ito::AddInDataIO *plugin, ito::RetVal *retval = NULL);
180
183
185 virtual ~DataIOThreadCtrl();
186
187 ito::RetVal startDevice(int timeOutMS = PLUGINWAIT);
188 ito::RetVal stopDevice(int timeOutMS = PLUGINWAIT);
189 ito::RetVal acquire(const int trigger = 0, int timeOutMS = PLUGINWAIT);
190 ito::RetVal getVal(ito::DataObject &dObj, int timeOutMS = PLUGINWAIT);
191 ito::RetVal copyVal(ito::DataObject &dObj, int timeOutMS = PLUGINWAIT);
192 ito::RetVal enableAutoGrabbing(int timeOutMS = PLUGINWAIT);
193 ito::RetVal disableAutoGrabbing(int timeOutMS = PLUGINWAIT);
194 ito::RetVal setAutoGrabbingInterval(QSharedPointer<int> interval, int timeOutMS = PLUGINWAIT);
195 bool getAutoGrabbing();
197 ito::RetVal getImageParams(int &bpp, int &sizex, int &sizey, int timeOutMS = PLUGINWAIT);
198};
199
200//-----------------------------------------------------------------------------------
239class ITOMCOMMONQT_EXPORT ActuatorThreadCtrl : public PluginThreadCtrl
240{
241protected:
242 int m_numAxes;
243
244public:
247
249
260 ActuatorThreadCtrl(const ito::ParamBase &pluginParameter, ito::RetVal *retval = NULL);
261
263
272 ActuatorThreadCtrl(ito::AddInActuator *plugin, ito::RetVal *retval = NULL);
273
276
278 virtual ~ActuatorThreadCtrl();
279
280 ito::RetVal setPosRel(const QVector<int> &axes, const QVector<double> &relPositions, int timeOutMS = PLUGINWAIT);
281 ito::RetVal setPosAbs(const QVector<int> &axes, const QVector<double> &absPositions, int timeOutMS = PLUGINWAIT);
282 ito::RetVal setPosRel(int axis, double relPosition, int timeOutMS = PLUGINWAIT);
283 ito::RetVal setPosAbs(int axis, double absPosition, int timeOutMS = PLUGINWAIT);
285 ito::RetVal getPos(QVector<int> axes, QVector<double> &positions, int timeOutMS = PLUGINWAIT);
286 ito::RetVal getPos(int axis, double &position, int timeOutMS = PLUGINWAIT);
289 ito::RetVal checkAxis(int axisNum);
290};
291
292} // end namespace ito
293
294#endif //#if !defined(Q_MOC_RUN) || defined(ITOMCOMMONQT_MOC)
295#endif //PLUGINTHREADCTRL_H
Locker-class for ItomSharedSemaphore. The functionality is equal to QMutexLocker in Qt....
Definition sharedStructuresQt.h:233
Helper class to give plugin developers an easy access to actuators in other threads.
Definition pluginThreadCtrl.h:240
base class for all actuator plugin classes
Definition addInInterface.h:739
Base class for all plugins.
Definition addInInterface.h:386
base class for all dataIO plugin classes
Definition addInInterface.h:662
Helper class to give plugin developers an easy access to cameras in other threads.
Definition pluginThreadCtrl.h:150
dataObject contains a n-dimensional matrix
Definition dataobj.h:591
<
Definition param.h:95
class for parameter handling e.g. to pass parameters to plugins
Definition param.h:477
Base class for DataIOThreadCtrl and ActuatorThreadCtrl.
Definition pluginThreadCtrl.h:50
ito::AddInBase * m_pPlugin
Definition pluginThreadCtrl.h:52
ItomSharedSemaphoreLocker m_semaphoreLocker
Definition pluginThreadCtrl.h:53
Class for managing status values (like errors or warning)
Definition retVal.h:54
Definition apiFunctionsGraph.cpp:40
PyObject * setParam(ito::AddInBase *addInObj, PyObject *args)
Definition pythonPlugins.cpp:1249
PyObject * getParam(ito::AddInBase *addInObj, PyObject *args)
Definition pythonPlugins.cpp:770