QApolloDb Class Reference
[ApolloDataBase]

Inheritance diagram for QApolloDb:

QApolloDbDaq QApolloDbGui QApolloDbServer QApolloDbSlow

List of all members.


Detailed Description

read-only interface to cuore data base, intended for daq use

Author:
sergio.didomizio@ge.infn.it This class only provide an interface to core class QApolloDbBase. Look at that class for member functions documentation.

Public Member Functions

bool Reset ()
 Close connection to data base and reset singleton.
const std::map< unsigned int,
std::string > & 
CrateMap () const
 get map of active crates and corresponding host name
int GetListOfChannels (std::vector< unsigned int > &chList, unsigned int profileId=0)
 get list of active channels corresponding to given profile
unsigned int GetMapping (std::map< unsigned int, QDaqChannel > &cMap)
 fill map with lg channel and corresponding hardware mapping
unsigned int GetActiveChannels (std::map< unsigned int, QDaqChannel > &cMap, QDaqChannel::SettingsType_t what)
 fill map with lg channel and corresponding QDaqChannel
int GetBoards (unsigned int crateId, std::map< unsigned int, std::string > &boards)
 fill boards map with slot and board name
int GetActiveChannels (unsigned int crateId, unsigned int slot, QDaqChannel::SettingsType_t what, std::vector< QDaqChannel > &v)
 Fill map containing given settins for active lg chnannels belonging to the given DAQ slot and DAQ crate.
void GetListOfTriggers (unsigned int lg, std::vector< std::string > &trgList)
 fill list of trigger names for the given channel
const QVdt & GetTrgParameter (unsigned int trgIndex, const std::string &par_name, unsigned int lg=0)
 Get parameter for given trigger index and given channel.
const std::map< std::string,
QVdt > & 
GetTrgParameters (unsigned int trgIndex, unsigned int lg)
 Get map of parameters for given trigger and logical channel.
bool Dump (unsigned int crateId, bool dump)
 dump settings and mapping for the given lg channel
virtual unsigned int GetCurrentRunNumber () const
 return current run number
unsigned int GetCurrentProfile () const
 return profile associated to current run
QDbDetector::RunType GetCurrentRunType () const
 return run type id to current run
void GetSettingsBaskets (int howMany, std::map< std::string, std::vector< QVdt > > &basketsMap)
 get a subset of fields from settings_basket table
unsigned int GetSettingsBasketIds (std::vector< int > &baskets)
 get vector conaining existing settings basket ids
unsigned int GetSettingsBasket (unsigned int id, std::string &comment)
 get comment associated to given settings basket id
unsigned int GetDefaultSettingsBasket ()
 get default settings basket
void GetRunTypes (std::map< unsigned int, std::string > &runTypes)
 get a subset of fields from runtypes table
unsigned int GetPulserPeriod ()
 get pulser period
void GetRuns (std::vector< int > &runs)
 get all run numbers present in runs table
unsigned int GetLastRun ()
 get from db the run number with the most recent start date
bool GetStartDateOfRun (unsigned int runNumber, std::string &startDate)
 get start date of a given run number formatted as a string
bool BasketHasPulsers (unsigned int basket)
 check whether a given settings basket has any channel with pulser
bool GetPasswordHash (const std::string &user, std::string &hash)
 get password hash for the requested user name
QApolloUserLevel GetUserLevel (const std::string &user)
 get authentication level for requested user
void GetListOfUsers (std::set< std::string > &users, QApolloUserLevel minLevel, QApolloUserLevel maxLevel)
 get list of existing users with auth level between minLevel and maxLevel

Protected Member Functions

 QApolloDb ()
 constructor

Member Function Documentation

int QApolloDb::GetListOfChannels ( std::vector< unsigned int > &  chList,
unsigned int  profileId = 0 
) [inline]

get list of active channels corresponding to given profile

Parameters:
chList vector of active channels
profileId requested profileId. If it is zero, current profile Id is assumed or an error is returned in case DAQ is not running.
Returns:
number of channels in vector or -1 in case of error

References QApolloDbBase::Get(), and QApolloDbBase::GetListOfChannels().

Referenced by QGuiScope::GetActiveChannels(), and QGUIHistogramDisplay::GetActiveChannels().

unsigned int QApolloDb::GetMapping ( std::map< unsigned int, QDaqChannel > &  cMap  )  [inline]

fill map with lg channel and corresponding hardware mapping

Parameters:
cMap map to be filled
Returns:
number of active channels

References QApolloDbBase::Get(), and QApolloDbBase::GetMapping().

unsigned int QApolloDb::GetActiveChannels ( std::map< unsigned int, QDaqChannel > &  cMap,
QDaqChannel::SettingsType_t  what 
) [inline]

fill map with lg channel and corresponding QDaqChannel

Parameters:
what settings to be loaded
cMap map to be filled
Returns:
number of active channels

References QApolloDbBase::Get(), and QApolloDbBase::GetActiveChannels().

Referenced by QPulserController::BuildGroups(), QSlowControlServer::GetDBConfiguration(), QDigitalController_v2::QDigitalController_v2(), QGuiEleMain::UpdateActiveChannels(), and QGuiPulserMain::UpdateSettingsBasket().

int QApolloDb::GetBoards ( unsigned int  crateId,
std::map< unsigned int, std::string > &  boards 
) [inline]

fill boards map with slot and board name

Parameters:
crateId identifier of DAQ crate for which board map is filled
boards map to be filled
Returns:
number of active boards in crateId

References QApolloDbBase::Get(), and QApolloDbBase::GetBoards().

int QApolloDb::GetActiveChannels ( unsigned int  crateId,
unsigned int  slot,
QDaqChannel::SettingsType_t  what,
std::vector< QDaqChannel > &  v 
) [inline]

Fill map containing given settins for active lg chnannels belonging to the given DAQ slot and DAQ crate.

Parameters:
crateId identifier of DAQ crate for which channel map is filled
slot identifier of the DAQ slot for which channel map is filled (all slots belonging to crateId are filled if slot = 0)
what type of settings to be loaded. Multiple types can be loaded using the format Type1|Type2
v map to be filled
Returns:
number of channels loaded

References QApolloDbBase::Get(), and QApolloDbBase::GetActiveChannels().

void QApolloDb::GetListOfTriggers ( unsigned int  lg,
std::vector< std::string > &  trgList 
) [inline]

fill list of trigger names for the given channel

If no entry corresponding to the given lg channel is found in the db then the default trigger names (i.e. lg=0) are returned.

Parameters:
lg lg channel for which trigger names are returned. Default trigger names can be obtained asking for lg=0.
trgList vector containing trigger names. trigger name "NULL" means that no trigger is associated with that trigger tag for that lg

References QApolloDbBase::Get(), and QApolloDbBase::GetListOfTriggers().

const QVdt& QApolloDb::GetTrgParameter ( unsigned int  trgIndex,
const std::string &  par_name,
unsigned int  lg = 0 
) [inline]

Get parameter for given trigger index and given channel.

Parameters:
par_name name of parameter to be returned
trgIndex trigger tag for which parameter is returned. Can be 1,2,3 or 4.
lg logical channel for which parameter is returned
Returns:
const reference to a QVdt containing requested trigger parameter

References QApolloDbBase::Get(), and QApolloDbBase::GetTrgParameter().

const std::map<std::string,QVdt>& QApolloDb::GetTrgParameters ( unsigned int  trgIndex,
unsigned int  lg 
) [inline]

Get map of parameters for given trigger and logical channel.

Parameters:
trgIndex trigger tag for which parameter is returned.
lg logical channel for which parameter is returned
Returns:
const reference to a map containing requested trigger parameters

References QApolloDbBase::Get(), and QApolloDbBase::GetTrgParameters().

bool QApolloDb::Dump ( unsigned int  crateId,
bool  dump 
) [inline]

dump settings and mapping for the given lg channel

Returns:
true if channel is not present in cache, true otherwise

References QApolloDbBase::Dump(), and QApolloDbBase::Get().

void QApolloDb::GetSettingsBaskets ( int  howMany,
std::map< std::string, std::vector< QVdt > > &  basketsMap 
) [inline]

get a subset of fields from settings_basket table

Filled fields:

  • settings_basket_id
  • creation_date
  • comments
  • is_default

Parameters:
howMany max number of returned rows
basketMap map to be filled. Inside basketMap, keys identify fields in settings_basket table and values are arrays of QVdt containing content of each field.

References QApolloDbBase::Get(), and QApolloDbBase::GetSettingsBaskets().

unsigned int QApolloDb::GetSettingsBasketIds ( std::vector< int > &  baskets  )  [inline]

get vector conaining existing settings basket ids

Parameters:
baskets reference to the vector that will be filled with existing settings basket ids
Returns:
number of entries found in database

References QApolloDbBase::Get(), and QApolloDbBase::GetSettingsBasketIds().

Referenced by QGUIDataCollector::Reset().

unsigned int QApolloDb::GetSettingsBasket ( unsigned int  id,
std::string &  comment 
) [inline]

get comment associated to given settings basket id

Parameters:
id settings basket id for which the comment is requested. If id is zero default settings basket is assumed
comment reference to a string that will be filled with the comment associated to the default settings basket
Returns:
requested settings basket id. In case default id was requested, real id is returned (not zero...)

References QApolloDbBase::Get(), and QApolloDbBase::GetSettingsBasket().

Referenced by QGUIDataCollector::Reset(), and QGUIDataCollector::SetSettingBasketId().

unsigned int QApolloDb::GetDefaultSettingsBasket (  )  [inline]

get default settings basket

Returns:
settings basket used in the last run on THIS_DETECTOR, or zero if THIS_DETECTOR has no previous runs

References QApolloDbBase::Get(), and QApolloDbBase::GetDefaultSettingsBasket().

void QApolloDb::GetRunTypes ( std::map< unsigned int, std::string > &  runTypes  )  [inline]

get a subset of fields from runtypes table

Filled fields:

  • run_type_id
  • run_type

Parameters:
runTypes reference to map to be filled. Inside runTypes, keys are run_type_id and values are run_type.

References QApolloDbBase::Get(), and QApolloDbBase::GetRunTypes().

unsigned int QApolloDb::GetPulserPeriod (  )  [inline]

get pulser period

Returns:
pulser period in ms or 0 in case of error

References QApolloDbBase::Get(), and QApolloDbBase::GetPulserPeriod().

Referenced by QPulserController::BuildGroups().

void QApolloDb::GetRuns ( std::vector< int > &  runs  )  [inline]

get all run numbers present in runs table

Parameters:
runs reference to vector to be filled. Runs are sorted.

References QApolloDbBase::Get(), and QApolloDbBase::GetRuns().

Referenced by QGUIDataCollector::Reset().

unsigned int QApolloDb::GetLastRun (  )  [inline]

get from db the run number with the most recent start date

Returns:
run number with the most recent start date, or zero if there are no runs at all in the database

References QApolloDbBase::Get(), and QApolloDbBase::GetLastRun().

Referenced by QGUIDataCollector::Reset().

bool QApolloDb::GetStartDateOfRun ( unsigned int  runNumber,
std::string &  startDate 
) [inline]

get start date of a given run number formatted as a string

Parameters:
startDate filled with start date
Returns:
true unless requested run number does not exist

References QApolloDbBase::Get(), and QApolloDbBase::GetStartDateOfRun().

Referenced by QGuiControlWindow::QGuiControlWindow(), and QGuiControlWindow::Update().

bool QApolloDb::GetPasswordHash ( const std::string &  user,
std::string &  hash 
) [inline]

get password hash for the requested user name

Returns:
true unless the requested user name could not be found

References QApolloDbBase::Get(), and QApolloDbBase::GetPasswordHash().

Referenced by QAuthManager::Authenticate().

QApolloUserLevel QApolloDb::GetUserLevel ( const std::string &  user  )  [inline]

get authentication level for requested user

Returns:
user level or InvalidLevel if user is not present in the database

References QApolloDbBase::Get(), and QApolloDbBase::GetUserLevel().

Referenced by QAuthManager::Authenticate().


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

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