QLCFlowController Class Reference
[Apollo]

Inheritance diagram for QLCFlowController:

QOnlineMessenger

List of all members.


Detailed Description

this singleton controls the flow of the load curves procedure by keeping track of the number of measurements performed for each channel and for each electronics configuration.

Author:
Sergio Di Domizio At the beginning of the load curves procedure the Register() method can be called to register, for each measurement type, the list of active channels and the number of measurements to be performed in each configuration.
Then each time a measurement is detected for a given type and channel, the Decrement() method can be called, so that the counter for that particular measurement is decremented by one.
The number of missing measurements for a given channel and measurement type can be retrieved with the GetMissing() method.
The ConfDone() method allows to determine when all the measurement types for all the channels are done, and therefore it's time to move to the next electronics configuration.
At this point the NextConf() method must be called, so that all the counters are reset to their inital values and a measurement with a new configuration can start.
The NextConf() method must be called also at the beginning of the procedure, after all the calls to Register(), so that the counters are initialized.

Public Member Functions

virtual ~QLCFlowController ()
 dtor
void Register (const std::string &measName, const std::set< int > &channels, int minNumMeas)
 register a new measurement named measName that will involve the logical channels contained in channels and that will require at least minNumMeas events per configuration per channel.
void Decrement (const std::string &measName, int lg, int id)
 decrement counter for the requested measName and channel
bool ConfDone () const
 check whether all the measurments with the current configuration are done (i.e. the counters for all the measurements and for all the channels are zero)
void NextConf ()
 move to the next configuration (i.e. reset all counters to their initial value)
void Reset ()
 remove all registered counters
void Dump (std::ostream &os) const
int GetMissing (const std::string &measName, int lg) const
 get number of missing measurements for the given measName and lg

Static Public Member Functions

static QLCFlowControllerGetInstance ()
 singleton getter

Private Member Functions

 QLCFlowController ()

Private Attributes

std::map< std::string,
std::map< int, int > > 
fCounters
std::map< std::string,
std::map< int, int > > 
fLastIds
std::map< std::string,
std::map< int, bool > > 
fAllowDecrement
std::map< std::string,
std::pair< std::set< int >
, int > > 
fReference

Static Private Attributes

static QLCFlowControllergMe = NULL

Constructor & Destructor Documentation

QLCFlowController::QLCFlowController (  )  [private]


Member Function Documentation

void QLCFlowController::Register ( const std::string &  measName,
const std::set< int > &  channels,
int  minNumMeas 
)

register a new measurement named measName that will involve the logical channels contained in channels and that will require at least minNumMeas events per configuration per channel.

Possible pre-existing entries with the same measName are overwritten

References fReference.

Referenced by MLCEleCheckController::InitFlowController(), and MLCBoloCheckController::InitFlowController().

void QLCFlowController::Decrement ( const std::string &  measName,
int  lg,
int  id 
)

decrement counter for the requested measName and channel

Parameters:
id id associated to the current electroincs configuration. See detailed description for the meaning of this parameter.
This function has no effect if measName or lg are invalid or if the counter value is not > 0.
Moreover a check based on id is performed to ensure consistency in the transition between two electronics configurations.

References fAllowDecrement, fCounters, fLastIds, QOnlineMessenger::OLDebug(), and QOnlineMessenger::OLWarn().

void QLCFlowController::Dump ( std::ostream &  os  )  const

dump current status of this object to os

References fCounters.

int QLCFlowController::GetMissing ( const std::string &  measName,
int  lg 
) const

get number of missing measurements for the given measName and lg

Returns:
number of missing measurements or 0 if measName and/or lg are invalid

References fCounters.


Member Data Documentation

std::map<std::string, std::map<int, int> > QLCFlowController::fCounters [private]

map storing counters for each measurement type and channel
works as counter[MeasType][channel] = num. of missing measurements

Referenced by ConfDone(), Decrement(), Dump(), GetMissing(), NextConf(), and Reset().

std::map<std::string, std::map<int, int> > QLCFlowController::fLastIds [private]

Stores electronics configuration id used before the last call to NextConfig(). It is used, together with fAllowDecrement, to handle the transition between two electronics configurations (i.e. to avoid decrementing the counter for the new configuration when the id passed to Decrement() is actually from the past configuration).

Referenced by Decrement(), NextConf(), and Reset().

std::map<std::string, std::map<int, bool> > QLCFlowController::fAllowDecrement [private]

see documentation for fLastIds

Referenced by Decrement(), NextConf(), and Reset().

std::map<std::string, std::pair<std::set<int>, int> > QLCFlowController::fReference [private]

map containing reference values for registered measurement types
works as fReference[MeasType] = pair<set of active channels, minNumMeas>;

Referenced by NextConf(), Register(), and Reset().

QLCFlowController * QLCFlowController::gMe = NULL [static, private]

static ptr to this object

Referenced by GetInstance().


The documentation for this class was generated from the following files:

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