>From 3ae584a2e18d7069442fbceadf5dae3d01716b4a Mon Sep 17 00:00:00 2001 From: Matthias Goldhoorn Date: Fri, 10 Jan 2014 16:16:04 +0100 Subject: [PATCH 1/2] SlaveActivity Fixed bug in which case operations within Task's were not called anymore if the task is not running, and a slave of another one. --- rtt/ExecutionEngine.cpp | 7 +++++-- rtt/ExecutionEngine.hpp | 3 ++- rtt/base/RunnableInterface.hpp | 2 +- rtt/extras/SlaveActivity.cpp | 4 +++- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/rtt/ExecutionEngine.cpp b/rtt/ExecutionEngine.cpp index 89cf477..1f6d81f 100644 --- a/rtt/ExecutionEngine.cpp +++ b/rtt/ExecutionEngine.cpp @@ -318,12 +318,15 @@ namespace RTT } } - void ExecutionEngine::step() { + void ExecutionEngine::step(bool onlyInternal) { processMessages(); processFunctions(); - processChildren(); // aren't these ExecutableInterfaces ie functions ? + if(!onlyInternal){ + processChildren(); // aren't these ExecutableInterfaces ie functions ? + } } + void ExecutionEngine::processChildren() { // only call updateHook in the Running state. if ( taskc ) { diff --git a/rtt/ExecutionEngine.hpp b/rtt/ExecutionEngine.hpp index e55bcd4..2a37e76 100644 --- a/rtt/ExecutionEngine.hpp +++ b/rtt/ExecutionEngine.hpp @@ -255,8 +255,9 @@ namespace RTT /** * Executes (in that order) Messages, Functions and updateHook() * functions of this TaskContext and its children. + * The updateHook's will not be executed if false is passed for onlyInternal */ - virtual void step(); + virtual void step(bool onlyInternal = false); virtual bool breakLoop(); diff --git a/rtt/base/RunnableInterface.hpp b/rtt/base/RunnableInterface.hpp index 7c2b299..929d620 100644 --- a/rtt/base/RunnableInterface.hpp +++ b/rtt/base/RunnableInterface.hpp @@ -99,7 +99,7 @@ namespace RTT * The method that will be periodically executed when this * class is run in a periodic thread. */ - virtual void step() = 0; + virtual void step(bool onlyInternal = false) = 0; /** * The method that will be executed once when this diff --git a/rtt/extras/SlaveActivity.cpp b/rtt/extras/SlaveActivity.cpp index 0c17f6f..8ad88cc 100644 --- a/rtt/extras/SlaveActivity.cpp +++ b/rtt/extras/SlaveActivity.cpp @@ -178,8 +178,10 @@ namespace RTT { bool SlaveActivity::trigger() { - if (mmaster) + if (mmaster){ + runner->step(true); return mmaster->trigger(); + } return false; } -- 1.8.5.1