ThreadViewer.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 Mirko Waechter ( mirko.waechter 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 <QWidget>
28
32
34
35namespace Ui
36{
37 class ThreadViewer;
38}
39
40namespace armarx
41{
42
44 class RunningTaskModel;
45
46 /**
47 * \page ArmarXGui-GuiPlugins-ThreadViewer ThreadViewer
48 * \brief The ThreadViewer displays all threads of an ArmarX application.
49 * \image html ThreadViewer.png
50 * The ThreadViewer allows you to select a running application from the drop-down-menu on top and list all
51 * of its threads.
52 * ArmarXGui Documentation \ref ThreadViewer
53 * \see SystemStateMonitorPlugin
54 */
55
56 /**
57 * \class ThreadViewer
58 * \brief The ThreadViewer displays all threads of an ArmarX application.
59 */
61 {
62 Q_OBJECT
63
64 public:
65 explicit ThreadViewer();
66 ~ThreadViewer() override;
67
68 /**
69 * Load stored manager models
70 */
71 void loadSettings(QSettings* settings) override;
72
73 /**
74 * Saves the manager models
75 */
76 void saveSettings(QSettings* settings) override;
77
78 /**
79 * Returns the Widget name displayed in the ArmarXGui to create an
80 * instance of this.
81 */
82 static QString
84 {
85 return "Meta.ThreadViewer";
86 }
87
88 static QIcon
90 {
91 return QIcon{"://icons/thread_viewer.svg"};
92 }
93
94 /**
95 * @see armarx::Component::onInitComponent()
96 */
97 void onInitComponent() override;
98
99 /**
100 * @see armarx::Component::onConnectComponent()
101 */
102 void onConnectComponent() override;
103 void onExitComponent() override;
104
105 signals:
106 void threadManagerListUpdated(QStringList list);
108 void cpuUsageValueUpdated(int value);
109
110 public slots:
112 void updateThreadManagerList(QStringList list);
113 void managedSelectionChanged(QString selectedString);
115 void cpuUsageValueSet(int value);
116
117 private:
118 void runThreadManagerUpdate();
119 mutable std::recursive_mutex proxyMutex;
120 ThreadListInterfacePrx threadManagerProxy;
123 ThreadViewerModel* periodicTaskModel;
124 RunningTaskModel* runningTaskModel;
125 Ui::ThreadViewer* ui;
126 };
127} // namespace armarx
IceUtil::Handle< PeriodicTask< T > > pointer_type
Shared pointer type for convenience.
IceUtil::Handle< RunningTask< T > > pointer_type
Shared pointer type for convenience.
void onInitComponent() override
void managedSelectionChanged(QString selectedString)
void threadManagerUpdateRequired()
void loadSettings(QSettings *settings) override
Load stored manager models.
void saveSettings(QSettings *settings) override
Saves the manager models.
void updateThreadManagerList(QStringList list)
void cpuUsageValueUpdated(int value)
void triggerThreadManagerListUpdate()
void onConnectComponent() override
void threadManagerListUpdated(QStringList list)
static QString GetWidgetName()
Returns the Widget name displayed in the ArmarXGui to create an instance of this.
void onExitComponent() override
Hook for subclass.
static QIcon GetWidgetIcon()
void cpuUsageValueSet(int value)
ArmarX Headers.
This file offers overloads of toIce() and fromIce() functions for STL container types.