24 #include <ArmarXGui/gui-plugins/SystemStateMonitorPlugin/ui_ThreadViewer.h>
46 ui->threadListView->setModel(periodicTaskModel);
49 ui->threadListView->setColumnWidth(0, 150);
50 ui->threadListView->setColumnWidth(1, 30);
51 ui->threadListView->setColumnWidth(2, 50);
52 ui->threadListView->setColumnWidth(3, 90);
53 ui->threadListView->setColumnWidth(4, 100);
54 ui->threadListView->setColumnWidth(5, 100);
55 ui->threadListView->setColumnWidth(6, 80);
56 ui->threadListView->setColumnWidth(7, 70);
57 ui->threadListView->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
61 ui->runningTaskView->setModel(runningTaskModel);
64 ui->runningTaskView->setColumnWidth(0, 150);
65 ui->runningTaskView->setColumnWidth(1, 30);
66 ui->runningTaskView->setColumnWidth(2, 90);
67 ui->runningTaskView->setColumnWidth(3, 100);
68 ui->runningTaskView->setColumnWidth(4, 100);
69 ui->runningTaskView->setColumnWidth(5, 70);
70 ui->runningTaskView->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
74 ui->threadListView->setFont(font);
75 ui->runningTaskView->setFont(font);
79 connect(ui->cbThreadListManager, SIGNAL(currentIndexChanged(QString)),
this, SLOT(
managedSelectionChanged(QString)));
108 periodicTask->start();
115 periodicTask->stop();
118 if (managerUpdateTask)
120 managerUpdateTask->stop();
125 if (managerUpdateTask && managerUpdateTask->isRunning())
130 ui->btnRefresh->setEnabled(
false);
131 ui->btnRefresh->setToolTip(
"Refreshing manager list...please wait");
133 managerUpdateTask->start();
139 std::vector<std::string> managerList;
140 QStringList qManagerList;
146 ->getRegisteredObjectNames< ThreadListInterfacePrx >(
"*ThreadList");
148 for (
unsigned int i = 0; i < managerList.size(); ++i)
150 qManagerList << QString::fromStdString(managerList.at(i));
164 QString lastSelectionText = ui->cbThreadListManager->currentText();
165 ui->cbThreadListManager->clear();
166 ui->cbThreadListManager->addItems(
list);
167 int index = ui->cbThreadListManager->findText(lastSelectionText);
171 ui->cbThreadListManager->setCurrentIndex(
index);
174 ui->btnRefresh->setEnabled(
true);
175 ui->btnRefresh->setToolTip(
"Refresh the thread manager list");
181 if (selectedString.size() == 0)
186 std::unique_lock lock(proxyMutex);
187 threadManagerProxy = getProxy<ThreadListInterfacePrx>(selectedString.toStdString());
188 ARMARX_VERBOSE <<
"new proxy for ThreadViewerModel set: " << selectedString;
194 ui->cpuUsageProgressBar->setValue(
value);
197 void ThreadViewer::runThreadManagerUpdate()
199 std::unique_lock lock(proxyMutex);
201 if (!threadManagerProxy)
208 PeriodicTaskList periodicTaskList = threadManagerProxy->getPeriodicTasks();
211 RunningTaskList runningTaskList = threadManagerProxy->getRunningTasks();
214 Ice::Double cpuProcTotalTime = threadManagerProxy->getCpuUsage();
215 int value =
static_cast<int>(cpuProcTotalTime);
218 catch (Ice::NotRegisteredException& e)
222 catch (Ice::ObjectAdapterDeactivatedException& e)
226 catch (Ice::UnknownLocalException& e)