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 
35 namespace Ui
36 {
37  class ThreadViewer;
38 }
39 
40 namespace armarx
41 {
42 
43  class ThreadViewerModel;
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;
122  RunningTask<ThreadViewer>::pointer_type managerUpdateTask;
123  ThreadViewerModel* periodicTaskModel;
124  RunningTaskModel* runningTaskModel;
125  Ui::ThreadViewer* ui;
126  };
127 } // namespace armarx
armarx::ThreadViewer::cpuUsageValueUpdated
void cpuUsageValueUpdated(int value)
armarx::ThreadViewer::~ThreadViewer
~ThreadViewer() override
Definition: ThreadViewer.cpp:88
armarx::ThreadViewer::onInitComponent
void onInitComponent() override
Definition: ThreadViewer.cpp:104
list
list(APPEND SOURCES ${QT_RESOURCES}) set(COMPONENT_LIBS ArmarXGui ArmarXCoreObservers ArmarXCoreEigen3Variants PlotterController $
Definition: CMakeLists.txt:49
PeriodicTask.h
armarx::ThreadViewerModel
Definition: ThreadViewerModel.h:34
RunningTask.h
armarx::ThreadViewer::threadManagerListUpdated
void threadManagerListUpdated(QStringList list)
armarx::ArmarXComponentWidgetControllerTemplate
Definition: ArmarXComponentWidgetController.h:69
armarx::ThreadViewer::retrieveThreadManagerList
void retrieveThreadManagerList()
Definition: ThreadViewer.cpp:148
armarx::ThreadViewer::cpuUsageValueSet
void cpuUsageValueSet(int value)
Definition: ThreadViewer.cpp:205
armarx::ThreadViewer::loadSettings
void loadSettings(QSettings *settings) override
Load stored manager models.
Definition: ThreadViewer.cpp:94
armarx::ThreadViewer::GetWidgetName
static QString GetWidgetName()
Returns the Widget name displayed in the ArmarXGui to create an instance of this.
Definition: ThreadViewer.h:83
cxxopts::value
std::shared_ptr< Value > value()
Definition: cxxopts.hpp:855
armarx::ThreadViewer::saveSettings
void saveSettings(QSettings *settings) override
Saves the manager models.
Definition: ThreadViewer.cpp:99
ArmarXComponentWidgetController.h
armarx::ThreadViewer
The ThreadViewer displays all threads of an ArmarX application.
Definition: ThreadViewer.h:60
Ui
ArmarX Headers.
Definition: ArmarXMainWindow.h:54
armarx::ThreadViewer::triggerThreadManagerListUpdate
void triggerThreadManagerListUpdate()
Definition: ThreadViewer.cpp:133
armarx::ThreadViewer::GetWidgetIcon
static QIcon GetWidgetIcon()
Definition: ThreadViewer.h:89
ThreadList.h
armarx::ThreadViewer::managedSelectionChanged
void managedSelectionChanged(QString selectedString)
Definition: ThreadViewer.cpp:192
armarx::ThreadViewer::updateThreadManagerList
void updateThreadManagerList(QStringList list)
Definition: ThreadViewer.cpp:175
armarx::ThreadViewer::onExitComponent
void onExitComponent() override
Hook for subclass.
Definition: ThreadViewer.cpp:119
armarx::ThreadViewer::threadManagerUpdateRequired
void threadManagerUpdateRequired()
IceUtil::Handle
Definition: forward_declarations.h:30
armarx::ThreadViewer::ThreadViewer
ThreadViewer()
Definition: ThreadViewer.cpp:37
armarx::ThreadViewer::onConnectComponent
void onConnectComponent() override
Definition: ThreadViewer.cpp:109
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
armarx::RunningTaskModel
Definition: RunningTaskModel.h:34