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 
25 #include "widgets/ObserverWidget.h"
26 
29 #include <ArmarXCore/interface/observers/ObserverInterface.h>
30 #include <ArmarXCore/interface/observers/ConditionHandlerInterface.h>
31 #include <ArmarXCore/interface/observers/Event.h>
33 
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  static QString GetWidgetName()
72  {
73  return "Observers.ObserverView";
74  }
75  static QIcon GetWidgetIcon()
76  {
77  return QIcon("://icons/binoculars.svg");
78  }
79  static QIcon GetWidgetCategoryIcon()
80  {
81  return QIcon("://icons/binoculars.svg");
82  }
83 
84  void loadSettings(QSettings* settings) override {}
85  void saveSettings(QSettings* settings) override {}
86 
87 
88  // // helper methods for gui
89  // ObserverList getObservers();
90 
91  // ChannelRegistry getChannelRegistry(std::string observerName);
92  // StringConditionCheckMap getAvailableChecks(std::string observerName);
93  //// ConditionCheckMap getActiveConditionChecks(std::string observerName);
94 
95  // ConditionHandlerInterfacePrx handler;
96  ObserverInterfacePrx observer;
97  VariantInfoPtr getVariantInfo() const;
98 
99  public slots:
100  void installFilter(const std::string& datafieldStr, DatafieldFilterBasePtr filter);
101  signals:
102  void connected();
103  protected:
104  QPointer<QWidget> getCustomTitlebarWidget(QWidget* parent) override;
105  private:
106  QPointer<ObserverWidget> __widget;
107  QPointer<QToolBar> customToolbar;
108  VariantInfoPtr variantInfo;
109  };
110 }
111 
armarx::ObserverWidgetController::observer
ObserverInterfacePrx observer
Definition: ObserverWidgetController.h:96
armarx::ObserverWidgetController::GetWidgetName
static QString GetWidgetName()
Definition: ObserverWidgetController.h:71
armarx::ObserverWidgetController::GetWidgetIcon
static QIcon GetWidgetIcon()
Definition: ObserverWidgetController.h:75
armarx::ObserverWidgetController::loadSettings
void loadSettings(QSettings *settings) override
Implement to load the settings that are part of the GUI configuration.
Definition: ObserverWidgetController.h:84
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:85
ArmarXComponentWidgetController.h
ObserverWidget.h
ARMARXCOMPONENT_IMPORT_EXPORT
#define ARMARXCOMPONENT_IMPORT_EXPORT
Definition: ImportExportComponent.h:38
armarx::ObserverWidgetController::GetWidgetCategoryIcon
static QIcon GetWidgetCategoryIcon()
Definition: ObserverWidgetController.h:79
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:28
VariantInfo.h
ImportExportComponent.h