Skip to content
Snippets Groups Projects
Commit 99fb2530 authored by vargheseg's avatar vargheseg
Browse files

BugFix: checkSourceConsistency

- Revised logic for checkSourceConsistency
- invoke set_ro_access if all ifff sources are readonly.
parent 7b077c12
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <ChimeraTK/OneDRegisterAccessor.h> #include <ChimeraTK/OneDRegisterAccessor.h>
#include <ChimeraTK/ScalarRegisterAccessor.h> #include <ChimeraTK/ScalarRegisterAccessor.h>
#include <doocs/EventId.h> #include <doocs/EventId.h>
#include <functional>
namespace ChimeraTK { namespace ChimeraTK {
DoocsIfff::DoocsIfff(EqFct* eqFct, std::string const& doocsPropertyName, DoocsIfff::DoocsIfff(EqFct* eqFct, std::string const& doocsPropertyName,
...@@ -17,6 +18,9 @@ namespace ChimeraTK { ...@@ -17,6 +18,9 @@ namespace ChimeraTK {
_f2Value->isWriteable() && _f3Value->isWriteable()) { _f2Value->isWriteable() && _f3Value->isWriteable()) {
checkSourceConsistency(); checkSourceConsistency();
registerIfffSources(); registerIfffSources();
if(_i1Value->isReadOnly() && _f1Value->isReadOnly() && _f2Value->isReadOnly() && _f3Value->isReadOnly()) {
this->set_ro_access();
}
} }
// Constructor without history // Constructor without history
...@@ -30,18 +34,19 @@ namespace ChimeraTK { ...@@ -30,18 +34,19 @@ namespace ChimeraTK {
_f2Value->isWriteable() && _f3Value->isWriteable()) { _f2Value->isWriteable() && _f3Value->isWriteable()) {
checkSourceConsistency(); checkSourceConsistency();
registerIfffSources(); registerIfffSources();
} if(_i1Value->isReadOnly() && _f1Value->isReadOnly() && _f2Value->isReadOnly() && _f3Value->isReadOnly()) {
void DoocsIfff::checkSourceConsistency() { this->set_ro_access();
bool areAllSourcesReadable =
(_i1Value->isReadable() && _f1Value->isReadable() && _f2Value->isReadable() && _f3Value->isReadable());
if(not areAllSourcesReadable) {
ChimeraTK::logic_error("Doocs Adapter IFFF configuration Error: not all IFFF sources are readable");
} }
}
void DoocsIfff::checkSourceConsistency() {
bool areAllSourcesWritable = bool areAllSourcesWritable =
(_i1Value->isWriteable() && _f1Value->isWriteable() && _f2Value->isWriteable() && _f3Value->isWriteable()); (_i1Value->isWriteable() && _f1Value->isWriteable() && _f2Value->isWriteable() && _f3Value->isWriteable());
if(not areAllSourcesWritable) { bool areAllSourcesReadOnly =
ChimeraTK::logic_error("Doocs Adapter IFFF configuration Error: not all IFFF sources are writable"); (_i1Value->isReadOnly() && _f1Value->isReadOnly() && _f2Value->isReadOnly() && _f3Value->isReadOnly());
if(!areAllSourcesWritable && !areAllSourcesReadOnly) {
ChimeraTK::logic_error("Doocs Adapter IFFF configuration Error: some IFFF sources are not writable");
} }
} }
......
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