diff --git a/include/DoocsProcessArray.h b/include/DoocsProcessArray.h index 377c5a9dc20f7086b0fc1776419851b61cdc5a05..7094047913faa246ca818a8ec5cba65714c5298e 100644 --- a/include/DoocsProcessArray.h +++ b/include/DoocsProcessArray.h @@ -171,7 +171,6 @@ namespace ChimeraTK { void publishZeroMQ() { publishZMQ = true; } void setMacroPulseNumberSource(boost::shared_ptr<ChimeraTK::NDRegisterAccessor<int64_t>> macroPulseNumberSource) { - if(_processArray->isReadable()) { _macroPulseNumberSource = macroPulseNumberSource; if(_consistencyGroup.getMatchingMode() != DataConsistencyGroup::MatchingMode::none) { _consistencyGroup.add(macroPulseNumberSource); @@ -179,7 +178,13 @@ namespace ChimeraTK { std::bind(&DoocsProcessArray<DOOCS_T, DOOCS_PRIMITIVE_T>::updateDoocsBuffer, this, macroPulseNumberSource->getId())); } - } + else { + // We don't need to match up anything with it when it changes, but we have to register this at least once + // so the macropulse number will be included in the readAnyGroup in the updater if + // <data_matching> is none everywhere + _doocsUpdater.addVariable( + ChimeraTK::ScalarRegisterAccessor<int64_t>(macroPulseNumberSource), _eqFct, []() {}); + } } boost::shared_ptr<ChimeraTK::NDRegisterAccessor<DOOCS_PRIMITIVE_T>> _processArray; diff --git a/include/DoocsProcessScalar.h b/include/DoocsProcessScalar.h index ff59a616b34060fba90bab7786fe9f4ec31e2b59..bbfadeb7a4a238e85421cf95bdb9f83af581ac11 100644 --- a/include/DoocsProcessScalar.h +++ b/include/DoocsProcessScalar.h @@ -175,6 +175,7 @@ namespace ChimeraTK { info.sec = seconds; info.usec = microseconds; if(_macroPulseNumberSource != nullptr) { + this->set_mpnum(_macroPulseNumberSource->accessData(0)); info.ident = _macroPulseNumberSource->accessData(0); } else { @@ -206,14 +207,19 @@ namespace ChimeraTK { void publishZeroMQ() { _publishZMQ = true; } void setMacroPulseNumberSource(boost::shared_ptr<ChimeraTK::NDRegisterAccessor<int64_t>> macroPulseNumberSource) { - if(_processScalar->isReadable()) { _macroPulseNumberSource = macroPulseNumberSource; if(_consistencyGroup.getMatchingMode() != DataConsistencyGroup::MatchingMode::none) { _consistencyGroup.add(macroPulseNumberSource); _doocsUpdater.addVariable(ChimeraTK::ScalarRegisterAccessor<int64_t>(macroPulseNumberSource), _eqFct, std::bind(&DoocsProcessScalar<T, DOOCS_T>::updateDoocsBuffer, this, macroPulseNumberSource->getId())); } - } + else { + // We don't need to match up anything with it when it changes, but we have to register this at least once + // so the macropulse number will be included in the readAnyGroup in the updater if + // <data_matching> is none everywhere + _doocsUpdater.addVariable( + ChimeraTK::ScalarRegisterAccessor<int64_t>(macroPulseNumberSource), _eqFct, []() {}); + } } boost::shared_ptr<ChimeraTK::NDRegisterAccessor<T>> _processScalar; diff --git a/src/DoocsIfff.cc b/src/DoocsIfff.cc index b5385f28ca251ea1c7a33ae1d3b0bce14c34abbd..2feec99c2b9a822797affd0e3e4c3eb95ce7fd65 100644 --- a/src/DoocsIfff.cc +++ b/src/DoocsIfff.cc @@ -187,18 +187,16 @@ namespace ChimeraTK { void DoocsIfff::setMacroPulseNumberSource( boost::shared_ptr<ChimeraTK::NDRegisterAccessor<int64_t>> macroPulseNumberSource) { - // FIXME: Assuming macroPulseNumberSource is relavent only when all 4 - // components are readable; correct behavior later if this assumption - // does not hold. - bool isIfffReadable = - (_i1Value->isReadable() && _f1Value->isReadable() && _f2Value->isReadable() && _f3Value->isReadable()); - if(not isIfffReadable) { - return; - } _macroPulseNumberSource = macroPulseNumberSource; if(_consistencyGroup.getMatchingMode() != DataConsistencyGroup::MatchingMode::none) { registerVariable(ChimeraTK::ScalarRegisterAccessor<int64_t>(_macroPulseNumberSource)); } + else { + // We don't need to match up anything with it when it changes, but we have to register this at least once + // so the macropulse number will be included in the readAnyGroup in the updater if + // <data_matching> is none everywhere + _updater.addVariable(ChimeraTK::ScalarRegisterAccessor<int64_t>(macroPulseNumberSource), _eqFct, []() {}); + } } void DoocsIfff::registerVariable(const ChimeraTK::TransferElementAbstractor& var) { diff --git a/src/DoocsSpectrum.cc b/src/DoocsSpectrum.cc index 99baf0e7a528cabda53d8dceb9b6bc5461309153..05fa215e1edcb84e0a48ef1af59585cf8cd3a77a 100644 --- a/src/DoocsSpectrum.cc +++ b/src/DoocsSpectrum.cc @@ -222,13 +222,17 @@ namespace ChimeraTK { void DoocsSpectrum::setMacroPulseNumberSource( boost::shared_ptr<ChimeraTK::NDRegisterAccessor<int64_t>> macroPulseNumberSource) { - if(_processArray->isReadable()) { _macroPulseNumberSource = macroPulseNumberSource; if(_consistencyGroup.getMatchingMode() != DataConsistencyGroup::MatchingMode::none) { _consistencyGroup.add(macroPulseNumberSource); _doocsUpdater.addVariable(ChimeraTK::ScalarRegisterAccessor<int64_t>(macroPulseNumberSource), _eqFct, std::bind(&DoocsSpectrum::updateDoocsBuffer, this, macroPulseNumberSource->getId())); } + else { + // We don't need to match up anything with it when it changes, but we have to register this at least once + // so the macropulse number will be included in the readAnyGroup in the updater if + // <data_matching> is none everywhere + _doocsUpdater.addVariable(ChimeraTK::ScalarRegisterAccessor<int64_t>(macroPulseNumberSource), _eqFct, []() {}); } }