MLCBaseController Class Reference
[Modules]

Inheritance diagram for MLCBaseController:

QDriver QBaseModule MLCBoloCheckController MLCEleCheckController

List of all members.


Detailed Description

base module for flow control in load curves procedures

Author:
Sergio Di Domizio
This module controls the interaction with the electronics during load curves. It is a base module and cannot be used directly. Child modules must inherit from it and implement procedure-specific functionalities. In particular the following methods must be implemented in child modules:
  • ReadWorkFlow(): this method is called in the initialization phase and can be used to read from a configuration file the electronics parameters to be changed at each load curves step. For example, for the case of the standard load curves procedure, it can be used to read from a file the list of external bias values to be applied during the procedure.
  • MakeGroups() (optional): this method is called at the first iteration of the procedure and is needed to group channels based on a criterion that is meaningful for the specific procedure that is being performed. In the default version (implemented in the base class) channels are grouped in ascending order.
  • SetupNextConf(): this method is called every time a set of measurements with a given configuration is complete. Using the configuration loaded in ReadWorkFlow(), this method must setup the electronics configuration objects that will be used to perform the next set of measurements.
  • InitFlowController(): in this method child classes can initialize the flow controller. See the documentation of QLCFlowController for further details.
  • SetProcedureType(): in this method child classes should declare the specific procedure type, by setting the fProcedureType variable. This is needed for the automatic initialization of the MLCMeasCollector module, that will determine which type of curve objects to construct based on the value of this variable.


Public Member Functions

 MLCBaseController (const std::string &name, QSequence *s)
 constructor
virtual ~MLCBaseController ()
 destructor
Action Init ()
 Init method.
Action Do (QEvent *ev)
 Do method.
Action Done ()
 Done method.

Protected Member Functions

const std::set< int > & GetActiveChannels () const
virtual QError ReadWorkFlow ()=0
virtual QError MakeGroups (std::vector< std::set< int > > &groups) const
virtual ActionId SetupNextConf ()=0
virtual void InitFlowController ()=0
std::map< int,
QEleChannelConfig * > 
GetCurrentConfigs ()
std::set< int > GetCurrentGroup () const
 get set of logical channels belonging to current group
virtual void SetProcedureType ()=0
void SetExternalBiasV (double biasV)

Protected Attributes

QLCProcedure_t fProcedureType

Private Member Functions

QError ReadInitFile ()
void InitHandler ()
ActionId NextConf ()

Private Attributes

std::string fMatrixName
double fExternalBiasV
int fSleepAfterChangeSec
int fStepTimeoutSec
time_t fTimeOfLastChangeUnix
std::set< int > fActiveChannels
std::vector< std::set< int > > fGroups
size_t fCurrGroupId
std::map< int,
QEleChannelConfig * > 
fConfigs
std::set< int > fWrongPolarityChannels
std::set< int > fChannelsWithHeater

Member Function Documentation

const std::set<int>& MLCBaseController::GetActiveChannels (  )  const [inline, protected]

get list of logical channels involved in the procedure

References fActiveChannels.

Referenced by MakeGroups().

virtual QError MLCBaseController::ReadWorkFlow (  )  [protected, pure virtual]

read work flow to be used during the load curves procedure

Implemented in MLCBoloCheckController, and MLCEleCheckController.

Referenced by Init().

QError MLCBaseController::MakeGroups ( std::vector< std::set< int > > &  groups  )  const [protected, virtual]

build channel groups starting from the informations in fActiveChannels and in fConfigs

References GetActiveChannels(), and QBaseModule::GetInt().

Referenced by Init().

virtual ActionId MLCBaseController::SetupNextConf (  )  [protected, pure virtual]

set electronics configuration for all channels and/or external bias to be used in the next configuration

Returns:
QDriver::ACT_NEXTEV if there is at least another configuration to be measured, or QDriver::ACT_RERUN if the procedure is complete for the current group.

Implemented in MLCBoloCheckController, and MLCEleCheckController.

Referenced by NextConf().

virtual void MLCBaseController::InitFlowController (  )  [protected, pure virtual]

QLCFlowController initialization

Implemented in MLCBoloCheckController, and MLCEleCheckController.

Referenced by Init().

std::map< int, QEleChannelConfig * > MLCBaseController::GetCurrentConfigs (  )  [protected]

get configurations for channels that belong to current group

References fConfigs, fCurrGroupId, and fGroups.

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

std::set<int> MLCBaseController::GetCurrentGroup (  )  const [inline, protected]

get set of logical channels belonging to current group

In principle this method is dangerous since it is not guaranteed that fGroups has an entry at fCurrGroupId.

References fCurrGroupId, and fGroups.

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

virtual void MLCBaseController::SetProcedureType (  )  [protected, pure virtual]

Set procedure type. This method must set the value of the variable fProcedureType.

Implemented in MLCBoloCheckController, and MLCEleCheckController.

Referenced by Init().

void MLCBaseController::SetExternalBiasV ( double  biasV  )  [inline, protected]

Set external bias in V

References fExternalBiasV.

Referenced by MLCBoloCheckController::SetupNextConf().

QError MLCBaseController::ReadInitFile (  )  [private]

Read file containing initial electronics configuration.
Returns error in the following cases:

  • The name of the input file is missing in the cfg
  • The input file cannot be opened
  • Any of the objects expected to be present in the input file could not be read

References fActiveChannels, fChannelsWithHeater, fConfigs, fExternalBiasV, fMatrixName, fSleepAfterChangeSec, fStepTimeoutSec, fWrongPolarityChannels, QLCConfigReader::Get(), QLCConfigReader::GetActiveChannels(), QBaseModule::GetBool(), QLCConfigReader::GetChannelsWithHeater(), QBaseModule::GetDouble(), QBaseModule::GetInt(), QBaseModule::GetString(), QLCConfigReader::GetWrongPolarityChannels(), LC_INITFILE_AUXNAME, QLCConfigWriter::M_LC, QLCConfigReader::Open(), QBaseModule::SeqAuxData(), QError::Set(), and QBaseModule::Warn().

Referenced by Init().

void MLCBaseController::InitHandler (  )  [private]

QDriver::ActionId MLCBaseController::NextConf (  )  [private]

move to the next configuration for the current group

Returns:
ACT_RERUN if procedure is complete for current group, ACT_NEXTEV otherwise

References QEleConfigHandler::Add(), QEleConfigHandler::Apply(), fConfigs, fCurrGroupId, fExternalBiasV, fGroups, fSleepAfterChangeSec, fTimeOfLastChangeUnix, QLCFlowController::GetInstance(), QEleConfigHandler::GetInstance(), QLCFlowController::NextConf(), QEleConfigHandler::SetExternalBiasV(), QEleConfigHandler::SetSleepAfterChangeSec(), and SetupNextConf().

Referenced by Do().


Member Data Documentation

Stores the procedure type, used to set a SeqAuxData that is read by the MLCMeasCollector module, so that it knows which type of curves should be created in the initialization phase.
In the base class this variable is set to LC_INVALID, and if it is not set appropriately in the child classes (in the implementation of the SetProcedureType() method), an error is thrown.

Referenced by Init(), MLCEleCheckController::SetProcedureType(), and MLCBoloCheckController::SetProcedureType().

std::string MLCBaseController::fMatrixName [private]

name of the QMatrix used to store electronics configuration

Referenced by ReadInitFile().

value to be used as external bias (in V), or 10V if the cfg asks to use the internal bias

Referenced by NextConf(), ReadInitFile(), and SetExternalBiasV().

sleep time in s for QEleConfigHandler

Referenced by NextConf(), and ReadInitFile().

timeout in seconds for each curve step (0 means no limit)

Referenced by Do(), and ReadInitFile().

time of last electronics change in unix time format, used for timeout

Referenced by Do(), Init(), and NextConf().

std::set<int> MLCBaseController::fActiveChannels [private]

set of logical channels involved in the procedure

Referenced by GetActiveChannels(), and ReadInitFile().

std::vector<std::set<int> > MLCBaseController::fGroups [private]

array of channel groups -- built by MakeGroups()

Referenced by Done(), GetCurrentConfigs(), GetCurrentGroup(), Init(), InitHandler(), and NextConf().

id of currently active channel group

Referenced by Done(), GetCurrentConfigs(), GetCurrentGroup(), InitHandler(), and NextConf().

map of electronics configurations

Referenced by GetCurrentConfigs(), NextConf(), ReadInitFile(), and ~MLCBaseController().

channels with bad hardware cabling for which bias polarity is inverted

Referenced by InitHandler(), and ReadInitFile().

std::set<int> MLCBaseController::fChannelsWithHeater [private]

channels for which the heater can be considered

Referenced by ReadInitFile().


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

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