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

Fixed bidirectional writeback not working at beginning of the main loop.

Moved setting the initial version number for all ApplicationModules from Application::initialise() to Application::run(), so the version numbers of the persisted values from the control system are smaller.
parent fce86f5b
No related branches found
No related tags found
No related merge requests found
......@@ -148,6 +148,13 @@ void Application::checkConnections() {
void Application::run() {
assert(applicationName != "");
// set all initial version numbers in the modules to the same value
VersionNumber startVersion;
for(auto& module : getSubmoduleListRecursive()) {
if(module->getModuleType() != ModuleType::ApplicationModule) continue;
module->setCurrentVersionNumber(startVersion);
}
// prepare the modules
for(auto& module : getSubmoduleListRecursive()) {
module->prepare();
......@@ -529,13 +536,6 @@ void Application::makeConnections() {
for(auto& network : networkList) {
makeConnectionsForNetwork(network);
}
// set all initial version numbers in the modules to the same value
VersionNumber startVersion;
for(auto& module : getSubmoduleListRecursive()) {
if(module->getModuleType() != ModuleType::ApplicationModule) continue;
module->setCurrentVersionNumber(startVersion);
}
}
/*********************************************************************************************************************/
......
......@@ -83,6 +83,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(testTwoScalarPushAccessors, T, test_types) {
app.testModule.feedingPush >> app.testModule.consumingPush;
app.initialise();
app.run();
// single theaded test
app.testModule.consumingPush = 0;
......@@ -123,6 +124,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(testFourScalarPushAccessors, T, test_types) {
app.testModule.feedingPush >> app.testModule.consumingPush2;
app.testModule.feedingPush >> app.testModule.consumingPush3;
app.initialise();
app.run();
// single theaded test
app.testModule.consumingPush = 0;
......@@ -186,6 +188,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(testTwoScalarPushPollAccessors, T, test_types) {
app.testModule.feedingPush >> app.testModule.consumingPoll;
app.initialise();
app.run();
// single theaded test only, since read() does not block in this case
app.testModule.consumingPoll = 0;
......@@ -221,6 +224,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(testTwoArrayAccessors, T, test_types) {
app.testModule.feedingArray >> app.testModule.consumingPushArray;
app.initialise();
app.run();
BOOST_CHECK(app.testModule.feedingArray.getNElements() == 10);
BOOST_CHECK(app.testModule.consumingPushArray.getNElements() == 10);
......
......@@ -85,6 +85,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(testFeedToCS, T, test_types) {
app.testModule.feeder >> app.cs("myFeeder");
app.initialise();
app.run();
auto myFeeder = pvManagers.first->getProcessArray<T>("/myFeeder");
BOOST_CHECK(myFeeder->getName() == "/myFeeder");
......
......@@ -78,6 +78,7 @@ BOOST_AUTO_TEST_CASE(testModuleReadWrite) {
app.testModule.feedingPoll2 >> app.testModule.mixedGroup.consumingPoll2;
app.testModule.feedingPoll3 >> app.testModule.mixedGroup.consumingPoll3;
app.initialise();
app.run();
// single theaded test
app.testModule.mixedGroup.consumingPush = 666;
......
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