From 7241ed7dfe078aae7ad45f8a3d7295911bf51b89 Mon Sep 17 00:00:00 2001 From: RYAN A RIVERA Date: Wed, 17 Apr 2024 14:34:03 -0500 Subject: [PATCH 1/7] Changing to OTS_SOURCE in preparation for move to SPACK --- tools/ots | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ots b/tools/ots index da8c8172..aafa4318 100644 --- a/tools/ots +++ b/tools/ots @@ -616,7 +616,7 @@ fi #check for new Slow Controls context table if [ ! -e ${USER_DATA}/TableInfo/SlowControlsDashboardSupervisorTableInfo.xml ]; then #if missing, attempt to copy - cp ${MRB_SOURCE}/otsdaq/data-core/TableInfo/ContextGroup/SlowControlsDashboardSupervisorTableInfo.xml ${USER_DATA}/TableInfo/ + cp ${OTS_SOURCE}/otsdaq/data-core/TableInfo/ContextGroup/SlowControlsDashboardSupervisorTableInfo.xml ${USER_DATA}/TableInfo/ fi #print out important environment variables From 84167c2e448badb05c0db6c8834fd5a73bcbc719 Mon Sep 17 00:00:00 2001 From: "rrivera@FNAL.GOV" Date: Wed, 17 Apr 2024 21:49:51 +0200 Subject: [PATCH 2/7] Checkpoint from Calo Pisa VST --- otsdaq/FECore/FESlowControlsChannel.cc | 19 ++++++++++++++++--- otsdaq/FECore/FESlowControlsChannel.h | 3 ++- otsdaq/FECore/FEVInterface.cc | 19 ++++++++++--------- otsdaq/FECore/FEVInterface.h | 3 ++- 4 files changed, 30 insertions(+), 14 deletions(-) diff --git a/otsdaq/FECore/FESlowControlsChannel.cc b/otsdaq/FECore/FESlowControlsChannel.cc index a3c73af9..fe18d83a 100644 --- a/otsdaq/FECore/FESlowControlsChannel.cc +++ b/otsdaq/FECore/FESlowControlsChannel.cc @@ -168,7 +168,7 @@ FESlowControlsChannel::FESlowControlsChannel(FEVInterface* interface, __GEN_COUTV__(sizeOfReadBytes_); __GEN_COUTV__(interface->getUniversalDataSize()); - if(sizeOfReadBytes_ > interface->getUniversalDataSize()) + if(sizeOfReadBytes_ > interface->getUniversalDataSize() && !interface->universalBlockReadConfirmed_) { //check if FE supports Block Reads by using a test read (because the compiler does not allow this) // if(interface->*(&FEVInterface::universalBlockRead) != (&FEVInterface::universalBlockRead)) @@ -194,9 +194,11 @@ FESlowControlsChannel::FESlowControlsChannel(FEVInterface* interface, __GEN_COUT_ERR__ << "\n" << ss.str(); __GEN_SS_THROW__; } - // else ignore error for test read (assume things are not setup yet) + else // else ignore error for test read (assume things are not setup yet) + __GEN_COUT_WARN__ << "Ignoring test block read error - assuming FE not setup yet - here is the caught exception:\n" << e.what() << __E__; } __GEN_COUT__ << "Block read was found to be implemented!" << __E__; + interface->universalBlockReadConfirmed_ = true; //set to avoid more tests of block read functionality } @@ -264,7 +266,7 @@ FESlowControlsChannel::~FESlowControlsChannel(void) {} //============================================================================== // virtual in case read should be different than universalread -void FESlowControlsChannel::getSample(std::string& readValue) +void FESlowControlsChannel::doRead(std::string& readValue) { if(getReadSizeBytes() > interface_->getUniversalDataSize()) { @@ -277,6 +279,17 @@ void FESlowControlsChannel::getSample(std::string& readValue) readValue.resize(interface_->getUniversalDataSize()); interface_->universalRead(&universalAddress_[0], &readValue[0]); } +} // end doRead() + + + +//============================================================================== +// virtual in case read should be different than universalread +const std::string & FESlowControlsChannel::getSample() +{ + + return sample_; + } // end getSample() //============================================================================== diff --git a/otsdaq/FECore/FESlowControlsChannel.h b/otsdaq/FECore/FESlowControlsChannel.h index 7ddae7de..379a5ed5 100644 --- a/otsdaq/FECore/FESlowControlsChannel.h +++ b/otsdaq/FECore/FESlowControlsChannel.h @@ -41,7 +41,8 @@ class FESlowControlsChannel unsigned int getReadSizeBytes () const { return sizeOfReadBytes_; } time_t getLastSampleTime () const { return lastSampleTime_; } - void getSample (std::string& readValue); + void doRead (std::string& readValue); + const std::string & getSample (); void handleSample (const std::string& universalReadValue, std::string& txBuffer, FILE* fpAggregate = 0, bool aggregateIsBinaryFormat = false); void clearAlarms (int targetAlarm = -1); // default to all diff --git a/otsdaq/FECore/FEVInterface.cc b/otsdaq/FECore/FEVInterface.cc index 8faa53f8..e04a7439 100644 --- a/otsdaq/FECore/FEVInterface.cc +++ b/otsdaq/FECore/FEVInterface.cc @@ -327,12 +327,13 @@ try bool usingBufferedValue = false; while((channelToCopy = getNextSlowControlsChannel()) != channel) { - __FE_COUT__ << "Looking for buffered value at " << + __FE_COUT_TYPE__(TLVL_DEBUG+8) << "Looking for buffered value at " << BinaryStringMacros::binaryNumberToHexString(channelToCopy->universalAddress_, "0x", " ") << " " << channelToCopy->getReadSizeBytes() << " " << time(0) - channelToCopy->getLastSampleTime() << __E__; - if(BinaryStringMacros::binaryNumberToHexString(channelToCopy->universalAddress_, "0x", " ") == + if(!usingBufferedValue && + BinaryStringMacros::binaryNumberToHexString(channelToCopy->universalAddress_, "0x", " ") == BinaryStringMacros::binaryNumberToHexString(channel->universalAddress_, "0x", " ") && channelToCopy->getReadSizeBytes() == channel->getReadSizeBytes() && time(0) - channelToCopy->getLastSampleTime() < 2 /* within 2 seconds, then re-use buffer */) @@ -351,11 +352,11 @@ try } if(!usingBufferedValue) - channel->getSample(readVal); + channel->doRead(readVal); // have sample channel->handleSample(readVal, txBuffer, fp, aggregateFileIsBinaryFormat); - __FE_COUT__ << "Have: " << BinaryStringMacros::binaryNumberToHexString(channel->universalReadValue_, "0x", " ") << " at t=" << time(0) << __E__; + __FE_COUT__ << "Have: " << BinaryStringMacros::binaryNumberToHexString(channel->getSample(), "0x", " ") << " at t=" << time(0) << __E__; if(txBuffer.size()) __FE_COUT__ << "txBuffer sz=" << txBuffer.size() << __E__; @@ -365,8 +366,8 @@ try if(channel->monitoringEnabled_ && metricMan && metricMan->Running() && universalAddressSize_ <= 8) { uint64_t val = 0; // 64 bits! - for(size_t ii = 0; ii < universalAddressSize_; ++ii) - val += (uint8_t)readVal[ii] << (ii * 8); + for(size_t ii = 0; ii < channel->getSample().size(); ++ii) + val += (uint8_t)channel->getSample()[ii] << (ii * 8); // Unit transforms if((channel->transformation_).size() > 1) // Execute transformation if a formula is present @@ -379,7 +380,7 @@ try if(!std::isnan(transformedVal)) { __FE_COUT__ << "Transformed " << val << " into " << transformedVal << __E__; - __FE_COUT__ << "Sending transformed sample to Metric Manager..." << __E__; + __FE_COUT__ << "Sending \"" << channel->fullChannelName_ << "\" transformed sample to Metric Manager..." << __E__; metricMan->sendMetric(channel->fullChannelName_, transformedVal, "", 3, artdaq::MetricMode::LastPoint); } else @@ -390,13 +391,13 @@ try } else { - __FE_COUT__ << "Sending sample to Metric Manager..." << __E__; + __FE_COUT__ << "Sending \"" << channel->fullChannelName_ << "\" sample to Metric Manager..." << __E__; metricMan->sendMetric(channel->fullChannelName_, val, "", 3, artdaq::MetricMode::LastPoint); } } else { - __FE_COUT__ << "Skipping sample to Metric Manager: " + __FE_COUT__ << "Skipping \"" << channel->fullChannelName_ << "\" sample to Metric Manager... " << " channel->monitoringEnabled_=" << channel->monitoringEnabled_ << " metricMan=" << metricMan << " metricMan->Running()=" << (metricMan && metricMan->Running()) << __E__; } diff --git a/otsdaq/FECore/FEVInterface.h b/otsdaq/FECore/FEVInterface.h index 73a4d620..d9ae29d9 100644 --- a/otsdaq/FECore/FEVInterface.h +++ b/otsdaq/FECore/FEVInterface.h @@ -82,7 +82,8 @@ class FEVInterface : public WorkLoop, public Configurable, public VStateMachine const unsigned int& getUniversalDataSize (void) { return universalDataSize_; } virtual void universalBlockRead (char* address, char* returnValue, unsigned int numberOfBytes) { throw std::runtime_error("UNDEFINED BLOCK READ"); /* to make compiler happy, use params */ __COUTV__((void*)address); __COUTV__((void*)returnValue); __COUTV__(numberOfBytes); } virtual void universalBlockWrite (char* address, char* writeValue, unsigned int numberOfBytes) { throw std::runtime_error("UNDEFINED BLOCK WRITE"); /* to make compiler happy, use params */ __COUTV__((void*)address); __COUTV__((void*)writeValue); __COUTV__(numberOfBytes); } - + bool universalBlockReadConfirmed_ = false; //will be confirmed by slow controls handling that universalBlockWrite is implemented by the FE plugin + void runSequenceOfCommands (const std::string& treeLinkName); static void sendAsyncExceptionToGateway (FEVInterface* fe, const std::string& errMsg, bool isPauseException, bool isStopException); From da599b6eb50d278ed3e41b7cca1cfaa1e83fcc8e Mon Sep 17 00:00:00 2001 From: RYAN A RIVERA Date: Wed, 17 Apr 2024 14:49:01 -0500 Subject: [PATCH 3/7] Minor formatting adjustments; changed to getSample() const --- otsdaq/FECore/FESlowControlsChannel.cc | 17 ++--------------- otsdaq/FECore/FESlowControlsChannel.h | 6 +++--- 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/otsdaq/FECore/FESlowControlsChannel.cc b/otsdaq/FECore/FESlowControlsChannel.cc index fe18d83a..c9a6710a 100644 --- a/otsdaq/FECore/FESlowControlsChannel.cc +++ b/otsdaq/FECore/FESlowControlsChannel.cc @@ -170,7 +170,7 @@ FESlowControlsChannel::FESlowControlsChannel(FEVInterface* interface, __GEN_COUTV__(interface->getUniversalDataSize()); if(sizeOfReadBytes_ > interface->getUniversalDataSize() && !interface->universalBlockReadConfirmed_) { - //check if FE supports Block Reads by using a test read (because the compiler does not allow this) + //check if FE supports Block Reads by using a test read (because the compiler does not allow this preferrable code attempt below...) // if(interface->*(&FEVInterface::universalBlockRead) != (&FEVInterface::universalBlockRead)) // { // __GEN_COUT__ << "This FE interface does implement block reads." << __E__; @@ -195,7 +195,7 @@ FESlowControlsChannel::FESlowControlsChannel(FEVInterface* interface, __GEN_SS_THROW__; } else // else ignore error for test read (assume things are not setup yet) - __GEN_COUT_WARN__ << "Ignoring test block read error - assuming FE not setup yet - here is the caught exception:\n" << e.what() << __E__; + __GEN_COUT_WARN__ << "Ignoring test block read error - assuming FE not setup yet - here is the caught exception:\n" << e.what() << __E__; } __GEN_COUT__ << "Block read was found to be implemented!" << __E__; interface->universalBlockReadConfirmed_ = true; //set to avoid more tests of block read functionality @@ -263,9 +263,7 @@ FESlowControlsChannel::FESlowControlsChannel(FEVInterface* interface, //============================================================================== FESlowControlsChannel::~FESlowControlsChannel(void) {} - //============================================================================== -// virtual in case read should be different than universalread void FESlowControlsChannel::doRead(std::string& readValue) { if(getReadSizeBytes() > interface_->getUniversalDataSize()) @@ -281,17 +279,6 @@ void FESlowControlsChannel::doRead(std::string& readValue) } } // end doRead() - - -//============================================================================== -// virtual in case read should be different than universalread -const std::string & FESlowControlsChannel::getSample() -{ - - return sample_; - -} // end getSample() - //============================================================================== void FESlowControlsChannel::print(std::ostream& out) const { diff --git a/otsdaq/FECore/FESlowControlsChannel.h b/otsdaq/FECore/FESlowControlsChannel.h index 379a5ed5..187ed3b6 100644 --- a/otsdaq/FECore/FESlowControlsChannel.h +++ b/otsdaq/FECore/FESlowControlsChannel.h @@ -16,7 +16,7 @@ class FESlowControlsChannel const std::string& channelName, const std::string& dataType, const std::string& universalAddress, - const std::string& transformation, + const std::string& transformation, unsigned int universalDataBitOffset, bool readAccess, bool writeAccess, @@ -41,8 +41,8 @@ class FESlowControlsChannel unsigned int getReadSizeBytes () const { return sizeOfReadBytes_; } time_t getLastSampleTime () const { return lastSampleTime_; } - void doRead (std::string& readValue); - const std::string & getSample (); + void doRead (std::string& readValue); + const std::string & getSample () const { return sample_; } void handleSample (const std::string& universalReadValue, std::string& txBuffer, FILE* fpAggregate = 0, bool aggregateIsBinaryFormat = false); void clearAlarms (int targetAlarm = -1); // default to all From 47b4986960818bba30eeeb8368b571680f8de8e3 Mon Sep 17 00:00:00 2001 From: RYAN A RIVERA Date: Wed, 17 Apr 2024 14:55:40 -0500 Subject: [PATCH 4/7] Minor formatting adjustments --- otsdaq/FECore/FEVInterface.cc | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/otsdaq/FECore/FEVInterface.cc b/otsdaq/FECore/FEVInterface.cc index e04a7439..9f85b1c1 100644 --- a/otsdaq/FECore/FEVInterface.cc +++ b/otsdaq/FECore/FEVInterface.cc @@ -327,19 +327,18 @@ try bool usingBufferedValue = false; while((channelToCopy = getNextSlowControlsChannel()) != channel) { - __FE_COUT_TYPE__(TLVL_DEBUG+8) << "Looking for buffered value at " << + __FE_COUT_TYPE__(TLVL_DEBUG+8) << "Looking for buffered value at " << BinaryStringMacros::binaryNumberToHexString(channelToCopy->universalAddress_, "0x", " ") << " " << channelToCopy->getReadSizeBytes() << " " << time(0) - channelToCopy->getLastSampleTime() << __E__; - if(!usingBufferedValue && - BinaryStringMacros::binaryNumberToHexString(channelToCopy->universalAddress_, "0x", " ") == + if(!usingBufferedValue && + BinaryStringMacros::binaryNumberToHexString(channelToCopy->universalAddress_, "0x", " ") == BinaryStringMacros::binaryNumberToHexString(channel->universalAddress_, "0x", " ") && channelToCopy->getReadSizeBytes() == channel->getReadSizeBytes() && time(0) - channelToCopy->getLastSampleTime() < 2 /* within 2 seconds, then re-use buffer */) { usingBufferedValue = true; - //can NOT break;... must take iterator back to channel __FE_COUT__ << "Using buffered " << channelToCopy->getReadSizeBytes() << "-byte value at address:" << BinaryStringMacros::binaryNumberToHexString(channelToCopy->universalAddress_, "0x", " ") << __E__; @@ -348,8 +347,10 @@ try " at t=" << time(0) << __E__; readVal = channelToCopy->universalReadValue_; //copy by reference __FE_COUT__ << "Copied: " << BinaryStringMacros::binaryNumberToHexString(readVal, "0x", " ") << " at t=" << time(0) << __E__; + + //can NOT break; from while loop... must take iterator back to starting point channel iterator } - } + } //end while loop if(!usingBufferedValue) channel->doRead(readVal); @@ -397,9 +398,9 @@ try } else { - __FE_COUT__ << "Skipping \"" << channel->fullChannelName_ << "\" sample to Metric Manager... " - << " channel->monitoringEnabled_=" << channel->monitoringEnabled_ << " metricMan=" << metricMan - << " metricMan->Running()=" << (metricMan && metricMan->Running()) << __E__; + __FE_COUT__ << "Skipping \"" << channel->fullChannelName_ << "\" sample to Metric Manager... " + << " channel->monitoringEnabled_=" << channel->monitoringEnabled_ << " metricMan=" << metricMan + << " metricMan->Running()=" << (metricMan && metricMan->Running()) << __E__; } // make sure buffer hasn't exploded somehow From 1cfbc7621924b6bc32d9216a58a11c7133d74558 Mon Sep 17 00:00:00 2001 From: RYAN A RIVERA Date: Wed, 17 Apr 2024 15:00:05 -0500 Subject: [PATCH 5/7] Clearer variable name --- otsdaq/FECore/FESlowControlsChannel.cc | 4 ++-- otsdaq/FECore/FEVInterface.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/otsdaq/FECore/FESlowControlsChannel.cc b/otsdaq/FECore/FESlowControlsChannel.cc index c9a6710a..9d872761 100644 --- a/otsdaq/FECore/FESlowControlsChannel.cc +++ b/otsdaq/FECore/FESlowControlsChannel.cc @@ -168,7 +168,7 @@ FESlowControlsChannel::FESlowControlsChannel(FEVInterface* interface, __GEN_COUTV__(sizeOfReadBytes_); __GEN_COUTV__(interface->getUniversalDataSize()); - if(sizeOfReadBytes_ > interface->getUniversalDataSize() && !interface->universalBlockReadConfirmed_) + if(sizeOfReadBytes_ > interface->getUniversalDataSize() && !interface->universalBlockReadImplementationConfirmed_) { //check if FE supports Block Reads by using a test read (because the compiler does not allow this preferrable code attempt below...) // if(interface->*(&FEVInterface::universalBlockRead) != (&FEVInterface::universalBlockRead)) @@ -198,7 +198,7 @@ FESlowControlsChannel::FESlowControlsChannel(FEVInterface* interface, __GEN_COUT_WARN__ << "Ignoring test block read error - assuming FE not setup yet - here is the caught exception:\n" << e.what() << __E__; } __GEN_COUT__ << "Block read was found to be implemented!" << __E__; - interface->universalBlockReadConfirmed_ = true; //set to avoid more tests of block read functionality + interface->universalBlockReadImplementationConfirmed_ = true; //set to avoid more tests of block read functionality } diff --git a/otsdaq/FECore/FEVInterface.h b/otsdaq/FECore/FEVInterface.h index d9ae29d9..4bb17de0 100644 --- a/otsdaq/FECore/FEVInterface.h +++ b/otsdaq/FECore/FEVInterface.h @@ -81,8 +81,9 @@ class FEVInterface : public WorkLoop, public Configurable, public VStateMachine const unsigned int& getUniversalAddressSize (void) { return universalAddressSize_; } const unsigned int& getUniversalDataSize (void) { return universalDataSize_; } virtual void universalBlockRead (char* address, char* returnValue, unsigned int numberOfBytes) { throw std::runtime_error("UNDEFINED BLOCK READ"); /* to make compiler happy, use params */ __COUTV__((void*)address); __COUTV__((void*)returnValue); __COUTV__(numberOfBytes); } + bool universalBlockReadImplementationConfirmed_ = false; //is confirmed by slow controls handling (for example) that universalBlockRead is implemented by the FE plugin virtual void universalBlockWrite (char* address, char* writeValue, unsigned int numberOfBytes) { throw std::runtime_error("UNDEFINED BLOCK WRITE"); /* to make compiler happy, use params */ __COUTV__((void*)address); __COUTV__((void*)writeValue); __COUTV__(numberOfBytes); } - bool universalBlockReadConfirmed_ = false; //will be confirmed by slow controls handling that universalBlockWrite is implemented by the FE plugin + void runSequenceOfCommands (const std::string& treeLinkName); From 4653ff1a4f001c78d28e153512159145e3bfbd3d Mon Sep 17 00:00:00 2001 From: RYAN A RIVERA Date: Wed, 17 Apr 2024 15:53:32 -0500 Subject: [PATCH 6/7] Improved const public vs private member variable handling. --- otsdaq/FECore/FESlowControlsChannel.cc | 225 ++++++++++++------------- otsdaq/FECore/FESlowControlsChannel.h | 23 ++- otsdaq/FECore/FEVInterface.cc | 53 +++--- 3 files changed, 153 insertions(+), 148 deletions(-) diff --git a/otsdaq/FECore/FESlowControlsChannel.cc b/otsdaq/FECore/FESlowControlsChannel.cc index 9d872761..fe67e79f 100644 --- a/otsdaq/FECore/FESlowControlsChannel.cc +++ b/otsdaq/FECore/FESlowControlsChannel.cc @@ -11,7 +11,7 @@ using namespace ots; #undef __MF_SUBJECT__ #define __MF_SUBJECT__ "SlowControls" -#define mfSubject_ (interface_->getInterfaceUID() + "-" + channelName_) +#define mfSubject_ (interface_->getInterfaceUID() + "-" + channelName) //////////////////////////////////// // Packet Types sent in txBuffer: @@ -30,14 +30,14 @@ using namespace ots; //============================================================================== FESlowControlsChannel::FESlowControlsChannel(FEVInterface* interface, - const std::string& channelName, - const std::string& dataType, + const std::string& channelNameIn, + const std::string& dataTypeIn, const std::string& universalAddress, - const std::string& transformation, + const std::string& transformationIn, unsigned int universalDataBitOffset, bool readAccess, bool writeAccess, - bool monitoringEnabled, + bool monitoringEnabledIn, bool recordChangesOnly, time_t delayBetweenSamples, bool saveEnabled, @@ -51,15 +51,15 @@ FESlowControlsChannel::FESlowControlsChannel(FEVInterface* interface, const std::string& hi, const std::string& hihi) : interface_(interface) - , channelName_(channelName) - //, fullChannelName_(interface->getInterfaceUID() + "/" + channelName_) - , fullChannelName_(interface->getInterfaceUID() + ":" + channelName_) - , dataType_(dataType) + , channelName(channelNameIn) + , fullChannelName(interface->getInterfaceUID() + ":" + channelName) + , dataType(dataTypeIn) + , transformation(transformationIn) , universalDataBitOffset_(universalDataBitOffset) , txPacketSequenceNumber_(0) , readAccess_(readAccess) , writeAccess_(writeAccess) - , monitoringEnabled_(monitoringEnabled) + , monitoringEnabled(monitoringEnabledIn) , recordChangesOnly_(recordChangesOnly) , delayBetweenSamples_(delayBetweenSamples < 1 ? 1 : delayBetweenSamples) // units of seconds, with 1 minimum , saveEnabled_(saveEnabled) @@ -68,16 +68,15 @@ FESlowControlsChannel::FESlowControlsChannel(FEVInterface* interface, , saveBinaryFormat_(saveBinaryFormat) , alarmsEnabled_(alarmsEnabled) , latchAlarms_(latchAlarms) - , transformation_(transformation) , lastSampleTime_(0) , loloAlarmed_(false) , loAlarmed_(false) , hiAlarmed_(false) , hihiAlarmed_(false) - , saveFullFileName_(savePath_ + "/" + saveFileRadix_ + "-" + underscoreString(fullChannelName_) + "-" + std::to_string(time(0)) + + , saveFullFileName_(savePath_ + "/" + saveFileRadix_ + "-" + underscoreString(fullChannelName) + "-" + std::to_string(time(0)) + (saveBinaryFormat_ ? ".dat" : ".txt")) { - __GEN_COUTV__(dataType_); + __GEN_COUTV__(dataType); __GEN_COUTV__(interface->getUniversalAddressSize()); __GEN_COUTV__(universalAddress); __GEN_COUTV__(transformation); @@ -93,46 +92,46 @@ FESlowControlsChannel::FESlowControlsChannel(FEVInterface* interface, sizeOfReadBytes_ = 0; // check for valid types: - // if(dataType_ != "char" && - // dataType_ != "short" && - // dataType_ != "int" && - // dataType_ != "unsigned int" && - // dataType_ != "long long " && - // dataType_ != "unsigned long long" && - // dataType_ != "float" && - // dataType_ != "double") + // if(dataType != "char" && + // dataType != "short" && + // dataType != "int" && + // dataType != "unsigned int" && + // dataType != "long long " && + // dataType != "unsigned long long" && + // dataType != "float" && + // dataType != "double") // { - if(dataType_.size() > 1 && dataType_[dataType_.size() - 1] == 'b') // if ends in 'b' then take that many bits + if(dataType.size() > 1 && dataType[dataType.size() - 1] == 'b') // if ends in 'b' then take that many bits { - //if dataType_ leads with xB then yb, the use x as the number of read bytes (e.g. for a block read) + //if dataType leads with xB then yb, the use x as the number of read bytes (e.g. for a block read) //search for 'B' - for(unsigned int i = 0; i> 4) & 0xF) << (int)((sample_[i]) & 0xF) << std::dec; fprintf(fpAggregate, "%s\n", ss.str().c_str()); } - else if(dataType_ == "char") + else if(dataType == "char") fprintf(fpAggregate, "%d\n", *((char*)(&sample_[0]))); - else if(dataType_ == "unsigned char") + else if(dataType == "unsigned char") fprintf(fpAggregate, "%u\n", *((unsigned char*)(&sample_[0]))); - else if(dataType_ == "short") + else if(dataType == "short") fprintf(fpAggregate, "%d\n", *((short*)(&sample_[0]))); - else if(dataType_ == "unsigned short") + else if(dataType == "unsigned short") fprintf(fpAggregate, "%u\n", *((unsigned short*)(&sample_[0]))); - else if(dataType_ == "int") + else if(dataType == "int") fprintf(fpAggregate, "%d\n", *((int*)(&sample_[0]))); - else if(dataType_ == "unsigned int") + else if(dataType == "unsigned int") fprintf(fpAggregate, "%u\n", *((unsigned int*)(&sample_[0]))); - else if(dataType_ == "long long") + else if(dataType == "long long") fprintf(fpAggregate, "%lld\n", *((long long*)(&sample_[0]))); - else if(dataType_ == "unsigned long long") + else if(dataType == "unsigned long long") fprintf(fpAggregate, "%llu\n", *((unsigned long long*)(&sample_[0]))); - else if(dataType_ == "float") + else if(dataType == "float") fprintf(fpAggregate, "%f\n", *((float*)(&sample_[0]))); - else if(dataType_ == "double") + else if(dataType == "double") fprintf(fpAggregate, "%f\n", *((double*)(&sample_[0]))); // save any alarms by marking with time 1, 2, 3, 4 @@ -612,9 +611,9 @@ void FESlowControlsChannel::handleSample(const std::string& universalReadValue, if(alarmMask & checkMask) { fprintf(fpAggregate, "%lu\n", i); - fprintf(fpAggregate, "%s\n", fullChannelName_.c_str()); + fprintf(fpAggregate, "%s\n", fullChannelName.c_str()); - if(dataType_[dataType_.size() - 1] == 'b') // if ends in 'b' then take that many bits + if(dataType[dataType.size() - 1] == 'b') // if ends in 'b' then take that many bits { std::stringstream ss; ss << "0x"; @@ -622,25 +621,25 @@ void FESlowControlsChannel::handleSample(const std::string& universalReadValue, ss << std::hex << (int)(((*alarmValueArray[i - 1])[j] >> 4) & 0xF) << (int)(((*alarmValueArray[i - 1])[j]) & 0xF) << std::dec; fprintf(fpAggregate, "%s\n", ss.str().c_str()); } - else if(dataType_ == "char") + else if(dataType == "char") fprintf(fpAggregate, "%d\n", *((char*)(&(*alarmValueArray[i - 1])[0]))); - else if(dataType_ == "unsigned char") + else if(dataType == "unsigned char") fprintf(fpAggregate, "%u\n", *((unsigned char*)(&(*alarmValueArray[i - 1])[0]))); - else if(dataType_ == "short") + else if(dataType == "short") fprintf(fpAggregate, "%d\n", *((short*)(&(*alarmValueArray[i - 1])[0]))); - else if(dataType_ == "unsigned short") + else if(dataType == "unsigned short") fprintf(fpAggregate, "%u\n", *((unsigned short*)(&(*alarmValueArray[i - 1])[0]))); - else if(dataType_ == "int") + else if(dataType == "int") fprintf(fpAggregate, "%d\n", *((int*)(&(*alarmValueArray[i - 1])[0]))); - else if(dataType_ == "unsigned int") + else if(dataType == "unsigned int") fprintf(fpAggregate, "%u\n", *((unsigned int*)(&(*alarmValueArray[i - 1])[0]))); - else if(dataType_ == "long long") + else if(dataType == "long long") fprintf(fpAggregate, "%lld\n", *((long long*)(&(*alarmValueArray[i - 1])[0]))); - else if(dataType_ == "unsigned long long") + else if(dataType == "unsigned long long") fprintf(fpAggregate, "%llu\n", *((unsigned long long*)(&(*alarmValueArray[i - 1])[0]))); - else if(dataType_ == "float") + else if(dataType == "float") fprintf(fpAggregate, "%f\n", *((float*)(&(*alarmValueArray[i - 1])[0]))); - else if(dataType_ == "double") + else if(dataType == "double") fprintf(fpAggregate, "%f\n", *((double*)(&(*alarmValueArray[i - 1])[0]))); } } @@ -677,11 +676,11 @@ void FESlowControlsChannel::handleSample(const std::string& universalReadValue, } else { - __GEN_COUT__ << "Text File Format: " << dataType_ << __E__; + __GEN_COUT__ << "Text File Format: " << dataType << __E__; fprintf(fp, "%lu\n", lastSampleTime_); - if(dataType_[dataType_.size() - 1] == 'b') // if ends in 'b' then take that many bits + if(dataType[dataType.size() - 1] == 'b') // if ends in 'b' then take that many bits { std::stringstream ss; ss << "0x"; @@ -689,25 +688,25 @@ void FESlowControlsChannel::handleSample(const std::string& universalReadValue, ss << std::hex << (int)((sample_[i] >> 4) & 0xF) << (int)((sample_[i]) & 0xF) << std::dec; fprintf(fp, "%s\n", ss.str().c_str()); } - else if(dataType_ == "char") + else if(dataType == "char") fprintf(fp, "%d\n", *((char*)(&sample_[0]))); - else if(dataType_ == "unsigned char") + else if(dataType == "unsigned char") fprintf(fp, "%u\n", *((unsigned char*)(&sample_[0]))); - else if(dataType_ == "short") + else if(dataType == "short") fprintf(fp, "%d\n", *((short*)(&sample_[0]))); - else if(dataType_ == "unsigned short") + else if(dataType == "unsigned short") fprintf(fp, "%u\n", *((unsigned short*)(&sample_[0]))); - else if(dataType_ == "int") + else if(dataType == "int") fprintf(fp, "%d\n", *((int*)(&sample_[0]))); - else if(dataType_ == "unsigned int") + else if(dataType == "unsigned int") fprintf(fp, "%u\n", *((unsigned int*)(&sample_[0]))); - else if(dataType_ == "long long") + else if(dataType == "long long") fprintf(fp, "%lld\n", *((long long*)(&sample_[0]))); - else if(dataType_ == "unsigned long long") + else if(dataType == "unsigned long long") fprintf(fp, "%llu\n", *((unsigned long long*)(&sample_[0]))); - else if(dataType_ == "float") + else if(dataType == "float") fprintf(fp, "%f\n", *((float*)(&sample_[0]))); - else if(dataType_ == "double") + else if(dataType == "double") fprintf(fp, "%f\n", *((double*)(&sample_[0]))); // save any alarms by marking with time 1, 2, 3, 4 @@ -719,7 +718,7 @@ void FESlowControlsChannel::handleSample(const std::string& universalReadValue, { fprintf(fp, "%lu\n", i); - if(dataType_[dataType_.size() - 1] == 'b') // if ends in 'b' then take that many bits + if(dataType[dataType.size() - 1] == 'b') // if ends in 'b' then take that many bits { std::stringstream ss; ss << "0x"; @@ -727,25 +726,25 @@ void FESlowControlsChannel::handleSample(const std::string& universalReadValue, ss << std::hex << (int)(((*alarmValueArray[i - 1])[j] >> 4) & 0xF) << (int)(((*alarmValueArray[i - 1])[j]) & 0xF) << std::dec; fprintf(fp, "%s\n", ss.str().c_str()); } - else if(dataType_ == "char") + else if(dataType == "char") fprintf(fp, "%d\n", *((char*)(&(*alarmValueArray[i - 1])[0]))); - else if(dataType_ == "unsigned char") + else if(dataType == "unsigned char") fprintf(fp, "%u\n", *((unsigned char*)(&(*alarmValueArray[i - 1])[0]))); - else if(dataType_ == "short") + else if(dataType == "short") fprintf(fp, "%d\n", *((short*)(&(*alarmValueArray[i - 1])[0]))); - else if(dataType_ == "unsigned short") + else if(dataType == "unsigned short") fprintf(fp, "%u\n", *((unsigned short*)(&(*alarmValueArray[i - 1])[0]))); - else if(dataType_ == "int") + else if(dataType == "int") fprintf(fp, "%d\n", *((int*)(&(*alarmValueArray[i - 1])[0]))); - else if(dataType_ == "unsigned int") + else if(dataType == "unsigned int") fprintf(fp, "%u\n", *((unsigned int*)(&(*alarmValueArray[i - 1])[0]))); - else if(dataType_ == "long long") + else if(dataType == "long long") fprintf(fp, "%lld\n", *((long long*)(&(*alarmValueArray[i - 1])[0]))); - else if(dataType_ == "unsigned long long") + else if(dataType == "unsigned long long") fprintf(fp, "%llu\n", *((unsigned long long*)(&(*alarmValueArray[i - 1])[0]))); - else if(dataType_ == "float") + else if(dataType == "float") fprintf(fp, "%f\n", *((float*)(&(*alarmValueArray[i - 1])[0]))); - else if(dataType_ == "double") + else if(dataType == "double") fprintf(fp, "%f\n", *((double*)(&(*alarmValueArray[i - 1])[0]))); } } @@ -822,27 +821,27 @@ char FESlowControlsChannel::checkAlarms(std::string& txBuffer) int useType = -1; char createPacketMask = 0; - if(dataType_[dataType_.size() - 1] == 'b') // if ends in 'b' then take that many bits + if(dataType[dataType.size() - 1] == 'b') // if ends in 'b' then take that many bits useType = 0; - else if(dataType_ == "char") + else if(dataType == "char") useType = 1; - else if(dataType_ == "unsigned char") + else if(dataType == "unsigned char") useType = 0; - else if(dataType_ == "short") + else if(dataType == "short") useType = 1; - else if(dataType_ == "unsigned short") + else if(dataType == "unsigned short") useType = 0; - else if(dataType_ == "int") + else if(dataType == "int") useType = 1; - else if(dataType_ == "unsigned int") + else if(dataType == "unsigned int") useType = 0; - else if(dataType_ == "long long") + else if(dataType == "long long") useType = 1; - else if(dataType_ == "unsigned long long") + else if(dataType == "unsigned long long") useType = 0; - else if(dataType_ == "float") + else if(dataType == "float") useType = 2; - else if(dataType_ == "double") + else if(dataType == "double") useType = 3; if(useType == 0) // unsigned long long @@ -961,7 +960,7 @@ char FESlowControlsChannel::checkAlarms(std::string& txBuffer) // create array helper for packet gen std::string* alarmValueArray[] = {&lolo_, &lo_, &hi_, &hihi_}; - if(monitoringEnabled_) // only create packet if monitoring + if(monitoringEnabled) // only create packet if monitoring { // create a packet for each bit in mask char checkMask = 1; // use mask to maintain return mask @@ -988,12 +987,12 @@ char FESlowControlsChannel::checkAlarms(std::string& txBuffer) txBuffer.resize(txBuffer.size() + sizeof(lastSampleTime_)); memcpy(&txBuffer[txBuffer.size() - sizeof(lastSampleTime_)] /*dest*/, &lastSampleTime_ /*src*/, sizeof(lastSampleTime_)); - unsigned int tmpSz = fullChannelName_.size(); + unsigned int tmpSz = fullChannelName.size(); txBuffer.resize(txBuffer.size() + sizeof(tmpSz)); memcpy(&txBuffer[txBuffer.size() - sizeof(tmpSz)] /*dest*/, &tmpSz /*src*/, sizeof(tmpSz)); - txBuffer += fullChannelName_; + txBuffer += fullChannelName; txBuffer.push_back((unsigned char)(*alarmValueArray[i]).size()); // size in bytes txBuffer.push_back((unsigned char)sizeOfDataTypeBits_); // size in bits diff --git a/otsdaq/FECore/FESlowControlsChannel.h b/otsdaq/FECore/FESlowControlsChannel.h index 187ed3b6..040ddd2b 100644 --- a/otsdaq/FECore/FESlowControlsChannel.h +++ b/otsdaq/FECore/FESlowControlsChannel.h @@ -39,11 +39,13 @@ class FESlowControlsChannel void print (std::ostream& out = std::cout) const; + const std::string& getUniversalAddress () const { return universalAddress_; }; unsigned int getReadSizeBytes () const { return sizeOfReadBytes_; } time_t getLastSampleTime () const { return lastSampleTime_; } void doRead (std::string& readValue); - const std::string & getSample () const { return sample_; } + const std::string& getSample () const { return sample_; } void handleSample (const std::string& universalReadValue, std::string& txBuffer, FILE* fpAggregate = 0, bool aggregateIsBinaryFormat = false); + const std::string& getLastSampleReadValue () const { return universalReadValue_; }; void clearAlarms (int targetAlarm = -1); // default to all static std::string underscoreString (const std::string& str); @@ -55,10 +57,13 @@ class FESlowControlsChannel FEVInterface* interface_; - public: - const std::string channelName_; - const std::string fullChannelName_; - const std::string dataType_; +//Some members can be public because they are const and can avoid an extra Get method. +// Naming convention in general is for no trailing underscore in public member names (TODO): + public: + const std::string channelName; + const std::string fullChannelName; + const std::string dataType; + const std::string transformation; private: unsigned int sizeOfDataTypeBits_; // defines the size of all data string buffers, @@ -68,7 +73,7 @@ class FESlowControlsChannel unsigned char txPacketSequenceNumber_; public: - const bool readAccess_, writeAccess_, monitoringEnabled_; + const bool readAccess_, writeAccess_, monitoringEnabled; const bool recordChangesOnly_; const time_t delayBetweenSamples_; @@ -78,17 +83,17 @@ class FESlowControlsChannel const bool saveBinaryFormat_; const bool alarmsEnabled_, latchAlarms_; + + private: std::string universalReadValue_; std::string universalAddress_; // get size from parent FE interface - std::string transformation_; - private: std::string sample_, lastSample_; std::string lolo_, lo_, hi_, hihi_; time_t lastSampleTime_; bool loloAlarmed_, loAlarmed_, hiAlarmed_, hihiAlarmed_; - std::string saveFullFileName_; + const std::string saveFullFileName_; // clang-format on }; diff --git a/otsdaq/FECore/FEVInterface.cc b/otsdaq/FECore/FEVInterface.cc index 9f85b1c1..db2add09 100644 --- a/otsdaq/FECore/FEVInterface.cc +++ b/otsdaq/FECore/FEVInterface.cc @@ -203,9 +203,6 @@ try __FE_COUT__ << "No slow controls channels to monitor, exiting slow controls workloop." << __E__; return false; } - std::string readValInst; - std::string& readVal = readValInst; - readVal.resize(universalDataSize_); // size to data in advance FESlowControlsChannel* channel; @@ -319,7 +316,7 @@ try if(timeCounter % channel->delayBetweenSamples_) continue; - __FE_COUT__ << "Reading Channel:" << channel->fullChannelName_ << " at t=" << time(0) << __E__; + __FE_COUT__ << "Reading Channel:" << channel->fullChannelName << " at t=" << time(0) << __E__; //check if can use buffered value resetSlowControlsChannelIterator(); @@ -328,61 +325,65 @@ try while((channelToCopy = getNextSlowControlsChannel()) != channel) { __FE_COUT_TYPE__(TLVL_DEBUG+8) << "Looking for buffered value at " << - BinaryStringMacros::binaryNumberToHexString(channelToCopy->universalAddress_, "0x", " ") << " " << + BinaryStringMacros::binaryNumberToHexString(channelToCopy->getUniversalAddress(), "0x", " ") << " " << channelToCopy->getReadSizeBytes() << " " << time(0) - channelToCopy->getLastSampleTime() << __E__; if(!usingBufferedValue && - BinaryStringMacros::binaryNumberToHexString(channelToCopy->universalAddress_, "0x", " ") == - BinaryStringMacros::binaryNumberToHexString(channel->universalAddress_, "0x", " ") && + BinaryStringMacros::binaryNumberToHexString(channelToCopy->getUniversalAddress(), "0x", " ") == + BinaryStringMacros::binaryNumberToHexString(channel->getUniversalAddress(), "0x", " ") && channelToCopy->getReadSizeBytes() == channel->getReadSizeBytes() && time(0) - channelToCopy->getLastSampleTime() < 2 /* within 2 seconds, then re-use buffer */) { usingBufferedValue = true; __FE_COUT__ << "Using buffered " << channelToCopy->getReadSizeBytes() << "-byte value at address:" << - BinaryStringMacros::binaryNumberToHexString(channelToCopy->universalAddress_, "0x", " ") << __E__; + BinaryStringMacros::binaryNumberToHexString(channelToCopy->getUniversalAddress(), "0x", " ") << __E__; - __FE_COUT__ << "Copying: " << BinaryStringMacros::binaryNumberToHexString(channelToCopy->universalReadValue_, "0x", " ") << - " at t=" << time(0) << __E__; - readVal = channelToCopy->universalReadValue_; //copy by reference - __FE_COUT__ << "Copied: " << BinaryStringMacros::binaryNumberToHexString(readVal, "0x", " ") << " at t=" << time(0) << __E__; + __FE_COUT__ << "Copying: " << BinaryStringMacros::binaryNumberToHexString(channelToCopy->getLastSampleReadValue(), "0x", " ") << " at t=" << time(0) << __E__; + channel->handleSample(channelToCopy->getLastSampleReadValue(), txBuffer, fp, aggregateFileIsBinaryFormat); + __FE_COUT__ << "Copied: " << BinaryStringMacros::binaryNumberToHexString(channel->getSample(), "0x", " ") << " at t=" << time(0) << __E__; //can NOT break; from while loop... must take iterator back to starting point channel iterator } } //end while loop + //get and handle sample if not already handled using buffered value if(!usingBufferedValue) + { + std::string readValInst; + std::string& readVal = readValInst; + readVal.resize(universalDataSize_); // size to data in advance channel->doRead(readVal); - - // have sample - channel->handleSample(readVal, txBuffer, fp, aggregateFileIsBinaryFormat); - __FE_COUT__ << "Have: " << BinaryStringMacros::binaryNumberToHexString(channel->getSample(), "0x", " ") << " at t=" << time(0) << __E__; + channel->handleSample(readVal, txBuffer, fp, aggregateFileIsBinaryFormat); + __FE_COUT__ << "Have: " << BinaryStringMacros::binaryNumberToHexString(channel->getSample(), "0x", " ") << " at t=" << time(0) << __E__; + } + if(txBuffer.size()) __FE_COUT__ << "txBuffer sz=" << txBuffer.size() << __E__; // Use artdaq Metric Manager if available, - if(channel->monitoringEnabled_ && metricMan && metricMan->Running() && universalAddressSize_ <= 8) + if(channel->monitoringEnabled && metricMan && metricMan->Running() && universalAddressSize_ <= 8) { uint64_t val = 0; // 64 bits! for(size_t ii = 0; ii < channel->getSample().size(); ++ii) val += (uint8_t)channel->getSample()[ii] << (ii * 8); // Unit transforms - if((channel->transformation_).size() > 1) // Execute transformation if a formula is present + if((channel->transformation).size() > 1) // Execute transformation if a formula is present { - __FE_COUT__ << "Transformation formula = " <transformation_ << __E__; + __FE_COUT__ << "Transformation formula = " << channel->transformation << __E__; - TFormula transformationFormula("transformationFormula", (channel->transformation_).c_str()); + TFormula transformationFormula("transformationFormula", (channel->transformation).c_str()); double transformedVal = transformationFormula.Eval(val); if(!std::isnan(transformedVal)) { __FE_COUT__ << "Transformed " << val << " into " << transformedVal << __E__; - __FE_COUT__ << "Sending \"" << channel->fullChannelName_ << "\" transformed sample to Metric Manager..." << __E__; - metricMan->sendMetric(channel->fullChannelName_, transformedVal, "", 3, artdaq::MetricMode::LastPoint); + __FE_COUT__ << "Sending \"" << channel->fullChannelName << "\" transformed sample to Metric Manager..." << __E__; + metricMan->sendMetric(channel->fullChannelName, transformedVal, "", 3, artdaq::MetricMode::LastPoint); } else { @@ -392,14 +393,14 @@ try } else { - __FE_COUT__ << "Sending \"" << channel->fullChannelName_ << "\" sample to Metric Manager..." << __E__; - metricMan->sendMetric(channel->fullChannelName_, val, "", 3, artdaq::MetricMode::LastPoint); + __FE_COUT__ << "Sending \"" << channel->fullChannelName << "\" sample to Metric Manager..." << __E__; + metricMan->sendMetric(channel->fullChannelName, val, "", 3, artdaq::MetricMode::LastPoint); } } else { - __FE_COUT__ << "Skipping \"" << channel->fullChannelName_ << "\" sample to Metric Manager... " - << " channel->monitoringEnabled_=" << channel->monitoringEnabled_ << " metricMan=" << metricMan + __FE_COUT__ << "Skipping \"" << channel->fullChannelName << "\" sample to Metric Manager... " + << " channel->monitoringEnabled=" << channel->monitoringEnabled << " metricMan=" << metricMan << " metricMan->Running()=" << (metricMan && metricMan->Running()) << __E__; } From 344862e22879fbc20bff5a1126b899f9f3a3ea66 Mon Sep 17 00:00:00 2001 From: RYAN A RIVERA Date: Wed, 17 Apr 2024 15:56:53 -0500 Subject: [PATCH 7/7] Improved naming convention of public vs private member variables. --- otsdaq/FECore/FESlowControlsChannel.cc | 4 ++-- otsdaq/FECore/FEVInterface.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/otsdaq/FECore/FESlowControlsChannel.cc b/otsdaq/FECore/FESlowControlsChannel.cc index fe67e79f..ba5fa968 100644 --- a/otsdaq/FECore/FESlowControlsChannel.cc +++ b/otsdaq/FECore/FESlowControlsChannel.cc @@ -167,7 +167,7 @@ FESlowControlsChannel::FESlowControlsChannel(FEVInterface* interface, __GEN_COUTV__(sizeOfReadBytes_); __GEN_COUTV__(interface->getUniversalDataSize()); - if(sizeOfReadBytes_ > interface->getUniversalDataSize() && !interface->universalBlockReadImplementationConfirmed_) + if(sizeOfReadBytes_ > interface->getUniversalDataSize() && !interface->universalBlockReadImplementationConfirmed) { //check if FE supports Block Reads by using a test read (because the compiler does not allow this preferrable code attempt below...) // if(interface->*(&FEVInterface::universalBlockRead) != (&FEVInterface::universalBlockRead)) @@ -197,7 +197,7 @@ FESlowControlsChannel::FESlowControlsChannel(FEVInterface* interface, __GEN_COUT_WARN__ << "Ignoring test block read error - assuming FE not setup yet - here is the caught exception:\n" << e.what() << __E__; } __GEN_COUT__ << "Block read was found to be implemented!" << __E__; - interface->universalBlockReadImplementationConfirmed_ = true; //set to avoid more tests of block read functionality + interface->universalBlockReadImplementationConfirmed = true; //set to avoid more tests of block read functionality } diff --git a/otsdaq/FECore/FEVInterface.h b/otsdaq/FECore/FEVInterface.h index 4bb17de0..17600627 100644 --- a/otsdaq/FECore/FEVInterface.h +++ b/otsdaq/FECore/FEVInterface.h @@ -81,7 +81,7 @@ class FEVInterface : public WorkLoop, public Configurable, public VStateMachine const unsigned int& getUniversalAddressSize (void) { return universalAddressSize_; } const unsigned int& getUniversalDataSize (void) { return universalDataSize_; } virtual void universalBlockRead (char* address, char* returnValue, unsigned int numberOfBytes) { throw std::runtime_error("UNDEFINED BLOCK READ"); /* to make compiler happy, use params */ __COUTV__((void*)address); __COUTV__((void*)returnValue); __COUTV__(numberOfBytes); } - bool universalBlockReadImplementationConfirmed_ = false; //is confirmed by slow controls handling (for example) that universalBlockRead is implemented by the FE plugin + bool universalBlockReadImplementationConfirmed = false; //is confirmed by slow controls handling (for example) that universalBlockRead is implemented by the FE plugin virtual void universalBlockWrite (char* address, char* writeValue, unsigned int numberOfBytes) { throw std::runtime_error("UNDEFINED BLOCK WRITE"); /* to make compiler happy, use params */ __COUTV__((void*)address); __COUTV__((void*)writeValue); __COUTV__(numberOfBytes); }