Skip to content
Snippets Groups Projects
Commit 49823787 authored by Martin Killenberg's avatar Martin Killenberg
Browse files

added testHideThis. The test does not fails for CMake, but the printout shows...

added testHideThis. The test does not fails for CMake, but the printout shows that the connections in the CS are wrong
parent 47aca077
No related branches found
No related tags found
No related merge requests found
#include <ChimeraTK/ApplicationCore/ApplicationCore.h>
#include <ChimeraTK/ApplicationCore/TestFacility.h>
using namespace ChimeraTK;
struct TestApp : public Application {
TestApp() : Application("test") {}
~TestApp() override { shutdown(); }
ControlSystemModule cs;
// hides itself, and then produces A and B as sub-grops. Works.
struct A : public ApplicationModule {
using ApplicationModule::ApplicationModule;
struct : public VariableGroup {
using VariableGroup::VariableGroup;
ScalarPushInput<int> in{this, "input", "", ""};
} self{this, "A", ""};
// the output of A is the input of B
struct : public VariableGroup {
using VariableGroup::VariableGroup;
ScalarOutput<int> in{this, "input", "", ""};
} b{this, "B", ""};
void mainLoop() override {
b.in = int(self.in);
b.in.write();
}
} a{this, "A", "", HierarchyModifier::hideThis};
// tries to hide itself like A, but fails. We get B/B/input and B/output
struct B : public ApplicationModule {
using ApplicationModule::ApplicationModule;
struct : public VariableGroup {
using VariableGroup::VariableGroup;
ScalarPushInput<int> in{this, "input", "", ""};
} self{this, "B", ""};
// the output of B is one level up (global output)
ScalarOutput<int> out{this, "output", "", ""};
void mainLoop() override {
out = int(self.in);
out.write();
}
} b{this, "B", "", HierarchyModifier::hideThis}; // name it "HiddenB" here and it works
void defineConnections() override { findTag(".*").connectTo(cs); }
};
int main() {
TestApp t;
ChimeraTK::TestFacility testFacility;
testFacility.runApplication();
t.dumpConnections();
t.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