From 80bc490638626e01727931ec14202f13b0612256 Mon Sep 17 00:00:00 2001
From: Christoph Kampmeyer <christoph.kampmeyer@desy.de>
Date: Thu, 23 Apr 2020 14:27:25 +0200
Subject: [PATCH] wip #107: Format test, change HierarchyModifiers in testApp

---
 tests/executables_src/testStatusAggregator.cc | 47 +++++++++----------
 1 file changed, 21 insertions(+), 26 deletions(-)

diff --git a/tests/executables_src/testStatusAggregator.cc b/tests/executables_src/testStatusAggregator.cc
index 2b36d1a1..c7303be9 100644
--- a/tests/executables_src/testStatusAggregator.cc
+++ b/tests/executables_src/testStatusAggregator.cc
@@ -8,63 +8,58 @@
 #include "ModuleGroup.h"
 #include "TestFacility.h"
 
-
 using namespace boost::unit_test_framework;
 
 namespace ctk = ChimeraTK;
 
-
 struct OuterGroup : public ctk::ModuleGroup {
   using ctk::ModuleGroup::ModuleGroup;
-  virtual ~OuterGroup(){}
+  virtual ~OuterGroup() {}
 
-  ctk::MinMonitor<double_t> outerMinMonitor{this, "outerMinMonitor", "", "watch", "status", ctk::HierarchyModifier::none,
-                           {"OUTER_MON_OUTPUT"}, {"OUTER_MON_PARAMS"},{"OUTER_MON_INPUT"}};
-
-  //ctk::StatusAggregator outerStatusAggregator{this, "outerStatusAggregator", "", ctk::HierarchyModifier::none, {"STATUS"}};
+  ctk::MinMonitor<double_t> outerMinMonitor{this, "outerMinMonitor", "", "watch", "status",
+      ctk::HierarchyModifier::none, {"OUTER_MON_OUTPUT"}, {"OUTER_MON_PARAMS"}, {"OUTER_MON_INPUT"}};
 
   struct InnerGroup : public ctk::ModuleGroup {
     using ctk::ModuleGroup::ModuleGroup;
 
-    ctk::MinMonitor<double_t> innerMinMonitor{this, "innerMinMonitor", "", "minWatch", "minStatus", ctk::HierarchyModifier::none,
-                             {"INNER_MON_OUTPUT"}, {"INNER_MON_PARAMS"},{"INNER_MON_INPUT"}};
-    ctk::StateMonitor<uint8_t> innerStateMonitor{this, "innerStateMonitor", "", "stateWatch", "stateStatus", ctk::HierarchyModifier::none,
-                             {"INNER_MON_OUTPUT"}, {"INNER_MON_PARAMS"},{"INNER_MON_INPUT"}};
+    ctk::MinMonitor<double_t> innerMinMonitor{this, "innerMinMonitor", "", "minWatch", "minStatus",
+        ctk::HierarchyModifier::none, {"INNER_MON_OUTPUT"}, {"INNER_MON_PARAMS"}, {"INNER_MON_INPUT"}};
+
+    // 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"}};
 
   } innerGroup{this, "innerModuleGroup", ""};
 
+  ctk::StatusAggregator outerStatusAggregator{this, "outerStatusAggregator", "StatusAggregator of OuterGroup",
+      "groupStatus", ctk::HierarchyModifier::hideThis, {"STATUS"}};
 };
 
-
 struct TestApplication : public ctk::Application {
-  TestApplication() : Application("testApp"){}
-  ~TestApplication(){ shutdown(); }
+  TestApplication() : Application("testApp") {}
+  ~TestApplication() { shutdown(); }
 
   OuterGroup outerModuleGroup1{this, "outerModuleGroup1", ""};
-  OuterGroup outerModuleGroup2{this, "outerModuleGroup2", ""};
+  //OuterGroup outerModuleGroup2{this, "outerModuleGroup2", ""};
 
-  ctk::StateMonitor<uint8_t> globalStateMonitor{this, "globalStateMonitor", "", "stateWatch", "stateStatus", ctk::HierarchyModifier::none,
-                           {"GLOBAL_MON_OUTPUT"}, {"GLOBAL_MON_PARAMS"},{"GLOBAL_MON_INPUT"}};
+  ctk::StateMonitor<uint8_t> globalStateMonitor{this, "globalStateMonitor", "", "stateWatch", "stateStatus",
+      ctk::HierarchyModifier::none, {"GLOBAL_MON_OUTPUT"}, {"GLOBAL_MON_PARAMS"}, {"GLOBAL_MON_INPUT"}};
 
   ctk::ControlSystemModule cs;
 
   ctk::StatusAggregator globalStatusAggregator{this, "globalStatusAggregator", "Global StatusAggregator of testApp",
-                                               "globalStatus", ctk::HierarchyModifier::none, {"STATUS"}};
+      "globalStatus", ctk::HierarchyModifier::none, {"STATUS"}};
 
-  void defineConnections(){
-    findTag(".*").connectTo(cs);
-  }
+  void defineConnections() { findTag(".*").connectTo(cs); }
 };
 
-
-
-BOOST_AUTO_TEST_CASE(testStatusAggregator){
+BOOST_AUTO_TEST_CASE(testStatusAggregator) {
   std::cout << "testStatusAggregator" << std::endl;
 
   TestApplication app;
 
   ctk::TestFacility test;
   test.runApplication();
-  //app.dump();
-
+//  app.dump();
+  app.cs.dump();
 }
-- 
GitLab