From 8310ca61bdfd576319028bcb69f6358e3848e1e8 Mon Sep 17 00:00:00 2001
From: Martin Hierholzer <martin.hierholzer@desy.de>
Date: Mon, 14 Nov 2016 16:07:04 +0100
Subject: [PATCH] simplification: read all inputs once

---
 src/ApplicationModule.cc | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/ApplicationModule.cc b/src/ApplicationModule.cc
index ed0c4e73..b13f287d 100644
--- a/src/ApplicationModule.cc
+++ b/src/ApplicationModule.cc
@@ -11,16 +11,15 @@
 namespace ChimeraTK {
 
   void ApplicationModule::run() {
-    assert(!moduleThread.joinable());
 
-    // read all control system to application variables once, to set the startup value e.g. coming from the config file
+    // read all input variables once, to set the startup value e.g. coming from the config file
     // (without triggering an action inside the application)
     for(auto &variable : getAccessorList()) {
-      if( variable->getNode().getOwner().getFeedingNode().getType() == NodeType::ControlSystem ) {
-        variable->readNonBlocking();
-      }
+      if(variable->getDirection() == VariableDirection::consuming) variable->readNonBlocking();
     }
 
+    // start the module thread
+    assert(!moduleThread.joinable());
     moduleThread = boost::thread(&ApplicationModule::mainLoopWrapper, this);
   }
 
-- 
GitLab