unLHCLoggingDB 9.0.0
|
Library containing import file related functions of the unLHCLoggingDB component. More...
Functions | |
bool | unLHCLoggingDBParser_getImportData (const string sConfigFile, dyn_string &dsVariableName, dyn_string &dsHierarchy, dyn_string &dsDescription, dyn_string &dsElementId, dyn_string &dsUnit, dyn_string &dsRDBSource, dyn_string &dsDataCategoryId, bool &bDataCategoryManualInput, dyn_anytype &daConflicts) |
bool | unLHCLoggingDBParser_getConfigFileData (const string sConfigFile, dyn_string &dsVariableName, dyn_string &dsDpe, dyn_string &dsHierarchy, dyn_string &dsDescription, dyn_string &dsDataCategory) |
dyn_string | unLHCLoggingDBParser_cleanHierarchies (const dyn_string &dsHierarchy) |
bool | unLHCLoggingDBParser_parseConfigFile (const string sFileName, dyn_string &dsVariableName, dyn_string &dsDpe, dyn_string &dsAlias, dyn_string &dsHierarchy, dyn_string &dsDescription, dyn_string &dsDataCategory, dyn_anytype &daConflicts) |
bool | unLHCLoggingDBParser_parseXmlConfigFile (const string sFileName, dyn_string &dsVariableName, dyn_string &dsDpe, dyn_string &dsAlias, dyn_string &dsHierarchy, dyn_string &dsDescription, dyn_string &dsDataCategory, dyn_anytype &daConflicts) |
bool | unLHCLoggingDBParser_getNodeAttribute (const unsigned doc, const unsigned node, const string attr, string &value) |
bool | unLHCLoggingDBParser_checkDpConsistency (dyn_string &dsDpe, dyn_string &dsAlias, dyn_anytype &daConflicts) |
bool | unLHCLoggingDBParser_isDpName (string sDp) |
bool | unLHCLoggingDBParser_getElementData (const dyn_string &dsFullDpeName, const dyn_string &dsDpe, const dyn_string &dsAlias, dyn_string &dsElementId, dyn_string &dsUnit, dyn_string &dsRDBSource, dyn_anytype &daConflicts) |
bool | unLHCLoggingDBParser_getDataCategoryId (const dyn_string &dsDpe, const dyn_string &dsAlias, const dyn_string &dsDataCategory, dyn_string &dsDataCategoryId, bool &DataCategoryManualInput, dyn_anytype &daConflicts) |
void | unLHCLoggingDBParser_updateMissingDataCategoryIds (dyn_string &dsDataCategoryId, const string sDefaultDataCategoryId) |
bool | unLHCLoggingDBParser_replaceChars (dyn_string &dsDescription, dyn_anytype &daConflicts) |
void | unLHCLoggingDBParser_replaceCharsInString (string &sTextToReplace, mapping &mReplacements) |
void | unLHCLoggingDBParser_reduceStringToWhiteList (string &sInput, mapping &mRemovedChars) |
bool | unLHCLoggingDBParser_doWhiteListCheck (const dyn_string &dsDpe, const dyn_string &dsAlias, const dyn_string &dsVariableName, const dyn_string &dsDescription, const dyn_string &dsHierarchy, dyn_anytype &daConflicts) |
bool | unLHCLoggingDBParser_checkStringUsingWhiteList (string sInput, string &sErrorMsg) |
bool | unLHCLoggingDBParser_checkVarNames (const dyn_string &dsVariableName, dyn_anytype &daConflicts) |
bool | unLHCLoggingDBParser_checkHierarchies (const dyn_string &dsHierarchy, dyn_anytype &daConflicts) |
bool | unLHCLoggingDBParser_checkIfVariablesAlreadyRegistered (const dyn_string &dsDpe, const dyn_string &dsAlias, const dyn_string &dsElementId, const dyn_string &dsVariableName, const dyn_string &dsDescription, const dyn_string &dsUnit, dyn_anytype &daConflicts) |
bool | unLHCLoggingDBParser_createConfigFile (string sFilePathName, bool bIsXmlFile, const dyn_string &dsDpe, const dyn_string &dsAlias, const dyn_string &dsName, const dyn_string &dsHierarchy, const dyn_string &dsDescription, const dyn_string &dsDataCategory) |
bool | unLHCLoggingDBParser_createXmlConfigFile (string sFilePathName, const dyn_string &dsDpe, const dyn_string &dsAlias, const dyn_string &dsName, const dyn_string &dsHierarchy, const dyn_string &dsDescription, const dyn_string &dsDataCategory) |
dyn_string | unLHCLoggingDBParser_getSetOfPossibleDPEs (bool bShowInternalDPs=true, bool bShowDevices=true, bool bShowAlarms=true, bool bShowOthers=false, dyn_string dsPatterns=makeDynString()) |
dyn_string | unLHCLoggingDBParser_getArchivedDPEs (bool bShowInternalDPs=true) |
dyn_string | unLHCLoggingDBParser_filterForDevicesAndAlarms (const dyn_string &dsDPE, bool bShowDevices, bool bShowAlarms, bool bShowOthers) |
dyn_string | unLHCLoggingDBParser_getDevices () |
dyn_string | unLHCLoggingDBParser_filterForUserPatterns (const dyn_string &dsPatterns, const dyn_string &dsDpe) |
dyn_string | unLHCLoggingDBParser_retrieveConfigData (const string sDPE, const string sUserFunction) |
dyn_string | unLHCLoggingDBParser_generateImportFiles (const dyn_string &dsConfigurations, bool createTempFile=true) |
dyn_string | unLHCLoggingDBParser_getImportFileNames (const dyn_string &dsConfigurations) |
mapping | unLHCLoggingDBParser_prepareConfigData (const dyn_string &dsDPE, const string sUserFunction, bool forceDpeUsage) |
Library containing import file related functions of the unLHCLoggingDB component.
Usage: Public
PVSS manager usage: CTRL, UI
Constraints:
bool unLHCLoggingDBParser_getImportData | ( | const string | sConfigFile, |
dyn_string & | dsVariableName, | ||
dyn_string & | dsHierarchy, | ||
dyn_string & | dsDescription, | ||
dyn_string & | dsElementId, | ||
dyn_string & | dsUnit, | ||
dyn_string & | dsRDBSource, | ||
dyn_string & | dsDataCategoryId, | ||
bool & | bDataCategoryManualInput, | ||
dyn_anytype & | daConflicts | ||
) |
Retrieve data from config file and database, which is needed to register signals in the file for logging
sConfigFile | input, Pathname of the config file |
&dsVariableName | output, list of VARIABLE_NAMES from config file |
&dsHierarchy | output, list of HIERARCHIES from config file |
&dsDescription | output, list of DESCRIPTIONS from config file |
&dsElementId | output, list of ELEMENT_IDS from ELEMENTS table |
&dsUnit | output, list of UNITSS from ELEMENTS table |
&dsRDBSource | output, list of GROUP_NAMES from ELEMENTS table |
&dsDataCategory | output, list of data categories |
&bDataCategoryManualInput | output, Manual input of data category is required |
&daConflicts | output, list of conflicts |
bool unLHCLoggingDBParser_getConfigFileData | ( | const string | sConfigFile, |
dyn_string & | dsVariableName, | ||
dyn_string & | dsDpe, | ||
dyn_string & | dsHierarchy, | ||
dyn_string & | dsDescription, | ||
dyn_string & | dsDataCategory | ||
) |
Get data from config file and resolve dp names.
This function is needed to do the full consictency check
sConfigFile | input, Pathname of the config file |
&dsVariableName | output, variable names from config file |
&dsDpe | output, resolved dpe names from config file |
&dsHierarchy | output, hierarchies from config file |
&dsDescription | output, descriptions from config file |
&dsDataCategory | output, data category names from config file |
dyn_string unLHCLoggingDBParser_cleanHierarchies | ( | const dyn_string & | dsHierarchy | ) |
Cleanup function to make sure each hierarchy are of the correct format Function is made public for unit tests
|
private |
Parse config file and store data into dyn_strings
sFileName | input, Pathname of the config file |
&dsVariableName | output, list of variable names |
&dsDpe | output, list of dpe names |
&dsAlias | output, list of dpe aliases |
&dsHierarchy | output, list of hierarchies |
&dsDescription | output, list of desciptions |
&dsDataCategory | output, list of data categories |
&daConflicts | output, list of conflicts |
|
private |
Parse Xml file and store data into dyn_strings
For example config files see: unLHCLoggingDB/PVSS/data/
sFileName | input, Pathname of the XML file |
&dsVariableName | output, list of variable names |
&dsDpe | output, list of dpe names |
&dsAlias | output, list of dpe aliases |
&dsHierarchy | output, list of hierarchies |
&dsDescription | output, list of desciptions |
&dsDataCategory | output, list of data categories |
&daConflicts | output, list of conflicts |
|
private |
Get value of xml node attribute and check if attribute is missing or has no value
doc | input, xml document id |
node | input, node number |
attr | input, attribute name |
&value | output, attribute value |
|
private |
Check consistency between datapoint and alias and resolve it to full datapoint element name stored in dsDpe
3 possible cases:
&dsDpe | input/output, list of dpe names |
&dsAlias | input/output, list of dpe aliases |
&daConflicts | output, list of conflicts |
|
private |
Checks if a string is a DP name
Dot was found at last position -> it is a DP name
&sDp | input, DP string |
bool unLHCLoggingDBParser_getElementData | ( | const dyn_string & | dsFullDpeName, |
const dyn_string & | dsDpe, | ||
const dyn_string & | dsAlias, | ||
dyn_string & | dsElementId, | ||
dyn_string & | dsUnit, | ||
dyn_string & | dsRDBSource, | ||
dyn_anytype & | daConflicts | ||
) |
Get additional data (ELEMENT_ID, UNIT, RDBSource) from ELEMENTS table
&dsFullDpeName | input, list of resolved Dpes |
&dsDpe | input, list of Dpes |
&dsAlias | input, list of Aliases |
&dsElementId | output, list of ELEMENT_IDS from ELEMENTS table |
&dsUnit | output, list of UNITSS from ELEMENTS table |
&dsRDBSource | output, list of RDBSources from ELEMENTS table |
&daConflicts | output, list of conflicts |
|
private |
Resolve data category names to data category ids
&dsDataCategories | input, list of data category name / subname |
&dsDataCategoryIds | output, list of data category ids |
&DataCategoryManualInput | output, Manual input of data category required |
&daConflicts | output, list of conflicts |
void unLHCLoggingDBParser_updateMissingDataCategoryIds | ( | dyn_string & | dsDataCategoryId, |
const string | sDefaultDataCategoryId | ||
) |
update Missing Data Category Ids with default value
&dsDataCategoryId | input/output, list of data category ids |
&sDefaultDataCategoryId | output, default value |
|
private |
Find and replace illegal characters (only in attribute 'descripton')
This function is only needed to don't break compatibility to old logging because there are thousands of files that contain french accents etc. and we still want to be able to import them.
By showing the warning we encourage people to create clean files that don't contain invalid characters.
&dsDescription | input/output, list of descriptions to replace |
&daConflicts | input/output, list of conflicts |
void unLHCLoggingDBParser_replaceCharsInString | ( | string & | sTextToReplace, |
mapping & | mReplacements | ||
) |
Replace illegal characters (only in attribute 'descripton')
&sTextToReplace | input/output, description to replace |
&mReplacements | input/output, replacements that have been done |
|
private |
Remove all chars from string, which are not in the white list
sInput | input/output string to limit |
mRemovedChars | output, set of removed chars |
|
private |
Check parsed output for illegal characters (only check variable_name, description and hierarchy)
&dsDpe | input, list of Dpes |
&dsAlias | input, list of Aliases |
&dsVariableName | output, list of variable names |
&dsDescription | output, list of descriptions |
&dsHierarchy | output, list of hierarchies |
&daConflicts | output, list of conflicts |
bool unLHCLoggingDBParser_checkStringUsingWhiteList | ( | string | sInput, |
string & | sErrorMsg | ||
) |
Detect illegal chars in string
sInput | input, input string |
sErrorMsg | output, error description |
|
private |
Check names for max length and duplications
&dsVariableName | input, list of variable names |
&daConflicts | output, list of conflicts |
|
private |
Check, if parsed output contains hierarchy=ERROR or IGNORE
&dsHierarchy | input, list of hierarchies |
&daConflicts | output, list of conflicts |
|
private |
Check if list of variables is already registered for logging (in META_VARIABLES table)
&dsDpe | input, list of Dpes |
&dsAlias | input, list of Aliases |
&dsElementId | input, list of ELEMENT_IDS from ELEMENTS table |
&dsVariableName | input, list of VARIABLE_NAMES from config file |
&dsDescription | input, list of descriptions |
&dsUnit | input, list of units |
&daConflicts | output, list of conflicts |
bool unLHCLoggingDBParser_createConfigFile | ( | string | sFilePathName, |
bool | bIsXmlFile, | ||
const dyn_string & | dsDpe, | ||
const dyn_string & | dsAlias, | ||
const dyn_string & | dsName, | ||
const dyn_string & | dsHierarchy, | ||
const dyn_string & | dsDescription, | ||
const dyn_string & | dsDataCategory | ||
) |
Create new config file for logging configuration
sFilePathName | input, full pathname of the file |
bIsXmlFile | input, true=xml-file, false=txt-file |
&dsDpe | input, list of dpe names |
&dsAlias | input, list of dpe aliases |
&dsName | input, list of variable names |
&dsHierarchy | input, list of hierarchies |
&dsDescription | input, list of desciptions |
&dsDataCategory | input, list of data categories name/subname |
|
private |
Create new xml config file for logging configuration
sFilePathName | input, full pathname of the file |
&dsDpe | input, list of dpe names |
&dsAlias | input, list of dpe aliases |
&dsName | input, list of variable names |
&dsHierarchy | input, list of hierarchies |
&dsDescription | input, list of desciptions |
&dsDataCategory | input, list of data categories name/subname |
dyn_string unLHCLoggingDBParser_getSetOfPossibleDPEs | ( | bool | bShowInternalDPs = true , |
bool | bShowDevices = true , |
||
bool | bShowAlarms = true , |
||
bool | bShowOthers = false , |
||
dyn_string | dsPatterns = makeDynString() |
||
) |
Get set of datapoints that could be registered for logging
bShowInternalDPs | input, take internal DPs into account |
&bShowDevices | input, take Devices into account |
&bShowAlarms | input, take SystemAlarms into account |
&bShowOthers | input, take Others (no Devices and SystemAlarms) into account |
&dsPatterns | input, take user defined filter patterns into account |
|
private |
Get set of datapoints that are using RDB Archive
bShowInternalDPs | input, true: take internal DPs into account, false: supress internal DPs |
|
private |
Filter list of DPEs for Devices, Alarms and Others
&bShowDevices | input, forward Devices into output list |
&bShowAlarms | input, forward SystemAlarms into output list |
&bShowOthers | input, forward Others (no Devices and SystemAlarms) into output list |
|
private |
Get list of devices, that are known by the project
|
private |
Filter list of DPEs with a list of patterns and forward DPE to output, if they match with at least one pattern
&dsPatterns | input, List of patterns |
&dsDpe | input, List of DPEs |
dyn_string unLHCLoggingDBParser_retrieveConfigData | ( | const string | sDPE, |
const string | sUserFunction | ||
) |
Retrieve logging config data for a list of DPEs using a user defined function
&dsDpe | input, List of DPEs |
&sUserFunction | input, User defined config file generator function |
dsResult[1] = name dsResult[2] = description dsResult[3] = hierarchy dsResult[4] = alias dsResult[5] = dpe extension
dyn_string unLHCLoggingDBParser_generateImportFiles | ( | const dyn_string & | dsConfigurations, |
bool | createTempFile = true |
||
) |
Generates import files using the builtin mechanism
&dsConfigurations | input, List of configurations |
&createTempFile | input, true create files with .tmp extension |
dyn_string unLHCLoggingDBParser_getImportFileNames | ( | const dyn_string & | dsConfigurations | ) |
Retrieve import file names from configurations
dsConfigurations | input, List of configurations |
|
private |
Retrieve config data for a specific set of data point elements.
dsDPE | input, List of data point elements |
sUserFunction | input, Function used for data retrieval |
forceDpeUsage | input, Flag whether to use Alias+DPE or DPE only |