itom  3.0.0
abstractAddInDockWidget.h
1 /* ********************************************************************
2  itom software
3  URL: http://www.uni-stuttgart.de/ito
4  Copyright (C) 2016, Institut fuer Technische Optik (ITO),
5  Universitaet Stuttgart, Germany
6 
7  This file is part of itom and its software development toolkit (SDK).
8 
9  itom is free software; you can redistribute it and/or modify it
10  under the terms of the GNU Library General Public Licence as published by
11  the Free Software Foundation; either version 2 of the Licence, or (at
12  your option) any later version.
13 
14  In addition, as a special exception, the Institut fuer Technische
15  Optik (ITO) gives you certain additional rights.
16  These rights are described in the ITO LGPL Exception version 1.0,
17  which can be found in the file LGPL_EXCEPTION.txt in this package.
18 
19  itom is distributed in the hope that it will be useful, but
20  WITHOUT ANY WARRANTY; without even the implied warranty of
21  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
22  General Public Licence for more details.
23 
24  You should have received a copy of the GNU Library General Public License
25  along with itom. If not, see <http://www.gnu.org/licenses/>.
26 *********************************************************************** */
27 
28 #ifndef ABSTRACTADDINDOCKWIDGET_H
29 #define ABSTRACTADDINDOCKWIDGET_H
30 
31 #include "retVal.h"
32 #include "typeDefs.h"
33 #include "sharedStructuresQt.h"
34 #include "commonGlobal.h"
35 
36 #if QT_VERSION < 0x050000
37 #include <qwidget.h>
38 #else
39 #include <QtWidgets/qwidget.h>
40 #endif
41 #include <qmap.h>
42 #include <qsharedpointer.h>
43 
44 //forward declarations
45 namespace ito
46 {
47  class AddInBase; //forward declaration
48  class AbstractAddInDockWidgetPrivate; //forward declaration
49 
50  //----------------------------------------------------------------------------------------------------------------------------------
71  class ITOMCOMMONQT_EXPORT AbstractAddInDockWidget : public QWidget
72  {
73  Q_OBJECT
74 
75  public:
78 
80  virtual ~AbstractAddInDockWidget();
81 
87  {
88  msgLevelNo = 0,
89  msgLevelErrorOnly = 1,
90  msgLevelWarningOnly = 2,
91  msgLevelWarningAndError = msgLevelErrorOnly | msgLevelWarningOnly
92  };
93 
94  protected:
96 
106  ito::RetVal setPluginParameter(QSharedPointer<ito::ParamBase> param, MessageLevel msgLevel = msgLevelWarningAndError) const;
107 
109 
119  ito::RetVal setPluginParameters(const QVector<QSharedPointer<ito::ParamBase> > params, MessageLevel msgLevel = msgLevelWarningAndError) const;
120 
122 
136  ito::RetVal observeInvocation(ItomSharedSemaphore *waitCond, MessageLevel msgLevel) const;
137 
139 
153  ito::RetVal setActuatorPosition(QVector<int> axes, QVector<double> positions, bool relNotAbs, MessageLevel msgLevel = msgLevelWarningAndError) const;
154 
156 
170  ito::RetVal setActuatorPosition(int axis, double position, bool relNotAbs, MessageLevel msgLevel = msgLevelWarningAndError) const;
171 
173 
178  ito::RetVal setActuatorInterrupt() const;
179 
181 
187  ito::RetVal requestActuatorStatusAndPositions(bool sendCurrentPos, bool sendTargetPos, MessageLevel msgLevel = msgLevelWarningAndError) const;
188 
189  private:
192  public slots:
194 
201  virtual void parametersChanged(QMap<QString, ito::Param> params) = 0;
202 
204 
211  virtual void identifierChanged(const QString &identifier) = 0;
212 
214 
224  virtual void actuatorStatusChanged(QVector<int> status, QVector<double> actPosition);
225 
227 
235  virtual void targetChanged(QVector<double> targetPositions);
236  };
237 } //end namespace ito
238 
239 #endif //ABSTRACTADDINDOCKWIDGET_H
Class for managing status values (like errors or warning)
Definition: retVal.h:54
Base class for all plugins.
Definition: addInInterface.h:356
Definition: apiFunctionsGraph.cpp:39
semaphore which can be used for asychronous thread communication. By using this class it is possible ...
Definition: sharedStructuresQt.h:57
MessageLevel
Definition: abstractAddInDockWidget.h:86
Definition: abstractAddInDockWidget.cpp:45
abstract base class for dock widgets (toolboxes) of plugins
Definition: abstractAddInDockWidget.h:71