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 
27 #include <ArmarXCore/interface/observers/ConditionHandlerInterface.h>
28 #include <ArmarXCore/interface/observers/Event.h>
29 
33 
34 #include <mutex>
35 
36 class QToolBar;
37 
38 namespace armarx
39 {
40  /** \page ArmarXGui-GuiPlugins-ConditionViewer ConditionViewer
41  * \brief With this widget conditions can be visualized.
42  * \image html ConditionViewer.png
43  * The user can choose between displaying a history of all conditions or
44  * the currently active conditions.
45  * Gui Documentation \ref ConditionViewerWidgetController
46 
47  * \see ConditionViewerGuiPlugin
48  */
49 
50  /** \class ConditionViewerWidgetController
51  * \brief With this widget conditions can be visualized.
52  * \see ConditionViewerGuiPlugin
53  */
55  public ArmarXComponentWidgetControllerTemplate<ConditionViewerWidgetController>
56  {
57  Q_OBJECT
58  public:
60 
61  // inherited from Component
62  void onInitComponent() override;
63  void onConnectComponent() override;
64  void onDisconnectComponent() override;
65  void onExitComponent() override;
66 
67  // inherited from ArmarXWidget
68  QPointer<QWidget> getWidget() override;
69  static QString GetWidgetName()
70  {
71  return "Observers.ConditionViewer";
72  }
73  void loadSettings(QSettings* settings) override {}
74  void saveSettings(QSettings* settings) override {}
75  QPointer<QWidget> getCustomTitlebarWidget(QWidget* parent) override;
76 
77 
78 
79  // helper methods for gui
80  ConditionRegistry getActiveConditions();
81  ConditionRegistry getPastConditions();
82  ConditionHandlerInterfacePrx handler;
83  public slots:
84  void refresh(bool enableRefreshing);
85  void removeConditions();
86 
87 
88  private:
89  void updateConditions();
90  ConditionRegistry currentConditions;
91  ConditionRegistry pastConditions;
93  std::mutex dataMutex;
94  QPointer<ConditionViewerWidget> __widget;
95  QPointer<QToolBar> customToolbar;
96  QAction* refreshAction;
97 
98  };
99 }
100 
armarx::ArmarXComponentWidgetControllerTemplate
Definition: ArmarXComponentWidgetController.h:69
ArmarXGuiPlugin.h
ArmarXComponentWidgetController.h
ARMARXCOMPONENT_IMPORT_EXPORT
#define ARMARXCOMPONENT_IMPORT_EXPORT
Definition: ImportExportComponent.h:38
ConditionViewerWidget.h
armarx::ConditionViewerWidgetController::GetWidgetName
static QString GetWidgetName()
Definition: ConditionViewerWidgetController.h:69
armarx::ConditionViewerWidgetController::loadSettings
void loadSettings(QSettings *settings) override
Implement to load the settings that are part of the GUI configuration.
Definition: ConditionViewerWidgetController.h:73
Component.h
armarx::ConditionViewerWidgetController::handler
ConditionHandlerInterfacePrx handler
Definition: ConditionViewerWidgetController.h:82
IceUtil::Handle
Definition: forward_declarations.h:29
armarx::ConditionViewerWidgetController::saveSettings
void saveSettings(QSettings *settings) override
Implement to save the settings as part of the GUI configuration.
Definition: ConditionViewerWidgetController.h:74
armarx::ConditionViewerWidgetController
With this widget conditions can be visualized.
Definition: ConditionViewerWidgetController.h:54
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
ImportExportComponent.h