unLHCLoggingDB 8.5.7
|
Library containing import file related functions of the unLHCLoggingDB component. More...
Functions | |
public 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) |
public bool | unLHCLoggingDBParser_getConfigFileData (const string sConfigFile, dyn_string &dsVariableName, dyn_string &dsDpe, dyn_string &dsHierarchy, dyn_string &dsDescription, dyn_string &dsDataCategory) |
public dyn_string | unLHCLoggingDBParser_cleanHierarchies (const dyn_string &dsHierarchy) |
private 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) |
private 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) |
private bool | unLHCLoggingDBParser_getNodeAttribute (const unsigned doc, const unsigned node, const string attr, string &value) |
private bool | unLHCLoggingDBParser_checkDpConsistency (dyn_string &dsDpe, dyn_string &dsAlias, dyn_anytype &daConflicts) |
private bool | unLHCLoggingDBParser_isDpName (string sDp) |
public 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) |
private bool | unLHCLoggingDBParser_getDataCategoryId (const dyn_string &dsDpe, const dyn_string &dsAlias, const dyn_string &dsDataCategory, dyn_string &dsDataCategoryId, bool &DataCategoryManualInput, dyn_anytype &daConflicts) |
public void | unLHCLoggingDBParser_updateMissingDataCategoryIds (dyn_string &dsDataCategoryId, const string sDefaultDataCategoryId) |
private bool | unLHCLoggingDBParser_replaceChars (dyn_string &dsDescription, dyn_anytype &daConflicts) |
public void | unLHCLoggingDBParser_replaceCharsInString (string &sTextToReplace, mapping &mReplacements) |
private void | unLHCLoggingDBParser_reduceStringToWhiteList (string &sInput, mapping &mRemovedChars) |
private 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) |
public bool | unLHCLoggingDBParser_checkStringUsingWhiteList (string sInput, string &sErrorMsg) |
private bool | unLHCLoggingDBParser_checkVarNames (const dyn_string &dsVariableName, dyn_anytype &daConflicts) |
private bool | unLHCLoggingDBParser_checkHierarchies (const dyn_string &dsHierarchy, dyn_anytype &daConflicts) |
private 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) |
public 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) |
private 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) |
public dyn_string | unLHCLoggingDBParser_getSetOfPossibleDPEs (bool bShowInternalDPs=true, bool bShowDevices=true, bool bShowAlarms=true, bool bShowOthers=false, dyn_string dsPatterns=makeDynString()) |
private dyn_string | unLHCLoggingDBParser_getArchivedDPEs (bool bShowInternalDPs=true) |
private dyn_string | unLHCLoggingDBParser_filterForDevicesAndAlarms (const dyn_string &dsDPE, bool bShowDevices, bool bShowAlarms, bool bShowOthers) |
private dyn_string | unLHCLoggingDBParser_getDevices () |
private dyn_string | unLHCLoggingDBParser_filterForUserPatterns (const dyn_string &dsPatterns, const dyn_string &dsDpe) |
public dyn_string | unLHCLoggingDBParser_retrieveConfigData (const string sDPE, const string sUserFunction) |
public dyn_string | unLHCLoggingDBParser_generateImportFiles (const dyn_string &dsConfigurations, bool createTempFile=true) |
public dyn_string | unLHCLoggingDBParser_getImportFileNames (const dyn_string &dsConfigurations) |
private 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:
public 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 |
public 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 |
public 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 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 | ||
) |
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 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 | ||
) |
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 bool unLHCLoggingDBParser_getNodeAttribute | ( | const unsigned | doc, |
const unsigned | node, | ||
const string | attr, | ||
string & | value | ||
) |
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 bool unLHCLoggingDBParser_checkDpConsistency | ( | dyn_string & | dsDpe, |
dyn_string & | dsAlias, | ||
dyn_anytype & | daConflicts | ||
) |
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 bool unLHCLoggingDBParser_isDpName | ( | string | sDp | ) |
Checks if a string is a DP name
Dot was found at last position -> it is a DP name
&sDp | input, DP string |
public 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 bool unLHCLoggingDBParser_getDataCategoryId | ( | const dyn_string & | dsDpe, |
const dyn_string & | dsAlias, | ||
const dyn_string & | dsDataCategory, | ||
dyn_string & | dsDataCategoryId, | ||
bool & | DataCategoryManualInput, | ||
dyn_anytype & | daConflicts | ||
) |
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 |
public 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 bool unLHCLoggingDBParser_replaceChars | ( | dyn_string & | dsDescription, |
dyn_anytype & | daConflicts | ||
) |
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 |
public 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 void unLHCLoggingDBParser_reduceStringToWhiteList | ( | string & | sInput, |
mapping & | mRemovedChars | ||
) |
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 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 | ||
) |
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 |
public bool unLHCLoggingDBParser_checkStringUsingWhiteList | ( | string | sInput, |
string & | sErrorMsg | ||
) |
Detect illegal chars in string
sInput | input, input string |
sErrorMsg | output, error description |
private bool unLHCLoggingDBParser_checkVarNames | ( | const dyn_string & | dsVariableName, |
dyn_anytype & | daConflicts | ||
) |
Check names for max length and duplications
&dsVariableName | input, list of variable names |
&daConflicts | output, list of conflicts |
private bool unLHCLoggingDBParser_checkHierarchies | ( | const dyn_string & | dsHierarchy, |
dyn_anytype & | daConflicts | ||
) |
Check, if parsed output contains hierarchy=ERROR or IGNORE
&dsHierarchy | input, list of hierarchies |
&daConflicts | output, list of conflicts |
private 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 | ||
) |
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 |
public 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 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 | ||
) |
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 |
public 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 dyn_string unLHCLoggingDBParser_getArchivedDPEs | ( | bool | bShowInternalDPs = true | ) |
Get set of datapoints that are using RDB Archive
bShowInternalDPs | input, true: take internal DPs into account, false: supress internal DPs |
private dyn_string unLHCLoggingDBParser_filterForDevicesAndAlarms | ( | const dyn_string & | dsDPE, |
bool | bShowDevices, | ||
bool | bShowAlarms, | ||
bool | bShowOthers | ||
) |
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 dyn_string unLHCLoggingDBParser_getDevices | ( | ) |
Get list of devices, that are known by the project
private dyn_string unLHCLoggingDBParser_filterForUserPatterns | ( | const dyn_string & | dsPatterns, |
const dyn_string & | dsDpe | ||
) |
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 |
public 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
public 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 |
public dyn_string unLHCLoggingDBParser_getImportFileNames | ( | const dyn_string & | dsConfigurations | ) |
Retrieve import file names from configurations
dsConfigurations | input, List of configurations |
private mapping unLHCLoggingDBParser_prepareConfigData | ( | const dyn_string & | dsDPE, |
const string | sUserFunction, | ||
bool | forceDpeUsage | ||
) |
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 |