ConditionViewerWidgetController.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::Gui::ConditionViewerWidgetController
17* @author Kai Welke ( welke at kit dot edu)
18* @date
19* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20* GNU General Public License
21*/
22
23#pragma once
24
25#include <mutex>
26
29#include <ArmarXCore/interface/observers/ConditionHandlerInterface.h>
30#include <ArmarXCore/interface/observers/Event.h>
31
34
36
37class QToolBar;
38
39namespace armarx
40{
41 /** \page ArmarXGui-GuiPlugins-ConditionViewer ConditionViewer
42 * \brief With this widget conditions can be visualized.
43 * \image html ConditionViewer.png
44 * The user can choose between displaying a history of all conditions or
45 * the currently active conditions.
46 * Gui Documentation \ref ConditionViewerWidgetController
47
48 * \see ConditionViewerGuiPlugin
49 */
50
51 /** \class ConditionViewerWidgetController
52 * \brief With this widget conditions can be visualized.
53 * \see ConditionViewerGuiPlugin
54 */
56 public ArmarXComponentWidgetControllerTemplate<ConditionViewerWidgetController>
57 {
58 Q_OBJECT
59 public:
61
62 // inherited from Component
63 void onInitComponent() override;
64 void onConnectComponent() override;
65 void onDisconnectComponent() override;
66 void onExitComponent() override;
67
68 // inherited from ArmarXWidget
69 QPointer<QWidget> getWidget() override;
70
71 static QString
73 {
74 return "Observers.ConditionViewer";
75 }
76
77 void
78 loadSettings(QSettings* settings) override
79 {
80 }
81
82 void
83 saveSettings(QSettings* settings) override
84 {
85 }
86
87 QPointer<QWidget> getCustomTitlebarWidget(QWidget* parent) override;
88
89
90 // helper methods for gui
91 ConditionRegistry getActiveConditions();
92 ConditionRegistry getPastConditions();
93 ConditionHandlerInterfacePrx handler;
94 public slots:
95 void refresh(bool enableRefreshing);
96 void removeConditions();
97
98
99 private:
100 void updateConditions();
101 ConditionRegistry currentConditions;
102 ConditionRegistry pastConditions;
104 std::mutex dataMutex;
105 QPointer<ConditionViewerWidget> __widget;
106 QPointer<QToolBar> customToolbar;
107 QAction* refreshAction;
108 };
109} // namespace armarx
#define ARMARXCOMPONENT_IMPORT_EXPORT
void onInitComponent() override
Pure virtual hook for the 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< QWidget > getWidget() override
getWidget returns a pointer to the a widget of this controller.
void onConnectComponent() override
Pure virtual hook for the subclass.
IceUtil::Handle< PeriodicTask< T > > pointer_type
Shared pointer type for convenience.
This file offers overloads of toIce() and fromIce() functions for STL container types.