itom 1.4.0
|
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 linux) 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 } 00067 PyActuatorPlugin; 00068 00069 typedef struct 00070 { 00071 PyObject_HEAD 00072 ito::AddInDataIO *dataIOObj; 00073 PyObject* base; 00074 } 00075 PyDataIOPlugin; 00076 00077 #if 0 //algo plugins do not exist as instances, they only contain static methods, callable by itom.filter 00078 typedef struct 00079 { 00080 PyObject_HEAD 00081 ito::AddInAlgo *algoObj; 00082 PyObject* base; 00083 } 00084 PyAlgoPlugin; 00085 #endif 00086 00087 // Actuator 00088 static void PyActuatorPlugin_dealloc(PyActuatorPlugin *self); 00089 static PyObject *PyActuatorPlugin_new(PyTypeObject *type, PyObject *args, PyObject *kwds); 00090 static int PyActuatorPlugin_init(PyActuatorPlugin *self, PyObject *args, PyObject *kwds); 00091 static PyObject* PyActuatorPlugin_repr(PyActuatorPlugin *self); 00092 00093 static PyObject *PyActuatorPlugin_name(PyActuatorPlugin *self); 00094 static PyObject *PyActuatorPlugin_getParamList(PyActuatorPlugin *self); 00095 static PyObject *PyActuatorPlugin_getParamListInfo(PyActuatorPlugin *self, PyObject *args); 00096 static PyObject* PyActuatorPlugin_getExecFuncsInfo(PyActuatorPlugin* self, PyObject *args, PyObject *kwds); 00097 static PyObject *PyActuatorPlugin_getParam(PyActuatorPlugin *self, PyObject *args); 00098 static PyObject *PyActuatorPlugin_setParam(PyActuatorPlugin *self, PyObject *args); 00099 static PyObject *PyActuatorPlugin_getType(PyActuatorPlugin *self); 00100 static PyObject *PyActuatorPlugin_execFunc(PyActuatorPlugin *self, PyObject *args, PyObject *kwds); 00101 static PyObject *PyActuatorPlugin_showConfiguration(PyActuatorPlugin *self); 00102 static PyObject *PyActuatorPlugin_showToolbox(PyActuatorPlugin *self); 00103 static PyObject *PyActuatorPlugin_hideToolbox(PyActuatorPlugin *self); 00104 00105 static PyObject *PyActuatorPlugin_setInterrupt(PyActuatorPlugin *self); 00106 00107 static PyObject *PyActuatorPlugin_calib(PyActuatorPlugin *self, PyObject *args); 00108 static PyObject *PyActuatorPlugin_setOrigin(PyActuatorPlugin *self, PyObject *args); 00109 static PyObject *PyActuatorPlugin_getStatus(PyActuatorPlugin *self, PyObject *args); 00110 static PyObject *PyActuatorPlugin_getPos(PyActuatorPlugin *self, PyObject *args); 00111 static PyObject *PyActuatorPlugin_setPosAbs(PyActuatorPlugin *self, PyObject *args); 00112 static PyObject *PyActuatorPlugin_setPosRel(PyActuatorPlugin *self, PyObject *args); 00113 00114 static PyMemberDef PyActuatorPlugin_members[]; 00115 static PyMethodDef PyActuatorPlugin_methods[]; 00116 static PyTypeObject PyActuatorPluginType; 00117 static PyModuleDef PyActuatorPluginModule; 00118 00119 static void paramBaseVectorDeleter(QVector<ito::ParamBase> *obj) 00120 { 00121 delete obj; 00122 } 00123 00124 00125 // pending for deletion 00126 /* 00127 // Actuator axis 00128 static void PyActuatorAxis_dealloc(PyActuatorAxis *self); 00129 static PyObject *PyActuatorAxis_new(PyTypeObject *type, PyObject *args, PyObject *kwds); 00130 static int PyActuatorAxis_init(PyActuatorAxis *self, PyObject *args, PyObject *kwds); 00131 00132 static PyObject *PyActuatorAxis_getStatus(PyActuatorAxis *self, PyObject *args); 00133 static PyObject *PyActuatorAxis_getPos(PyActuatorAxis *self, PyObject *args); 00134 static PyObject *PyActuatorAxis_setPosAbs(PyActuatorAxis *self, PyObject *args); 00135 static PyObject *PyActuatorAxis_setPosRel(PyActuatorAxis *self, PyObject *args); 00136 00137 static PyMemberDef PyActuatorAxis_members[]; 00138 static PyMethodDef PyActuatorAxis_methods[]; 00139 static PyTypeObject PyActuatorAxisType; 00140 static PyModuleDef PyActuatorAxisModule; 00141 */ 00142 //DataIO 00143 static void PyDataIOPlugin_dealloc(PyDataIOPlugin *self); 00144 static PyObject *PyDataIOPlugin_new(PyTypeObject *type, PyObject *args, PyObject *kwds); 00145 static int PyDataIOPlugin_init(PyDataIOPlugin *self, PyObject *args, PyObject *kwds); 00146 static PyObject* PyDataIOPlugin_repr(PyDataIOPlugin *self); 00147 00148 static PyObject *PyDataIOPlugin_name(PyDataIOPlugin *self); 00149 static PyObject *PyDataIOPlugin_getParamList(PyDataIOPlugin *self); 00150 static PyObject* PyDataIOPlugin_getParamListInfo(PyDataIOPlugin* self, PyObject *args); 00151 static PyObject* PyDataIOPlugin_getExecFuncsInfo(PyDataIOPlugin* self, PyObject *args, PyObject *kwds); 00152 static PyObject *PyDataIOPlugin_getParam(PyDataIOPlugin *self, PyObject *args); 00153 static PyObject *PyDataIOPlugin_setParam(PyDataIOPlugin *self, PyObject *args); 00154 static PyObject *PyDataIOPlugin_getType(PyDataIOPlugin *self); 00155 static PyObject *PyDataIOPlugin_execFunc(PyDataIOPlugin *self, PyObject *args, PyObject *kwds); 00156 static PyObject *PyDataIOPlugin_showConfiguration(PyDataIOPlugin *self); 00157 static PyObject *PyDataIOPlugin_showToolbox(PyDataIOPlugin *self); 00158 static PyObject *PyDataIOPlugin_hideToolbox(PyDataIOPlugin *self); 00159 00160 static PyObject *PyDataIOPlugin_startDevice(PyDataIOPlugin *self, PyObject *args); 00161 static PyObject *PyDataIOPlugin_stopDevice(PyDataIOPlugin *self, PyObject *args); 00162 static PyObject *PyDataIOPlugin_acquire(PyDataIOPlugin *self, PyObject *args); 00163 static PyObject *PyDataIOPlugin_getVal(PyDataIOPlugin *self, PyObject *args); 00164 static PyObject *PyDataIOPlugin_copyVal(PyDataIOPlugin *self, PyObject *args); 00165 static PyObject *PyDataIOPlugin_setVal(PyDataIOPlugin *self, PyObject *args); 00166 static PyObject *PyDataIOPlugin_enableAutoGrabbing(PyDataIOPlugin *self, PyObject *args); 00167 static PyObject *PyDataIOPlugin_disableAutoGrabbing(PyDataIOPlugin *self, PyObject *args); 00168 static PyObject *PyDataIOPlugin_setAutoGrabbing(PyDataIOPlugin *self, PyObject *args); 00169 static PyObject *PyDataIOPlugin_getAutoGrabbing(PyDataIOPlugin *self, PyObject *args); 00170 00171 static PyMemberDef PyDataIOPlugin_members[]; 00172 static PyMethodDef PyDataIOPlugin_methods[]; 00173 static PyTypeObject PyDataIOPluginType; 00174 static PyModuleDef PyDataIOPluginModule; 00175 static void PyDataIOPlugin_addTpDict(PyObject *tp_dict); 00176 00177 #if 0 //algo plugins do not exist as instances, they only contain static methods, callable by itom.filter 00178 // Algo 00179 static void PyAlgoPlugin_dealloc(PyAlgoPlugin *self); 00180 static PyObject *PyAlgoPlugin_new(PyTypeObject *type, PyObject *args, PyObject *kwds); 00181 static int PyAlgoPlugin_init(PyAlgoPlugin *self, PyObject *args, PyObject *kwds); 00182 static PyObject *PyAlgoPlugin_name(PyAlgoPlugin *self); 00183 static PyObject *PyAlgoPlugin_getParamList(PyAlgoPlugin *self); 00184 static PyObject *PyAlgoPlugin_getParamListInfo(PyAlgoPlugin *self, PyObject *args); 00185 static PyObject* PyAlgoPlugin_getExecFuncsInfo(PyAlgoPlugin* self, PyObject *args, PyObject *kwds); 00186 static PyObject *PyAlgoPlugin_getParam(PyAlgoPlugin *self, PyObject *args); 00187 static PyObject *PyAlgoPlugin_setParam(PyAlgoPlugin *self, PyObject *args); 00188 static PyObject *PyAlgoPlugin_getType(PyAlgoPlugin *self); 00189 00190 static PyMemberDef PyAlgoPlugin_members[]; 00191 static PyMethodDef PyAlgoPlugin_methods[]; 00192 static PyTypeObject PyAlgoPluginType; 00193 static PyModuleDef PyAlgoPluginModule; 00194 #endif 00195 }; 00196 00197 } //end namespace ito 00198 00199 #endif