HapticUnitGuiPlugin.h
Go to the documentation of this file.
1/*
2* This file is part of ArmarX.
3*
4* ArmarX is free software; you can redistribute it and/or modify
5* it under the terms of the GNU General Public License version 2 as
6* published by the Free Software Foundation.
7*
8* ArmarX is distributed in the hope that it will be useful, but
9* WITHOUT ANY WARRANTY; without even the implied warranty of
10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11* GNU General Public License for more details.
12*
13* You should have received a copy of the GNU General Public License
14* along with this program. If not, see <http://www.gnu.org/licenses/>.
15*
16* @package ArmarX::Component::ObjectExaminerGuiPlugin
17* @author Nikolaus Vahrenkamp ( vahrenkamp at kit dot edu)
18* @copyright 2012
19* @license http://www.gnu.org/licenses/gpl-2.0.txt
20* GNU General Public License
21
22*/
23
24#pragma once
25
26/* ArmarX headers */
29
32
33#include <RobotAPI/gui-plugins/HapticUnitPlugin/ui_HapticUnitGuiPlugin.h>
34
35/* Qt headers */
36#include <string>
37
38#include <QLayout>
39#include <QMainWindow>
40#include <QtCore/QTimer>
41
42#include <RobotAPI/interface/units/WeissHapticUnit.h>
43
45
46namespace armarx
47{
49
51 {
52 Q_OBJECT
53 Q_INTERFACES(ArmarXGuiInterface)
54 Q_PLUGIN_METADATA(IID "ArmarXGuiInterface/1.00")
55 public:
57
58 QString
59 getPluginName() override
60 {
61 return "HapticUnitGuiPlugin";
62 }
63 };
64
65 /*!
66 \page RobotAPI-GuiPlugins-HapticUnitPlugin HapticUnitPlugin
67 \brief With this widget the HapticUnit can be controlled.
68 */
70 {
71 Q_OBJECT
72 public:
74
76 {
77 }
78
79 // inherited from Component
80 void onInitComponent() override;
81 void onConnectComponent() override;
82 void onExitComponent() override;
83 void onDisconnectComponent() override;
84
85 // inherited of ArmarXWidget
86 static QString
88 {
89 return "RobotControl.HapticUnitGUI";
90 }
91
92 static QIcon
94 {
95 return QIcon("://icons/haptic-hand.png");
96 }
97
98 QPointer<QDialog> getConfigDialog(QWidget* parent = 0) override;
99 void loadSettings(QSettings* settings) override;
100 void saveSettings(QSettings* settings) override;
101 void configured() override;
102
103 public slots:
104 void updateData();
105 void onContextMenu(QPoint pos);
106
107 signals:
109
110 private slots:
111 void updateDisplayWidgets();
112 void onCheckBoxOffsetFilterStateChanged(int state);
113
114 protected:
115 void connectSlots();
116
117 Ui::HapticUnitGuiPlugin ui;
118
119 private:
120 void createMatrixWidgets();
121
122 private:
123 std::string hapticObserverProxyName;
124 std::string hapticUnitProxyName;
125 ObserverInterfacePrx hapticObserverProxy;
126 WeissHapticUnitInterfacePrx weissHapticUnit;
127
128 QPointer<QWidget> __widget;
129 QPointer<HapticUnitConfigDialog> dialog;
130
131 QTimer* updateTimer;
132
133 std::map<std::string, MatrixDatafieldDisplayWidget*> matrixDisplays;
134 std::map<MatrixDatafieldDisplayWidget*, std::string> channelNameReverseMap;
135 std::map<MatrixDatafieldDisplayWidget*, std::string> deviceNameReverseMap;
136 };
137
138 //using HapticUnitGuiPluginPtr = std::shared_ptr<HapticUnitWidget>;
139} // namespace armarx
The main gui interface.
void onInitComponent() override
Pure virtual hook for the subclass.
void onDisconnectComponent() override
Hook for subclass.
void loadSettings(QSettings *settings) override
Implement to load the settings that are part of the GUI configuration.
void saveSettings(QSettings *settings) override
Implement to save the settings as part of the GUI configuration.
QPointer< QDialog > getConfigDialog(QWidget *parent=0) override
getConfigDialog returns a pointer to the a configuration widget of this controller.
void onConnectComponent() override
Pure virtual hook for the subclass.
Ui::HapticUnitGuiPlugin ui
void configured() override
This function must be implemented by the user, if he supplies a config dialog.
void onExitComponent() override
Hook for subclass.
This file offers overloads of toIce() and fromIce() functions for STL container types.