Skip to content
Snippets Groups Projects
Commit 8d361f65 authored by Christoph Kampmeyer's avatar Christoph Kampmeyer
Browse files

wip #107: Another try: Virtualise entire Application

parent 80bc4906
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
......@@ -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();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment