diff --git a/Modules/src/StatusAggregator.cc b/Modules/src/StatusAggregator.cc index f35af076617d6f851cf7c893d29cde9df6171519..c61f8ac5e215d77464e1208d5b0473556bc0fffd 100644 --- a/Modules/src/StatusAggregator.cc +++ b/Modules/src/StatusAggregator.cc @@ -6,6 +6,8 @@ namespace ChimeraTK{ void StatusAggregator::populateStatusInput(){ + std::cout << "Populating aggregator " << getName() << ", fully qualified name is: " + << getQualifiedName() <<std::endl; // This does not work, we need to operate on the virtual hierarchy //std::list<Module*> subModuleList{getOwner()->getSubmoduleList()}; @@ -21,20 +23,37 @@ namespace ChimeraTK{ // Works, as long as we do not use HIerarchyModifiers other than "none" in the test app - std::cout << "Populating aggregator " << getName() << std::endl; + // Update: This still has problems, because getOwner gives us the "real" C++ Module + // We need to do everything on the virtual plane +// auto allAccessors{getOwner()->findTag(".*").getAccessorListRecursive()}; - auto allAccessors{getOwner()->findTag(".*").getAccessorListRecursive()}; +// std::cout << " Size of allAccessors: " << allAccessors.size() << std::endl; - std::cout << " Size of allAccessors: " << allAccessors.size() << std::endl; +// for(auto acc : allAccessors){ - for(auto acc : allAccessors){ +// if(acc.getDirection().dir == VariableDirection::feeding){ +// std::cout << " -- Accessor: " << acc.getName() +// << " of module: " << acc.getOwningModule()->getName() +// << std::endl; +// } + +// } - if(acc.getDirection().dir == VariableDirection::feeding){ - std::cout << " -- Accessor: " << acc.getName() - << " of module: " << acc.getOwningModule()->getName() - << std::endl; - } + // Another try, virtualise the entire Application + auto virtualApplicationHierarchy = Application::getInstance().findTag(".*"); + std::cout << " ** Fully qualified name in vitual hierarchy: " + << virtualApplicationHierarchy.getQualifiedName() << std::endl; + + virtualApplicationHierarchy.virtualise(); + auto virtualizedModuleList = virtualApplicationHierarchy.getSubmoduleListRecursive(); + + for(auto module : virtualizedModuleList){ + std::cout << " ** " << module->getQualifiedName(); + if (module == this){ + std::cout << " THIS IS THIS STATUS_AGGREGATOR!"; + } + std::cout << std::endl; } diff --git a/tests/executables_src/testStatusAggregator.cc b/tests/executables_src/testStatusAggregator.cc index c7303be9437c06646ec9168389a82d39de76f817..397b1ba711e7668fd1849ae040cb3d7b340d5a9b 100644 --- a/tests/executables_src/testStatusAggregator.cc +++ b/tests/executables_src/testStatusAggregator.cc @@ -27,20 +27,20 @@ struct OuterGroup : public ctk::ModuleGroup { // A Monitor which gets hidden in the hierarchy ctk::StateMonitor<uint8_t> innerStateMonitor{this, "innerStateMonitor", "", "stateWatch", "stateStatus", - ctk::HierarchyModifier::hideThis, {"INNER_MON_OUTPUT"}, {"INNER_MON_PARAMS"}, {"INNER_MON_INPUT"}}; + ctk::HierarchyModifier::oneLevelUp, {"INNER_MON_OUTPUT"}, {"INNER_MON_PARAMS"}, {"INNER_MON_INPUT"}}; - } innerGroup{this, "innerModuleGroup", ""}; + } innerGroup{this, "innerModuleGroup", "", ctk::HierarchyModifier::none}; ctk::StatusAggregator outerStatusAggregator{this, "outerStatusAggregator", "StatusAggregator of OuterGroup", - "groupStatus", ctk::HierarchyModifier::hideThis, {"STATUS"}}; + "groupStatus", ctk::HierarchyModifier::none, {"STATUS"}}; }; struct TestApplication : public ctk::Application { TestApplication() : Application("testApp") {} ~TestApplication() { shutdown(); } - OuterGroup outerModuleGroup1{this, "outerModuleGroup1", ""}; - //OuterGroup outerModuleGroup2{this, "outerModuleGroup2", ""}; + OuterGroup outerModuleGroup1{this, "outerModuleGroup1", "", ctk::HierarchyModifier::none}; + //OuterGroup outerModuleGroup2{this, "outerModuleGroup2", "", ctk::HierarchyModifier::hideThis}; ctk::StateMonitor<uint8_t> globalStateMonitor{this, "globalStateMonitor", "", "stateWatch", "stateStatus", ctk::HierarchyModifier::none, {"GLOBAL_MON_OUTPUT"}, {"GLOBAL_MON_PARAMS"}, {"GLOBAL_MON_INPUT"}}; @@ -60,6 +60,5 @@ BOOST_AUTO_TEST_CASE(testStatusAggregator) { ctk::TestFacility test; test.runApplication(); -// app.dump(); - app.cs.dump(); + //app.cs.dump(); }