Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ApplicationCore
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ChimeraTK Mirror
ApplicationCore
Commits
8d361f65
Commit
8d361f65
authored
4 years ago
by
Christoph Kampmeyer
Browse files
Options
Downloads
Patches
Plain Diff
wip #107: Another try: Virtualise entire Application
parent
80bc4906
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Modules/src/StatusAggregator.cc
+28
-9
28 additions, 9 deletions
Modules/src/StatusAggregator.cc
tests/executables_src/testStatusAggregator.cc
+6
-7
6 additions, 7 deletions
tests/executables_src/testStatusAggregator.cc
with
34 additions
and
16 deletions
Modules/src/StatusAggregator.cc
+
28
−
9
View file @
8d361f65
...
...
@@ -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
(
".*"
).
getAccessorListRecur
si
v
e
()
}
;
//
std::cout << " Size of allAccessors: " << allAccessors.
si
z
e()
<< 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
;
}
...
...
This diff is collapsed.
Click to expand it.
tests/executables_src/testStatusAggregator.cc
+
6
−
7
View file @
8d361f65
...
...
@@ -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();
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment