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

PeriodicTrigger and tests in testDeviceExceptionFlagPropagation correctly send initial values

parent 69f68459
No related branches found
No related tags found
No related merge requests found
......@@ -26,6 +26,11 @@ namespace ChimeraTK {
"sent once per the specified duration."};
ScalarOutput<uint64_t> tick{this, "tick", "", "Timer tick. Counts the trigger number starting from 0."};
void prepare() override {
setCurrentVersionNumber({});
tick.write(); // send initial value
}
void sendTrigger() {
setCurrentVersionNumber({});
++tick;
......
......@@ -34,6 +34,7 @@ struct TestApplication : ctk::Application {
ctk::ScalarOutput<uint64_t> tick{this, "tick", "", ""};
} name{this, "name", ""};
void prepare() override { name.tick.write(); /* send initial value */ }
void mainLoop() override {}
} name{this, "name", ""};
......@@ -49,6 +50,8 @@ struct TestApplication : ctk::Application {
ctk::ScalarOutput<int> set{this, "actuator", "", ""};
} vars{this, "vars", "", ctk::HierarchyModifier::hideThis};
void prepare() override { vars.set.write(); /* send intial value */ }
void mainLoop() override {
while(true) {
vars.tick.read();
......@@ -83,6 +86,7 @@ struct TestApplication : ctk::Application {
};
BOOST_AUTO_TEST_CASE(testDirectConnectOpen) {
std::cout << "testDirectConnectOpen" << std::endl;
for(int readMode = 0; readMode < 2; ++readMode) {
TestApplication app;
......@@ -118,6 +122,7 @@ BOOST_AUTO_TEST_CASE(testDirectConnectOpen) {
}
BOOST_AUTO_TEST_CASE(testDirectConnectRead) {
std::cout << "testDirectConnectRead" << std::endl;
TestApplication app;
boost::shared_ptr<ctk::ExceptionDummy> dummyBackend1 = boost::dynamic_pointer_cast<ctk::ExceptionDummy>(
ChimeraTK::BackendFactory::getInstance().createBackend(ExceptionDummyCDD1));
......@@ -153,6 +158,7 @@ BOOST_AUTO_TEST_CASE(testDirectConnectRead) {
}
BOOST_AUTO_TEST_CASE(testDirectConnectWrite) {
std::cout << "testDirectConnectWrite" << std::endl;
TestApplication app;
boost::shared_ptr<ctk::ExceptionDummy> dummyBackend1 = boost::dynamic_pointer_cast<ctk::ExceptionDummy>(
ChimeraTK::BackendFactory::getInstance().createBackend(ExceptionDummyCDD1));
......
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