142 bool deactivateIfMissing)
145 IceUtil::Time start = IceUtil::Time::now();
147 std::map<std::string, std::vector<QString>> offererMap;
148 std::map<std::string, std::vector<QString>> listenerMap;
150 for (
int i = 0; i < this->rowCount(); i++)
165 auto it = managerDataMap.find(item->
getName());
166 if (it == managerDataMap.end())
169 << item->
getName().toStdString();
170 if (deactivateIfMissing)
191 if (it->second.proxy)
201 for (
auto updateIt = updates.constBegin(); updateIt != updates.constEnd();
204 const QString& objName = updateIt.key();
213 offererMap[
topic].push_back(objName);
217 listenerMap[
topic].push_back(objName);
224 for (
int i = 0; i < this->rowCount(); i++)
227 item->setEditable(
false);
233 managerBrush.setStyle(Qt::SolidPattern);
234 managerBrush.setColor(Qt::lightGray);
239 managerBrush.setColor(Qt::transparent);
242 item->setBackground(managerBrush);
244 auto addPropertiesToItem =
245 [](ObjectPropertyInfos
const& properties, QStandardItem* item)
247 if (!properties.empty())
249 QStandardItem* objectPropertiesItem =
new QStandardItem(
"Properties");
250 objectPropertiesItem->setEditable(
false);
252 QList<QStandardItem*> objectPropertiesRow;
254 for (
auto property : properties)
256 QStandardItem* objectPropertyItem =
257 new QStandardItem(QString(
"%1 %2: %3")
258 .arg(property.first.c_str())
259 .arg(property.second.constant ?
"(constant)" :
"")
260 .arg(property.second.value.c_str()));
261 objectPropertyItem->setEditable(!property.second.constant);
262 if (!property.second.constant)
264 objectPropertyItem->setToolTip(
265 "Double-click to edit this property and to send the updated "
266 "property to the component.");
268 objectPropertiesRow.append(objectPropertyItem);
271 objectPropertiesItem->appendRows(objectPropertiesRow);
272 item->appendRow(objectPropertiesItem);
276 if (item->rowCount() == 0 && item->
isOnline())
278 auto applicationItem =
new QStandardItem(
"Application Properties");
281 applicationItem->setEditable(
false);
287 addPropertiesToItem(properties, applicationItem);
288 item->appendRow(applicationItem);
298 const QList<QString> objectNames =
objects.keys();
299 for (
int j = 0; j < objectNames.size(); j++)
301 const QString& objName = objectNames.at(j);
306 objItem.
item =
new QStandardItem(objName);
307 objItem.
item->setEditable(
false);
309 item->appendRow(objItem.
item);
315 addPropertiesToItem(properties, objItem.
item);
318 metaInfoItem->setEditable(
false);
321 auto name = QString::fromStdString(pair.first);
324 auto variant = VariantPtr::dynamicCast(pair.second);
326 ? QString::fromStdString(variant->getOutputValueOnly())
328 QStandardItem* infoItem =
new QStandardItem(
329 name +
": " + (value.size() > 100 ? (value.left(100) +
"...") : value));
333 infoItem->setEditable(
false);
334 metaInfoItem->appendRow(infoItem);
336 objItem.
item->appendRow(metaInfoItem);
338 DependencyMap depMap = objItem.
connectivity.dependencies;
339 DependencyMap::iterator it = depMap.begin();
342 while (it != depMap.end())
344 QStandardItem* depObjItem =
345 new QStandardItem(it->second->getName().c_str());
346 depObjItem->setEditable(
false);
348 if (it->second->getResolved())
351 depObjItem->setBackground(QBrush(QColor(50, 205, 50)));
352 depObjItem->setToolTip(
"Dependency resolved");
357 depObjItem->setBackground(QBrush(QColor(255, 106, 106)));
358 depObjItem->setToolTip(
"Dependency missing");
360 objItem.
item->appendRow(depObjItem);
375 endpointItem =
new QStandardItem(endpointText);
376 endpointItem->setEditable(
false);
379 item->appendRow(endpointItem);
383 endpointItem->setText(endpointText);
386 DependencyMap depMap = objItem.
connectivity.dependencies;
387 DependencyMap::iterator it = depMap.begin();
390 while (it != depMap.end())
393 findItem(QString::fromStdString(it->second->getName()), objItem.
item);
398 depObjItem->setEditable(
false);
400 if (it->second->getResolved())
403 depObjItem->setBackground(QBrush(QColor(50, 205, 50)));
404 depObjItem->setToolTip(
"Dependency resolved");
409 depObjItem->setBackground(QBrush(QColor(255, 106, 106)));
410 depObjItem->setToolTip(
"Dependency missing");
420 auto topicsItem = findItem(QString(
"Offered Topics"), objItem.
item);
424 new QStandardItem(QString::fromStdString(
"Offered Topics"));
425 topicsItem->setEditable(
false);
426 objItem.
item->appendRow(topicsItem);
431 auto topicItem = findItem(QString::fromStdString(
topic), topicsItem);
434 topicItem =
new QStandardItem(QString::fromStdString(
topic));
435 topicItem->setEditable(
false);
436 topicsItem->appendRow(topicItem);
438 auto& listeners = listenerMap[
topic];
439 syncStringListChildren(topicItem, listeners);
452 auto topicsItem = findItem(QString(
"Used Topics"), objItem.
item);
455 topicsItem =
new QStandardItem(QString::fromStdString(
"Used Topics"));
456 topicsItem->setEditable(
false);
457 objItem.
item->appendRow(topicsItem);
466 findItem(QString::fromStdString(
topic), topicsItem);
469 topicItem =
new QStandardItem(QString::fromStdString(
topic));
470 topicItem->setEditable(
false);
471 topicsItem->appendRow(topicItem);
473 if (offererMap.count(
topic) == 0)
475 topicItem->setBackground(QBrush(QColor(255, 163, 33)));
476 topicItem->setToolTip(
477 "The topic " + QString::fromStdString(
topic) +
478 " is not offered by any listed component - though not all "
479 "components might be listed");
483 topicItem->setBackground(QBrush());
484 auto& offerers = offererMap[
topic];
485 syncStringListChildren(topicItem, offerers);
494 topicItem->setEditable(
false);
505 metaInfoItem->removeRows(0, metaInfoItem->rowCount());
508 auto name = QString::fromStdString(pair.first);
510 auto variant = VariantPtr::dynamicCast(pair.second);
512 variant ? QString::fromStdString(variant->getOutputValueOnly())
514 QStandardItem* infoItem =
new QStandardItem(
516 (value.size() > 100 ? (value.left(100) +
"...") : value));
518 infoItem->setEditable(
false);
519 metaInfoItem->appendRow(infoItem);
525 auto stateBool = objItem.
state == eManagedIceObjectStarted;
528 objItem.
item->setToolTip(
529 "Component state: " +
530 QString::fromStdString(
537 << (IceUtil::Time::now() - start).toMilliSecondsDouble() <<
" ms";
769 brush.setStyle(Qt::SolidPattern);
773 case armarx::eManagedIceObjectCreated:
774 brush.setColor(QColor(255, 196, 106));
777 case armarx::eManagedIceObjectInitializing:
778 brush.setColor(QColor(255, 255, 196));
781 case armarx::eManagedIceObjectInitialized:
782 brush.setColor(QColor(255, 255, 0));
785 case armarx::eManagedIceObjectInitializationFailed:
786 brush.setColor(QColor(255, 16, 16));
789 case armarx::eManagedIceObjectStarting:
790 brush.setColor(QColor(128, 196, 255));
793 case armarx::eManagedIceObjectStarted:
794 brush.setColor(QColor(128, 255, 128));
797 case armarx::eManagedIceObjectStartingFailed:
798 brush.setColor(QColor(255, 64, 64));
801 case armarx::eManagedIceObjectExiting:
802 brush.setColor(QColor(225, 225, 225));
805 case armarx::eManagedIceObjectExited:
806 brush.setColor(QColor(196, 196, 196));