IceGridViewer.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::
17 * @author Manfred Kroehnert ( manfred.kroehnert at kit dot edu)
18 * @date 2013
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22 
23 #pragma once
24 
26 
27 #include <QWidget>
28 #include <QStringListModel>
29 
30 #include <IceGrid/Admin.h>
31 
32 #include <mutex>
33 
34 namespace Ui
35 {
36  class IceGridViewer;
37 }
38 
39 class NodeInfoModel;
40 class ServerInfoModel;
41 class AdapterInfoModel;
42 
43 namespace armarx
44 {
45  class IceGridViewerModel;
46 
47  /**
48  \page ArmarXGui-GuiPlugins-IceGridViewer IceGridViewer
49  * \brief The IceGridViewer shows the current state of a running IceGrid instance.
50  * \image html IceGridViewer.png
51  * The IceGridViewer shows the current state of a running IceGrid instance.
52  * ArmarXGui Documentation \ref IceGridViewer
53  * \see SystemStateMonitorPlugin
54  */
55  /**
56  * \class IceGridViewer
57  */
58  class IceGridViewer :
59  public ArmarXComponentWidgetControllerTemplate<IceGridViewer>
60  {
61  Q_OBJECT
62 
63  public:
64  explicit IceGridViewer();
65  ~IceGridViewer() override;
66 
67  /**
68  * Load stored manager models
69  */
70  void loadSettings(QSettings* settings) override;
71 
72  /**
73  * Saves the manager models
74  */
75  void saveSettings(QSettings* settings) override;
76 
77  /**
78  * Returns the Widget name displayed in the ArmarXGui to create an
79  * instance of this.
80  */
81  static QString GetWidgetName()
82  {
83  return "Meta.IceGridViewer";
84  }
85 
86  /**
87  * @see armarx::Component::onInitComponent()
88  */
89  void onInitComponent() override;
90 
91  /**
92  * @see armarx::Component::onConnectComponent()
93  */
94  void onConnectComponent() override;
95  void onExitComponent() override;
96 
97  signals:
98 
99  public slots:
100  void gridNodeListUpdate(const IceGrid::NodeDynamicInfoSeq& nodeSeq);
101  void selectGridNode(int index);
102  void gridNodeListAdd(const IceGrid::NodeDynamicInfo& node);
103  void gridNodeListRemove(const QString& node);
104  void updateServerInfo(const std::string& nodeName, const IceGrid::ServerDynamicInfo& serverUpdateInfo);
105  void updateAdapterInfo(const std::string& nodeName, const IceGrid::AdapterDynamicInfo& adapterUpdateInfo);
106 
107  protected slots:
108  void serverInfoChanged(IceGrid::ServerDynamicInfo serverInfo);
109 
110  private:
111  mutable std::mutex gridNodeListMutex;
112  Ui::IceGridViewer* ui;
113 
114  const std::string ADAPTER_NAME;
115  armarx::IceGridAdminPtr iceGridAdmin;
116  Ice::ObjectAdapterPtr observerAdapter;
117 
118  IceGrid::NodeDynamicInfoSeq gridNodeList;
119  NodeInfoModel* nodeInfoModel;
120  ServerInfoModel* serverInfoModel;
121  AdapterInfoModel* adapterInfoModel;
122  QStringListModel* selectorModel;
123  };
124 }
125 
armarx::IceGridViewer::updateServerInfo
void updateServerInfo(const std::string &nodeName, const IceGrid::ServerDynamicInfo &serverUpdateInfo)
Definition: IceGridViewer.cpp:180
armarx::IceGridViewer::onInitComponent
void onInitComponent() override
Definition: IceGridViewer.cpp:82
index
uint8_t index
Definition: EtherCATFrame.h:59
armarx::IceGridViewer::onExitComponent
void onExitComponent() override
Hook for subclass.
Definition: IceGridViewer.cpp:109
armarx::ArmarXComponentWidgetControllerTemplate
Definition: ArmarXComponentWidgetController.h:69
armarx::IceGridViewer
Definition: IceGridViewer.h:58
armarx::IceGridViewer::~IceGridViewer
~IceGridViewer() override
Definition: IceGridViewer.cpp:66
ServerInfoModel
Definition: ServerInfoModel.h:33
IceInternal::Handle
Definition: forward_declarations.h:8
armarx::IceGridViewer::GetWidgetName
static QString GetWidgetName()
Returns the Widget name displayed in the ArmarXGui to create an instance of this.
Definition: IceGridViewer.h:81
ArmarXComponentWidgetController.h
Ui
ArmarX Headers.
Definition: ArmarXMainWindow.h:58
armarx::IceGridViewer::gridNodeListUpdate
void gridNodeListUpdate(const IceGrid::NodeDynamicInfoSeq &nodeSeq)
Definition: IceGridViewer.cpp:120
armarx::IceGridViewer::onConnectComponent
void onConnectComponent() override
Definition: IceGridViewer.cpp:93
armarx::IceGridViewer::gridNodeListAdd
void gridNodeListAdd(const IceGrid::NodeDynamicInfo &node)
Definition: IceGridViewer.cpp:144
armarx::IceGridViewer::IceGridViewer
IceGridViewer()
Definition: IceGridViewer.cpp:40
NodeInfoModel
Definition: NodeInfoModel.h:30
IceUtil::Handle< IceGridAdmin >
armarx::IceGridViewer::selectGridNode
void selectGridNode(int index)
Definition: IceGridViewer.cpp:270
AdapterInfoModel
Definition: AdapterInfoModel.h:30
armarx::IceGridViewer::serverInfoChanged
void serverInfoChanged(IceGrid::ServerDynamicInfo serverInfo)
Definition: IceGridViewer.cpp:264
armarx::IceGridViewer::gridNodeListRemove
void gridNodeListRemove(const QString &node)
Definition: IceGridViewer.cpp:154
armarx::IceGridViewer::saveSettings
void saveSettings(QSettings *settings) override
Saves the manager models.
Definition: IceGridViewer.cpp:77
armarx::IceGridViewer::loadSettings
void loadSettings(QSettings *settings) override
Load stored manager models.
Definition: IceGridViewer.cpp:72
armarx::IceGridViewer::updateAdapterInfo
void updateAdapterInfo(const std::string &nodeName, const IceGrid::AdapterDynamicInfo &adapterUpdateInfo)
Definition: IceGridViewer.cpp:222
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28