itom 1.1.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 /* includes */
00028 //python
00029 // see http://vtk.org/gitweb?p=VTK.git;a=commitdiff;h=7f3f750596a105d48ea84ebfe1b1c4ca03e0bab3
00030 #if (defined _DEBUG) && (!defined linux)
00031     #undef _DEBUG
00032     #include "Python.h"
00033     #define _DEBUG
00034 #else
00035     #include "Python.h"
00036 #endif
00037 
00038 #include "../common/addInInterface.h"
00039 
00040 namespace ito
00041 {
00042 
00055 class PythonPlugins
00056 {
00057    public:
00058        typedef struct
00059        {
00060            PyObject_HEAD
00061            ito::AddInActuator *actuatorObj;
00062            PyObject* base;
00063        }
00064        PyActuatorPlugin;
00065 
00066        typedef struct
00067        {
00068            PyObject_HEAD
00069            ito::AddInDataIO *dataIOObj;
00070            PyObject* base;
00071        }
00072        PyDataIOPlugin;
00073 
00074 #if 0 //algo plugins do not exist as instances, they only contain static methods, callable by itom.filter
00075        typedef struct
00076        {
00077            PyObject_HEAD
00078            ito::AddInAlgo *algoObj;
00079            PyObject* base;
00080        }
00081        PyAlgoPlugin;
00082 #endif
00083        
00084        // Actuator
00085        static void PyActuatorPlugin_dealloc(PyActuatorPlugin *self);
00086        static PyObject *PyActuatorPlugin_new(PyTypeObject *type, PyObject *args, PyObject *kwds);
00087        static int PyActuatorPlugin_init(PyActuatorPlugin *self, PyObject *args, PyObject *kwds);
00088        static PyObject* PyActuatorPlugin_repr(PyActuatorPlugin *self);
00089 
00090        static PyObject *PyActuatorPlugin_name(PyActuatorPlugin *self);
00091        static PyObject *PyActuatorPlugin_getParamList(PyActuatorPlugin *self);
00092        static PyObject *PyActuatorPlugin_getParamListInfo(PyActuatorPlugin *self,  PyObject *args);
00093        static PyObject* PyActuatorPlugin_getExecFuncsInfo(PyActuatorPlugin* self, PyObject *args, PyObject *kwds);
00094        static PyObject *PyActuatorPlugin_getParam(PyActuatorPlugin *self, PyObject *args);
00095        static PyObject *PyActuatorPlugin_setParam(PyActuatorPlugin *self, PyObject *args);
00096        static PyObject *PyActuatorPlugin_getType(PyActuatorPlugin *self);
00097        static PyObject *PyActuatorPlugin_execFunc(PyActuatorPlugin *self, PyObject *args, PyObject *kwds);
00098        static PyObject *PyActuatorPlugin_showConfiguration(PyActuatorPlugin *self);
00099        static PyObject *PyActuatorPlugin_showToolbox(PyActuatorPlugin *self);
00100        static PyObject *PyActuatorPlugin_hideToolbox(PyActuatorPlugin *self);
00101 
00102        static PyObject *PyActuatorPlugin_calib(PyActuatorPlugin *self, PyObject *args);
00103        static PyObject *PyActuatorPlugin_setOrigin(PyActuatorPlugin *self, PyObject *args);
00104        static PyObject *PyActuatorPlugin_getStatus(PyActuatorPlugin *self, PyObject *args);
00105        static PyObject *PyActuatorPlugin_getPos(PyActuatorPlugin *self, PyObject *args);
00106        static PyObject *PyActuatorPlugin_setPosAbs(PyActuatorPlugin *self, PyObject *args);
00107        static PyObject *PyActuatorPlugin_setPosRel(PyActuatorPlugin *self, PyObject *args);
00108 
00109        static PyMemberDef  PyActuatorPlugin_members[];
00110        static PyMethodDef  PyActuatorPlugin_methods[];
00111        static PyTypeObject PyActuatorPluginType;
00112        static PyModuleDef  PyActuatorPluginModule;
00113 
00114        // pending for deletion
00115 /*
00116        // Actuator axis
00117        static void PyActuatorAxis_dealloc(PyActuatorAxis *self);
00118        static PyObject *PyActuatorAxis_new(PyTypeObject *type, PyObject *args, PyObject *kwds);
00119        static int PyActuatorAxis_init(PyActuatorAxis *self, PyObject *args, PyObject *kwds);
00120 
00121        static PyObject *PyActuatorAxis_getStatus(PyActuatorAxis *self, PyObject *args);
00122        static PyObject *PyActuatorAxis_getPos(PyActuatorAxis *self, PyObject *args);
00123        static PyObject *PyActuatorAxis_setPosAbs(PyActuatorAxis *self, PyObject *args);
00124        static PyObject *PyActuatorAxis_setPosRel(PyActuatorAxis *self, PyObject *args);
00125       
00126        static PyMemberDef  PyActuatorAxis_members[];
00127        static PyMethodDef  PyActuatorAxis_methods[];
00128        static PyTypeObject PyActuatorAxisType;
00129        static PyModuleDef  PyActuatorAxisModule;
00130 */
00131        //DataIO
00132        static void PyDataIOPlugin_dealloc(PyDataIOPlugin *self);
00133        static PyObject *PyDataIOPlugin_new(PyTypeObject *type, PyObject *args, PyObject *kwds);
00134        static int PyDataIOPlugin_init(PyDataIOPlugin *self, PyObject *args, PyObject *kwds);
00135        static PyObject* PyDataIOPlugin_repr(PyDataIOPlugin *self);
00136 
00137        static PyObject *PyDataIOPlugin_name(PyDataIOPlugin *self);
00138        static PyObject *PyDataIOPlugin_getParamList(PyDataIOPlugin *self);
00139        static PyObject* PyDataIOPlugin_getParamListInfo(PyDataIOPlugin* self,  PyObject *args);
00140        static PyObject* PyDataIOPlugin_getExecFuncsInfo(PyDataIOPlugin* self, PyObject *args, PyObject *kwds);
00141        static PyObject *PyDataIOPlugin_getParam(PyDataIOPlugin *self, PyObject *args);
00142        static PyObject *PyDataIOPlugin_setParam(PyDataIOPlugin *self, PyObject *args);
00143        static PyObject *PyDataIOPlugin_getType(PyDataIOPlugin *self);
00144        static PyObject *PyDataIOPlugin_execFunc(PyDataIOPlugin *self, PyObject *args, PyObject *kwds);
00145        static PyObject *PyDataIOPlugin_showConfiguration(PyDataIOPlugin *self);
00146        static PyObject *PyDataIOPlugin_showToolbox(PyDataIOPlugin *self);
00147        static PyObject *PyDataIOPlugin_hideToolbox(PyDataIOPlugin *self);
00148 
00149        static PyObject *PyDataIOPlugin_startDevice(PyDataIOPlugin *self, PyObject *args);
00150        static PyObject *PyDataIOPlugin_stopDevice(PyDataIOPlugin *self, PyObject *args);
00151        static PyObject *PyDataIOPlugin_acquire(PyDataIOPlugin *self, PyObject *args);
00152        static PyObject *PyDataIOPlugin_getVal(PyDataIOPlugin *self, PyObject *args);
00153        static PyObject *PyDataIOPlugin_copyVal(PyDataIOPlugin *self, PyObject *args);
00154        static PyObject *PyDataIOPlugin_setVal(PyDataIOPlugin *self, PyObject *args);
00155        static PyObject *PyDataIOPlugin_enableAutoGrabbing(PyDataIOPlugin *self, PyObject *args);
00156        static PyObject *PyDataIOPlugin_disableAutoGrabbing(PyDataIOPlugin *self, PyObject *args);
00157        static PyObject *PyDataIOPlugin_setAutoGrabbing(PyDataIOPlugin *self, PyObject *args);
00158        static PyObject *PyDataIOPlugin_getAutoGrabbing(PyDataIOPlugin *self, PyObject *args);
00159        
00160        static PyMemberDef  PyDataIOPlugin_members[];
00161        static PyMethodDef  PyDataIOPlugin_methods[];
00162        static PyTypeObject PyDataIOPluginType;
00163        static PyModuleDef  PyDataIOPluginModule;
00164        static void PyDataIOPlugin_addTpDict(PyObject *tp_dict);
00165 
00166 #if 0 //algo plugins do not exist as instances, they only contain static methods, callable by itom.filter
00167        // Algo
00168        static void PyAlgoPlugin_dealloc(PyAlgoPlugin *self);
00169        static PyObject *PyAlgoPlugin_new(PyTypeObject *type, PyObject *args, PyObject *kwds);
00170        static int PyAlgoPlugin_init(PyAlgoPlugin *self, PyObject *args, PyObject *kwds);
00171        static PyObject *PyAlgoPlugin_name(PyAlgoPlugin *self);
00172        static PyObject *PyAlgoPlugin_getParamList(PyAlgoPlugin *self);
00173        static PyObject *PyAlgoPlugin_getParamListInfo(PyAlgoPlugin *self, PyObject *args);
00174        static PyObject* PyAlgoPlugin_getExecFuncsInfo(PyAlgoPlugin* self, PyObject *args, PyObject *kwds);
00175        static PyObject *PyAlgoPlugin_getParam(PyAlgoPlugin *self, PyObject *args);
00176        static PyObject *PyAlgoPlugin_setParam(PyAlgoPlugin *self, PyObject *args);
00177        static PyObject *PyAlgoPlugin_getType(PyAlgoPlugin *self);
00178 
00179        static PyMemberDef  PyAlgoPlugin_members[];
00180        static PyMethodDef  PyAlgoPlugin_methods[];
00181        static PyTypeObject PyAlgoPluginType;
00182        static PyModuleDef  PyAlgoPluginModule;
00183 #endif
00184 };
00185 
00186 } //end namespace ito
00187 
00188 #endif
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends