ObserverWidgetController.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::ObserverWidgetController
17 * @author ( 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 #include <ArmarXCore/interface/observers/ObserverInterface.h>
31 
34 
35 #include "widgets/ObserverWidget.h"
36 
37 namespace armarx
38 {
39  /**
40  * \page ArmarXGui-GuiPlugins-ObserverWidget ObserverGui
41  * \brief This widget allows to inspect all observers in the system and their content.
42  * \image html ObserverView.png "Available checks with their supported types"
43  * \image html ObserverView-Datafield.png "Live plotting of any datafield"
44  *
45  * For each \ref Observers "observer" it displays the available checks and channels.
46  * For each \ref ConditionChecks "check type" the supported parameters are shown.
47  * Channels show their offered datafields with their type, current value and an live plot.
48  * It is also possible to install filters for each datafield by right-clicking on the datafield and selecting
49  * the desired filter.
50  * \see \ref Observers
51  * \see \ref ObserverWidgetController
52  */
53 
54  /**
55  * \class ObserverWidgetController
56  */
58  public ArmarXComponentWidgetControllerTemplate<ObserverWidgetController>
59  {
60  Q_OBJECT
61  public:
63 
64  // inherited from Component
65  void onInitComponent() override;
66  void onConnectComponent() override;
67  void onExitComponent() override;
68 
69  // inherited from ArmarXWidget
70  QPointer<QWidget> getWidget() override;
71 
72  static QString
74  {
75  return "Observers.ObserverView";
76  }
77 
78  static QIcon
80  {
81  return QIcon("://icons/binoculars.svg");
82  }
83 
84  static QIcon
86  {
87  return QIcon("://icons/binoculars.svg");
88  }
89 
90  void
91  loadSettings(QSettings* settings) override
92  {
93  }
94 
95  void
96  saveSettings(QSettings* settings) override
97  {
98  }
99 
100  // // helper methods for gui
101  // ObserverList getObservers();
102 
103  // ChannelRegistry getChannelRegistry(std::string observerName);
104  // StringConditionCheckMap getAvailableChecks(std::string observerName);
105  //// ConditionCheckMap getActiveConditionChecks(std::string observerName);
106 
107  // ConditionHandlerInterfacePrx handler;
108  ObserverInterfacePrx observer;
109  VariantInfoPtr getVariantInfo() const;
110 
111  public slots:
112  void installFilter(const std::string& datafieldStr, DatafieldFilterBasePtr filter);
113  signals:
114  void connected();
115 
116  protected:
117  QPointer<QWidget> getCustomTitlebarWidget(QWidget* parent) override;
118 
119  private:
120  QPointer<ObserverWidget> __widget;
121  QPointer<QToolBar> customToolbar;
122  VariantInfoPtr variantInfo;
123  };
124 } // namespace armarx
armarx::ObserverWidgetController::observer
ObserverInterfacePrx observer
Definition: ObserverWidgetController.h:108
armarx::ObserverWidgetController::GetWidgetName
static QString GetWidgetName()
Definition: ObserverWidgetController.h:73
armarx::ObserverWidgetController::GetWidgetIcon
static QIcon GetWidgetIcon()
Definition: ObserverWidgetController.h:79
armarx::ObserverWidgetController::loadSettings
void loadSettings(QSettings *settings) override
Implement to load the settings that are part of the GUI configuration.
Definition: ObserverWidgetController.h:91
armarx::ArmarXComponentWidgetControllerTemplate
Definition: ArmarXComponentWidgetController.h:69
ArmarXGuiPlugin.h
armarx::ObserverWidgetController::saveSettings
void saveSettings(QSettings *settings) override
Implement to save the settings as part of the GUI configuration.
Definition: ObserverWidgetController.h:96
ObserverWidget.h
ArmarXComponentWidgetController.h
ARMARXCOMPONENT_IMPORT_EXPORT
#define ARMARXCOMPONENT_IMPORT_EXPORT
Definition: ImportExportComponent.h:38
armarx::ObserverWidgetController::GetWidgetCategoryIcon
static QIcon GetWidgetCategoryIcon()
Definition: ObserverWidgetController.h:85
Component.h
armarx::VariantInfoPtr
std::shared_ptr< VariantInfo > VariantInfoPtr
Definition: VariantInfo.h:39
armarx::ObserverWidgetController
Definition: ObserverWidgetController.h:57
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
VariantInfo.h
ImportExportComponent.h