33 using namespace Data_Structure;
37 m_itemData = rootData.toVector();
42 this->scenario = scenario;
49 this->application = application;
50 setEnabled(application->getEnabled());
58 this->packageName = name;
60 for (
const auto& appl : applications)
80 if (scenario.get() !=
nullptr)
83 m_itemData[4] = QString::fromStdString(scenario->getStatus());
85 else if (!packageName.empty())
87 m_itemData[0] = QString::fromStdString(packageName);
89 std::string
status = ApplicationStatus::Unknown;
100 auto childState =
child(i)->
data(4).toString().toStdString();
105 else if (
status == ApplicationStatus::Unknown && childState == ApplicationStatus::Stopped)
107 status = ApplicationStatus::Stopped;
109 else if (
status == ApplicationStatus::Unknown && childState == ApplicationStatus::Inactive)
111 status = ApplicationStatus::Inactive;
113 else if (
status != ApplicationStatus::Unknown && childState == ApplicationStatus::Missing)
120 || (
status == ApplicationStatus::Stopped && childState == ApplicationStatus::Inactive)
122 || (
status == ApplicationStatus::Inactive && childState == ApplicationStatus::Stopped))
124 status = ApplicationStatus::Mixed;
127 else if (childState == ApplicationStatus::Waiting)
129 status = ApplicationStatus::Waiting;
138 if (application->getInstanceName().empty())
140 m_itemData [0] = application->getName().c_str();
144 m_itemData[0] = (application->getInstanceName() +
"." + application->getName()).c_str();
147 std::string
status = application->getStatus();
148 if (!application->getFound())
151 ARMARX_INFO <<
"Application '" + application->getExecutableAbsPath() +
"' not found!";
153 m_itemData[4] = QVariant(QString::fromStdString(ApplicationStatus::Missing));
159 else if (
status == ApplicationStatus::Stopped)
161 m_itemData[4] = QVariant(QString::fromStdString(ApplicationStatus::Stopped));
163 else if (
status == ApplicationStatus::Inactive)
165 m_itemData[4] = QVariant(QString::fromStdString(ApplicationStatus::Inactive));
167 else if (
status == ApplicationStatus::Waiting)
169 m_itemData[4] = QVariant(QString::fromStdString(ApplicationStatus::Waiting));
173 m_itemData[4] = QVariant(QString::fromStdString(ApplicationStatus::Unknown));