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 
29 
30 #include <QWidget>
31 
32 #include <mutex>
33 
34 namespace Ui
35 {
36  class ThreadViewer;
37 }
38 namespace armarx
39 {
40 
41  class ThreadViewerModel;
42  class RunningTaskModel;
43 
44  /**
45  * \page ArmarXGui-GuiPlugins-ThreadViewer ThreadViewer
46  * \brief The ThreadViewer displays all threads of an ArmarX application.
47  * \image html ThreadViewer.png
48  * The ThreadViewer allows you to select a running application from the drop-down-menu on top and list all
49  * of its threads.
50  * ArmarXGui Documentation \ref ThreadViewer
51  * \see SystemStateMonitorPlugin
52  */
53 
54  /**
55  * \class ThreadViewer
56  * \brief The ThreadViewer displays all threads of an ArmarX application.
57  */
59  {
60  Q_OBJECT
61 
62  public:
63  explicit ThreadViewer();
64  ~ThreadViewer() 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 GetWidgetName()
81  {
82  return "Meta.ThreadViewer";
83  }
84  static QIcon GetWidgetIcon()
85  {
86  return QIcon {"://icons/thread_viewer.svg"};
87  }
88 
89  /**
90  * @see armarx::Component::onInitComponent()
91  */
92  void onInitComponent() override;
93 
94  /**
95  * @see armarx::Component::onConnectComponent()
96  */
97  void onConnectComponent() override;
98  void onExitComponent() override;
99 
100  signals:
101  void threadManagerListUpdated(QStringList list);
103  void cpuUsageValueUpdated(int value);
104 
105  public slots:
107  void updateThreadManagerList(QStringList list);
108  void managedSelectionChanged(QString selectedString);
110  void cpuUsageValueSet(int value);
111 
112  private:
113  void runThreadManagerUpdate();
114  mutable std::recursive_mutex proxyMutex;
115  ThreadListInterfacePrx threadManagerProxy;
117  RunningTask<ThreadViewer>::pointer_type managerUpdateTask;
118  ThreadViewerModel* periodicTaskModel;
119  RunningTaskModel* runningTaskModel;
120  Ui::ThreadViewer* ui;
121  };
122 }
123 
armarx::ThreadViewer::cpuUsageValueUpdated
void cpuUsageValueUpdated(int value)
armarx::ThreadViewer::~ThreadViewer
~ThreadViewer() override
Definition: ThreadViewer.cpp:83
armarx::ThreadViewer::onInitComponent
void onInitComponent() override
Definition: ThreadViewer.cpp:96
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:137
armarx::ThreadViewer::cpuUsageValueSet
void cpuUsageValueSet(int value)
Definition: ThreadViewer.cpp:191
armarx::ThreadViewer::loadSettings
void loadSettings(QSettings *settings) override
Load stored manager models.
Definition: ThreadViewer.cpp:88
armarx::ThreadViewer::GetWidgetName
static QString GetWidgetName()
Returns the Widget name displayed in the ArmarXGui to create an instance of this.
Definition: ThreadViewer.h:80
cxxopts::value
std::shared_ptr< Value > value()
Definition: cxxopts.hpp:926
armarx::ThreadViewer::saveSettings
void saveSettings(QSettings *settings) override
Saves the manager models.
Definition: ThreadViewer.cpp:92
ArmarXComponentWidgetController.h
armarx::ThreadViewer
The ThreadViewer displays all threads of an ArmarX application.
Definition: ThreadViewer.h:58
Ui
ArmarX Headers.
Definition: ArmarXMainWindow.h:58
armarx::ThreadViewer::triggerThreadManagerListUpdate
void triggerThreadManagerListUpdate()
Definition: ThreadViewer.cpp:123
armarx::ThreadViewer::GetWidgetIcon
static QIcon GetWidgetIcon()
Definition: ThreadViewer.h:84
ThreadList.h
armarx::ThreadViewer::managedSelectionChanged
void managedSelectionChanged(QString selectedString)
Definition: ThreadViewer.cpp:179
armarx::ThreadViewer::updateThreadManagerList
void updateThreadManagerList(QStringList list)
Definition: ThreadViewer.cpp:162
armarx::ThreadViewer::onExitComponent
void onExitComponent() override
Hook for subclass.
Definition: ThreadViewer.cpp:111
armarx::ThreadViewer::threadManagerUpdateRequired
void threadManagerUpdateRequired()
IceUtil::Handle
Definition: forward_declarations.h:29
armarx::ThreadViewer::ThreadViewer
ThreadViewer()
Definition: ThreadViewer.cpp:36
armarx::ThreadViewer::onConnectComponent
void onConnectComponent() override
Definition: ThreadViewer.cpp:103
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::RunningTaskModel
Definition: RunningTaskModel.h:34