itom 2.0.0
D:/git-itom/sources/itom/Qitom/python/pythonPlugins.h
00001 /* ********************************************************************
00002     itom software
00003     URL: http://www.uni-stuttgart.de/ito
00004     Copyright (C) 2013, Institut fuer Technische Optik (ITO),
00005     Universitaet Stuttgart, Germany
00006 
00007     This file is part of itom.
00008   
00009     itom is free software; you can redistribute it and/or modify it
00010     under the terms of the GNU Library General Public Licence as published by
00011     the Free Software Foundation; either version 2 of the Licence, or (at
00012     your option) any later version.
00013 
00014     itom is distributed in the hope that it will be useful, but
00015     WITHOUT ANY WARRANTY; without even the implied warranty of
00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library
00017     General Public Licence for more details.
00018 
00019     You should have received a copy of the GNU Library General Public License
00020     along with itom. If not, see <http://www.gnu.org/licenses/>.
00021 *********************************************************************** */
00022 
00023 #ifndef PYTHONPLUGINS
00024 #define PYTHONPLUGINS
00025 
00026 #include <string>
00027 
00028 #ifndef Q_MOC_RUN
00029     /* includes */
00030     //python
00031     // see http://vtk.org/gitweb?p=VTK.git;a=commitdiff;h=7f3f750596a105d48ea84ebfe1b1c4ca03e0bab3
00032     #if (defined _DEBUG) && (defined WIN32)
00033         #undef _DEBUG
00034         #include "Python.h"
00035         #define _DEBUG
00036     #else
00037         #include "Python.h"
00038     #endif
00039 #endif
00040 
00041 #include "../common/addInInterface.h"
00042 
00043 namespace ito
00044 {
00045 
00058 class PythonPlugins
00059 {
00060    public:
00061        typedef struct
00062        {
00063            PyObject_HEAD
00064            ito::AddInActuator *actuatorObj;
00065            PyObject* base;
00066            PyObject *weakreflist; /* List of weak references */
00067        }
00068        PyActuatorPlugin;
00069 
00070        typedef struct
00071        {
00072            PyObject_HEAD
00073            ito::AddInDataIO *dataIOObj;
00074            PyObject* base;
00075            PyObject *weakreflist; /* List of weak references */
00076        }
00077        PyDataIOPlugin;
00078        
00079        // Actuator
00080        static void PyActuatorPlugin_dealloc(PyActuatorPlugin *self);
00081        static PyObject *PyActuatorPlugin_new(PyTypeObject *type, PyObject *args, PyObject *kwds);
00082        static int PyActuatorPlugin_init(PyActuatorPlugin *self, PyObject *args, PyObject *kwds);
00083        static PyObject* PyActuatorPlugin_repr(PyActuatorPlugin *self);
00084 
00085        static PyObject *PyActuatorPlugin_name(PyActuatorPlugin *self);
00086        static PyObject *PyActuatorPlugin_getParamList(PyActuatorPlugin *self);
00087        static PyObject *PyActuatorPlugin_getParamListInfo(PyActuatorPlugin *self,  PyObject *args);
00088        static PyObject* PyActuatorPlugin_getExecFuncsInfo(PyActuatorPlugin* self, PyObject *args, PyObject *kwds);
00089        static PyObject *PyActuatorPlugin_getParam(PyActuatorPlugin *self, PyObject *args);
00090        static PyObject *PyActuatorPlugin_getParamInfo(PyActuatorPlugin *self, PyObject *args);
00091        static PyObject *PyActuatorPlugin_setParam(PyActuatorPlugin *self, PyObject *args);
00092        static PyObject *PyActuatorPlugin_getType(PyActuatorPlugin *self);
00093        static PyObject *PyActuatorPlugin_execFunc(PyActuatorPlugin *self, PyObject *args, PyObject *kwds);
00094        static PyObject *PyActuatorPlugin_showConfiguration(PyActuatorPlugin *self);
00095        static PyObject *PyActuatorPlugin_showToolbox(PyActuatorPlugin *self);
00096        static PyObject *PyActuatorPlugin_hideToolbox(PyActuatorPlugin *self);
00097 
00098        static PyObject *PyActuatorPlugin_setInterrupt(PyActuatorPlugin *self);
00099 
00100        static PyObject *PyActuatorPlugin_calib(PyActuatorPlugin *self, PyObject *args);
00101        static PyObject *PyActuatorPlugin_setOrigin(PyActuatorPlugin *self, PyObject *args);
00102        static PyObject *PyActuatorPlugin_getStatus(PyActuatorPlugin *self, PyObject *args);
00103        static PyObject *PyActuatorPlugin_getPos(PyActuatorPlugin *self, PyObject *args);
00104        static PyObject *PyActuatorPlugin_setPosAbs(PyActuatorPlugin *self, PyObject *args);
00105        static PyObject *PyActuatorPlugin_setPosRel(PyActuatorPlugin *self, PyObject *args);
00106 
00107        static PyMemberDef  PyActuatorPlugin_members[];
00108        static PyMethodDef  PyActuatorPlugin_methods[];
00109        static PyTypeObject PyActuatorPluginType;
00110        static PyModuleDef  PyActuatorPluginModule;
00111 
00112        static void paramBaseVectorDeleter(QVector<ito::ParamBase> *obj)
00113        {
00114            delete obj;
00115        }
00116 
00117        //DataIO
00118        static void PyDataIOPlugin_dealloc(PyDataIOPlugin *self);
00119        static PyObject *PyDataIOPlugin_new(PyTypeObject *type, PyObject *args, PyObject *kwds);
00120        static int PyDataIOPlugin_init(PyDataIOPlugin *self, PyObject *args, PyObject *kwds);
00121        static PyObject* PyDataIOPlugin_repr(PyDataIOPlugin *self);
00122 
00123        static PyObject *PyDataIOPlugin_name(PyDataIOPlugin *self);
00124        static PyObject *PyDataIOPlugin_getParamList(PyDataIOPlugin *self);
00125        static PyObject* PyDataIOPlugin_getParamListInfo(PyDataIOPlugin* self,  PyObject *args);
00126        static PyObject* PyDataIOPlugin_getExecFuncsInfo(PyDataIOPlugin* self, PyObject *args, PyObject *kwds);
00127        static PyObject *PyDataIOPlugin_getParam(PyDataIOPlugin *self, PyObject *args);
00128        static PyObject *PyDataIOPlugin_getParamInfo(PyDataIOPlugin *self, PyObject *args);
00129        static PyObject *PyDataIOPlugin_setParam(PyDataIOPlugin *self, PyObject *args);
00130        static PyObject *PyDataIOPlugin_getType(PyDataIOPlugin *self);
00131        static PyObject *PyDataIOPlugin_execFunc(PyDataIOPlugin *self, PyObject *args, PyObject *kwds);
00132        static PyObject *PyDataIOPlugin_showConfiguration(PyDataIOPlugin *self);
00133        static PyObject *PyDataIOPlugin_showToolbox(PyDataIOPlugin *self);
00134        static PyObject *PyDataIOPlugin_hideToolbox(PyDataIOPlugin *self);
00135 
00136        static PyObject *PyDataIOPlugin_startDevice(PyDataIOPlugin *self, PyObject *args);
00137        static PyObject *PyDataIOPlugin_stopDevice(PyDataIOPlugin *self, PyObject *args);
00138        static PyObject *PyDataIOPlugin_acquire(PyDataIOPlugin *self, PyObject *args);
00139        static PyObject *PyDataIOPlugin_getVal(PyDataIOPlugin *self, PyObject *args);
00140        static PyObject *PyDataIOPlugin_copyVal(PyDataIOPlugin *self, PyObject *args);
00141        static PyObject *PyDataIOPlugin_setVal(PyDataIOPlugin *self, PyObject *args);
00142        static PyObject *PyDataIOPlugin_enableAutoGrabbing(PyDataIOPlugin *self, PyObject *args);
00143        static PyObject *PyDataIOPlugin_disableAutoGrabbing(PyDataIOPlugin *self, PyObject *args);
00144        static PyObject *PyDataIOPlugin_setAutoGrabbing(PyDataIOPlugin *self, PyObject *args);
00145        static PyObject *PyDataIOPlugin_getAutoGrabbing(PyDataIOPlugin *self, PyObject *args);
00146        
00147        static PyMemberDef  PyDataIOPlugin_members[];
00148        static PyMethodDef  PyDataIOPlugin_methods[];
00149        static PyTypeObject PyDataIOPluginType;
00150        static PyModuleDef  PyDataIOPluginModule;
00151        static void PyDataIOPlugin_addTpDict(PyObject *tp_dict);
00152 
00153 };
00154 
00155 } //end namespace ito
00156 
00157 #endif
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends