itom 1.4.0
|
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 ABSTRACTADDINDOCKWIDGET_H 00029 #define ABSTRACTADDINDOCKWIDGET_H 00030 00031 #include "retVal.h" 00032 #include "typeDefs.h" 00033 #include "sharedStructuresQt.h" 00034 #include "commonGlobal.h" 00035 00036 #if QT_VERSION < 0x050000 00037 #include <qwidget.h> 00038 #else 00039 #include <QtWidgets/qwidget.h> 00040 #endif 00041 #include <qmap.h> 00042 #include <qsharedpointer.h> 00043 00044 //forward declarations 00045 namespace ito 00046 { 00047 class AddInBase; //forward declaration 00048 class AbstractAddInDockWidgetPrivate; //forward declaration 00049 00050 //---------------------------------------------------------------------------------------------------------------------------------- 00071 class ITOMCOMMONQT_EXPORT AbstractAddInDockWidget : public QWidget 00072 { 00073 Q_OBJECT 00074 00075 public: 00077 AbstractAddInDockWidget(ito::AddInBase *plugin); 00078 00080 virtual ~AbstractAddInDockWidget(); 00081 00086 enum MessageLevel 00087 { 00088 msgLevelNo = 0, 00089 msgLevelErrorOnly = 1, 00090 msgLevelWarningOnly = 2, 00091 msgLevelWarningAndError = msgLevelErrorOnly | msgLevelWarningOnly 00092 }; 00093 00094 protected: 00096 00106 ito::RetVal setPluginParameter(QSharedPointer<ito::ParamBase> param, MessageLevel msgLevel = msgLevelWarningAndError) const; 00107 00109 00119 ito::RetVal setPluginParameters(const QVector<QSharedPointer<ito::ParamBase> > params, MessageLevel msgLevel = msgLevelWarningAndError) const; 00120 00122 00136 ito::RetVal observeInvocation(ItomSharedSemaphore *waitCond, MessageLevel msgLevel) const; 00137 00139 00153 ito::RetVal setActuatorPosition(QVector<int> axes, QVector<double> positions, bool relNotAbs, MessageLevel msgLevel = msgLevelWarningAndError) const; 00154 00156 00170 ito::RetVal setActuatorPosition(int axis, double position, bool relNotAbs, MessageLevel msgLevel = msgLevelWarningAndError) const; 00171 00173 00178 ito::RetVal setActuatorInterrupt() const; 00179 00181 00187 ito::RetVal requestActuatorStatusAndPositions(bool sendCurrentPos, bool sendTargetPos, MessageLevel msgLevel = msgLevelWarningAndError) const; 00188 00189 private: 00190 AbstractAddInDockWidgetPrivate* d; 00192 public slots: 00194 00201 virtual void parametersChanged(QMap<QString, ito::Param> params) = 0; 00202 00204 00211 virtual void identifierChanged(const QString &identifier) = 0; 00212 00214 00224 virtual void actuatorStatusChanged(QVector<int> status, QVector<double> actPosition); 00225 00227 00235 virtual void targetChanged(QVector<double> targetPositions); 00236 }; 00237 } //end namespace ito 00238 00239 #endif //ABSTRACTADDINDOCKWIDGET_H