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 |
int QApolloDb::GetListOfChannels | ( | std::vector< unsigned int > & | chList, | |
unsigned int | profileId = 0 | |||
) | [inline] |
get list of active channels corresponding to given profile
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. |
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
cMap | map to be filled |
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
what | settings to be loaded | |
cMap | map to be filled |
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
crateId | identifier of DAQ crate for which board map is filled | |
boards | map to be filled |
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.
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 |
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.
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.
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 |
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.
trgIndex | trigger tag for which parameter is returned. | |
lg | logical channel for which parameter is returned |
References QApolloDbBase::Get(), and QApolloDbBase::GetTrgParameters().
bool QApolloDb::Dump | ( | unsigned int | crateId, | |
bool | dump | |||
) | [inline] |
dump settings and mapping for the given lg channel
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:
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
baskets | reference to the vector that will be filled with existing settings basket ids |
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
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 |
References QApolloDbBase::Get(), and QApolloDbBase::GetSettingsBasket().
Referenced by QGUIDataCollector::Reset(), and QGUIDataCollector::SetSettingBasketId().
unsigned int QApolloDb::GetDefaultSettingsBasket | ( | ) | [inline] |
get default settings basket
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:
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
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
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
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
startDate | filled with start date |
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
References QApolloDbBase::Get(), and QApolloDbBase::GetPasswordHash().
Referenced by QAuthManager::Authenticate().
QApolloUserLevel QApolloDb::GetUserLevel | ( | const std::string & | user | ) | [inline] |
get authentication level for requested user
References QApolloDbBase::Get(), and QApolloDbBase::GetUserLevel().
Referenced by QAuthManager::Authenticate().