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
25#include <mutex>
26
27#include <QStringListModel>
28#include <QWidget>
29
30#include <IceGrid/Admin.h>
31
33
34namespace Ui
35{
36 class IceGridViewer;
37}
38
39class NodeInfoModel;
40class ServerInfoModel;
42
43namespace 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 */
59 {
60 Q_OBJECT
61
62 public:
63 explicit IceGridViewer();
64 ~IceGridViewer() override;
65
66 /**
67 * Load stored manager models
68 */
69 void loadSettings(QSettings* settings) override;
70
71 /**
72 * Saves the manager models
73 */
74 void saveSettings(QSettings* settings) override;
75
76 /**
77 * Returns the Widget name displayed in the ArmarXGui to create an
78 * instance of this.
79 */
80 static QString
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,
105 const IceGrid::ServerDynamicInfo& serverUpdateInfo);
106 void updateAdapterInfo(const std::string& nodeName,
107 const IceGrid::AdapterDynamicInfo& adapterUpdateInfo);
108
109 protected slots:
110 void serverInfoChanged(IceGrid::ServerDynamicInfo serverInfo);
111
112 private:
113 mutable std::mutex gridNodeListMutex;
114 Ui::IceGridViewer* ui;
115
116 const std::string ADAPTER_NAME;
117 armarx::IceGridAdminPtr iceGridAdmin;
118 Ice::ObjectAdapterPtr observerAdapter;
119
120 IceGrid::NodeDynamicInfoSeq gridNodeList;
121 NodeInfoModel* nodeInfoModel;
122 ServerInfoModel* serverInfoModel;
123 AdapterInfoModel* adapterInfoModel;
124 QStringListModel* selectorModel;
125 };
126} // namespace armarx
uint8_t index
void onInitComponent() override
void gridNodeListAdd(const IceGrid::NodeDynamicInfo &node)
void loadSettings(QSettings *settings) override
Load stored manager models.
void saveSettings(QSettings *settings) override
Saves the manager models.
void gridNodeListRemove(const QString &node)
void updateServerInfo(const std::string &nodeName, const IceGrid::ServerDynamicInfo &serverUpdateInfo)
void onConnectComponent() override
static QString GetWidgetName()
Returns the Widget name displayed in the ArmarXGui to create an instance of this.
void onExitComponent() override
Hook for subclass.
void serverInfoChanged(IceGrid::ServerDynamicInfo serverInfo)
void selectGridNode(int index)
void gridNodeListUpdate(const IceGrid::NodeDynamicInfoSeq &nodeSeq)
void updateAdapterInfo(const std::string &nodeName, const IceGrid::AdapterDynamicInfo &adapterUpdateInfo)
::IceInternal::Handle<::Ice::ObjectAdapter > ObjectAdapterPtr
Definition IceManager.h:52
ArmarX Headers.
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceUtil::Handle< IceGridAdmin > IceGridAdminPtr
Definition ArmarXFwd.h:48