itom 1.0.14
|
00001 /* ******************************************************************** 00002 itom software 00003 URL: http://www.uni-stuttgart.de/ito 00004 Copyright (C) 2013, Institut für Technische Optik (ITO), 00005 Universität Stuttgart, Germany 00006 00007 This file is part of itom and its software development toolkit (SDK). 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 In addition, as a special exception, the Institut für Technische 00015 Optik (ITO) gives you certain additional rights. 00016 These rights are described in the ITO LGPL Exception version 1.0, 00017 which can be found in the file LGPL_EXCEPTION.txt in this package. 00018 00019 itom is distributed in the hope that it will be useful, but 00020 WITHOUT ANY WARRANTY; without even the implied warranty of 00021 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library 00022 General Public Licence for more details. 00023 00024 You should have received a copy of the GNU Library General Public License 00025 along with itom. If not, see <http://www.gnu.org/licenses/>. 00026 *********************************************************************** */ 00027 00028 #ifndef HELPERACTUATOR_H 00029 #define HELPERACTUATOR_H 00030 00031 #include "typeDefs.h" 00032 #include "../common/addInInterface.h" 00033 #include "sharedStructures.h" 00034 00035 namespace ito 00036 { 00037 00038 //---------------------------------------------------------------------------------------------------------------------------------- 00049 class threadActuator 00050 { 00051 private: 00052 int axisNumbers; 00053 ito::AddInActuator *pMyMotor; 00054 ito::RetVal errorBuffer; 00055 ItomSharedSemaphoreLocker pMySemaphoreLocker; 00057 inline ito::RetVal securityChecks(); /* ! < Checks if pMyMotor and pMySemaphore are != NULL and if pMySemaphore has already waited still last commant (see setPosAbs / setPosRel) */ 00058 00059 protected: 00060 00061 public: 00062 00063 threadActuator(QVector<ito::ParamBase> *parameterVector, int paramNumber); 00064 ~threadActuator(); 00066 ito::RetVal setPosRel(QVector<int> axisVec, QVector<double> stepSizeVec, int timeOutMS = PLUGINWAIT); 00067 ito::RetVal setPosAbs(QVector<int> axisVec, QVector<double> posVec, int timeOutMS = PLUGINWAIT); 00068 ito::RetVal setPosRel(int axis, double stepSize, int timeOutMS = PLUGINWAIT); 00069 ito::RetVal setPosAbs(int axis, double pos, int timeOutMS = PLUGINWAIT); 00070 ito::RetVal waitForSemaphore(int timeOutMS = PLUGINWAIT); 00072 ito::RetVal getPos(QVector<int> axisVec, QVector<double> &posVec, int timeOutMS = PLUGINWAIT); 00073 ito::RetVal getPos(int axis, double &pos, int timeOutMS = PLUGINWAIT); 00075 ito::RetVal getParam(ito::Param &val, int timeOutMS = PLUGINWAIT); 00076 ito::RetVal setParam(ito::ParamBase val, int timeOutMS = PLUGINWAIT); 00077 ito::RetVal checkAxis(int axisNum); 00079 ito::RetVal getErrorBuf(void); 00080 }; 00081 00082 // class threadAxis 00083 // { 00084 // private: 00085 // int thisAxis; 00086 // ito::AddInActuator *pMyMotor; /*! < Handle to the actuator */ 00087 // ItomSharedSemaphore *pMySemaphore; /*! < Handle to the semaphore needed for thread save communication. Allocated in constructor, deleted in destructor*/ 00088 // inline ito::RetVal securityChecks(); 00089 // 00090 // protected: 00091 // threadActuator(QVector<ito::tParam> *parameterVector, int paramNumber, int axisNumber); /*! < Constructor */ 00092 // ~threadActuator(); /*! < Desctructor */ 00093 00094 // public: 00095 // ito::RetVal setPosRel(int axis, double stepSize, int timeOutMS, bool callWait = true); /*! < Move a single axis relativ to current position */ 00096 // ito::RetVal setPosAbs(int axis, double pos, int timeOutMS, bool callWait = true); /*! < Move a single axi absolute*/ 00097 // ito::RetVal waitForSemaphore(int timeOutMS); /*! < Wait until actuator-thread has finished the last command */ 00098 00099 // ito::RetVal getPos(int axis, double &pos, int timeOutMS); /*! < Get the position of a single axis */ 00100 // 00101 // ito::RetVal checkAxis(int axisNum); /*! < Check if an axis is within the axis-range */ 00102 //}; 00103 00104 } // end namespace ito 00105 00106 #endif