QEleConfigHandler.hh File Reference


Detailed Description

Go to the source code of this file.

Namespaces

namespace  boost

Classes

class  QEleConfigHandler
 non-locking interface to cuore electronics to be used in diana More...

Functions

void ApplyElectronicsConfiguration (std::map< int, QEleChannelConfig > configs, int settingsBasket, const std::set< unsigned int > &cratesToKill, std::set< int > wrongPolarityChannels, unsigned int sleepAfterChangeSec, boost::mutex &theMutex, QError &retStatus)
 apply electronics configuration


Function Documentation

void ApplyElectronicsConfiguration ( std::map< int, QEleChannelConfig configs,
int  settingsBasket,
const std::set< unsigned int > &  cratesToKill,
std::set< int >  wrongPolarityChannels,
unsigned int  sleepAfterChangeSec,
boost::mutex &  theMutex,
QError retStatus 
)

apply electronics configuration

Parameters:
config map of configurations to be applied
settingsBasket needed to initialize the communication with the Slow Control Server
cratesToKill list of daq crate ids to kill when changing electronics configuration
wrongPolarityChannels set of channels with wrong polarity due to bad hardware cabling. For these channels the bias polarity is inverted before applying changes to electronics
sleepAfterChangeSec time in seconds to sleep after changing electronics configuration
theMutex used to avoid concurrent calls to this function
retStatus is filled with the return status of this function. See detailed documentation for possible return values
This function uses QEleInterface to apply the electronics configurations for all the channels stored in configs.
It is executed only if theMutex is unlocked and the function succeeds in locking it. theMutex is then unlocked at the end of the execution.
This function handles appropriately the interruption of the thread it resides in (see documentation for InterruptExecution() member function). The interruption is notified using the retStatus parameter (see below), however the resulting status of the electronics is undefined in case of interruption
. Before and after applying the electronics configuration, this function sends a signal to the DataReader processes that are responsible of acquiring the channels involved in the electronic changes.
These two signals allow to identify the electronics configuration that was in use at the time when a given event was acquired.
If this function fails for some reason, the second signal is not sent to the DataReader processes, since in this case the electronics configuration is undefined.
Possible values for retStatus are:
  • QERR_SUCCESS: the execution completed successfully;
  • QERR_OVERFLOW: the execution was skipped because the mutex was already locked;
  • QERR_UNDEFINED_STATUS: the thread was interrupted by a call to InterruptExecution()
  • any other error code propagated by QEleInterface.

References QEleInterface::GetError(), QBaseClient::GetError(), QEleInterface::GetInstance(), QError::Set(), QSlowControlClient::SetPSupplyVsetDiff(), QDaqClient::SetTriggerFlag(), QSlowControlClient::SetWriteMode(), and QEleInterface::WriteChannel().


Generated on Tue Nov 16 10:50:00 2010 for CUORE Software by  doxygen 1.5.6