|
void | fwConfigurationDB_updateDeviceConfigurationFromDB (string configurationName, string hierarchyType, dyn_string &exceptionInfo, time validOn=0, dyn_string deviceList="", string systemName="", int options=fwConfigurationDB_deviceConfig_ALLDEVPROPS) |
|
void | fwConfigurationDB_getHierarchyFromPVSS (string rootNode, string hierarchyType, dyn_string &nodeList, dyn_string &exceptionInfo, string system="", string includeRootNode=TRUE) |
|
void | _fwConfigurationDB_copyDeviceListObjectEntry (dyn_dyn_mixed &srcObject, int src_idx, dyn_dyn_mixed &dstObject, int dst_idx, dyn_string &exceptionInfo) |
|
void | _fwConfigurationDB_ensureDeviceListObjectValid (dyn_dyn_mixed &obj) |
|
void | fwConfigurationDB_expandToDeviceListObject (string hierarchyType, dyn_string deviceList, dyn_dyn_mixed &deviceListObject, dyn_string &exceptionInfo) |
|
void | _fwConfigurationDB_completeDevicesInHierarchy (dyn_string &deviceList, string hierarchyType, string system, dyn_string &exceptionInfo) |
|
void | _fwConfigurationDB_verifyDatapoints (string hierarchyType, dyn_dyn_mixed &deviceListObject, dyn_dyn_mixed &missingDevicesListObject, dyn_string &exceptionInfo, bool checkDeviceLocal=FALSE) |
|
void | _fwConfigurationDB_createDevices (dyn_dyn_mixed deviceListObject, string hierarchyType, dyn_string &exceptionInfo) |
|
void | _fwConfigurationDB_configureDevices (dyn_dyn_mixed &deviceListObject, string hierarchyType, dyn_string &exceptionInfo, int options=fwConfigurationDB_deviceConfig_ALLDEVPROPS) |
|
void | fwConfigurationDB_getReferencesHistory (string configName, string hierarchyType, time startTime, time endTime, dyn_string itemNames, dyn_dyn_mixed &references, dyn_string &exceptionInfo) |
|
void | fwConfigurationDB_getDeviceConfigurations (string hierarchyType, dyn_string &confNames, dyn_string &confDescriptions, dyn_int &confIds, dyn_string &exceptionInfo) |
|
void | fwConfigurationDB_deleteDeviceConfiguration (string confName, dyn_string &exceptionInfo, bool deleteOldOnly=false) |
|
void | _fwConfigurationDB_checkSaveDpTypes (dyn_string dpTypes, dyn_int &dpTypeIds, dyn_mixed &dpTypeElements, dyn_mixed &dpTypeElementIds, time date, dyn_string &exceptionInfo) |
|
void | _fwConfigurationDB_configureFwDevicesWithDefaults (dyn_string &dps, dyn_string &dptypes, dyn_string &models, dyn_string &exceptionInfo) |
|
void | _fwConfigurationDB_configureDevicesFromDB (dyn_string &exceptionInfo, int options=fwConfigurationDB_deviceConfig_ALLDEVPROPS) |
|
void | _fwConfigurationDB_getIpropIdsInConfiguration (string configurationName, dyn_string &dpes, dyn_int &ipropIds, dyn_string &exceptionInfo) |
|
void | fwConfigurationDB_updateDeviceModelsInDB (dyn_string dpList, dyn_string &exceptionInfo, bool updateAliases=TRUE) |
|
int | _fwConfigurationDB_selectDevicesToLoad (string configurationName, string hierarchyType, dyn_string &deviceList, dyn_string &exceptionInfo, string topNode="") |
|
int | fwConfigurationDB_saveDevicesToDBMinimal (dyn_string &deviceList, dyn_string &exceptionInfo, bool abortWhenDeviceMissing=FALSE) |
|
void | fwConfigurationDB_resolveDevices (dyn_string &deviceList, dyn_string &devHierarchies, dyn_string &devDatapoints, dyn_string &exceptionInfo, bool errorOnNotFound=TRUE, dyn_string deviceSystems="") |
|
void | fwConfigurationDB_findDPsFromAliases (dyn_string devices, dyn_string &dp_names, dyn_string &aliases, dyn_string &exceptionInfo, dyn_string systems="*", bool errorOnNotFound=TRUE) |
|
This package contains hierarchy-related functions of the Configuration Database tool
- Author
- Piotr Golonka (BE/ICS-FD)
- Date
- December 2018
(c) Copyright CERN, All Rights Reserved
void fwConfigurationDB_getReferencesHistory |
( |
string |
configName, |
|
|
string |
hierarchyType, |
|
|
time |
startTime, |
|
|
time |
endTime, |
|
|
dyn_string |
itemNames, |
|
|
dyn_dyn_mixed & |
references, |
|
|
dyn_string & |
exceptionInfo |
|
) |
| |
Returns the history of hierarchies mapping for specipied period of time,
and for certain configuration.
- Parameters
-
configName | the name of static configuration |
hierarchyType | type of hierarchy (eg. fwDevice_LOGICAL) |
startTime | start of queried period of time |
endTime | end of queried period of time. Passing 0 as a parameter means: up to now |
itemNames | list of logical names of devices being queried |
references | the result will be put in this variable on return; explanation of the output format below |
exceptionInfo | standard exception handling variable |
The data returned by the function has a format of 4-column array:
- references[1] contain item names (in logical view)
- references[2] contain corresponding dp names from hardware view
- references[3] contain the start of validity period for this mapping
- references[4] contain the end of validity period for this mapping
The rows are sorted by logical dpname and start of validity.
Example:
references[1] | references[2] | references[3] | references[4] |
SubSys/straw1 | dist_1:CAEN/crate01/board00/channel001 | 5 Jan 2006 | 6 Jan 2006 |
SubSys/straw1 | dist_1:CAEN/crate01/board00/channel011 | 6 Jan 2006 | 10 Jan 2006 |
SubSys/straw1 | dist_1:CAEN/crate01/board10/channel001 | 10 Jan 2006 | |
SubSys/straw2 | dist_1:CAEN/crate01/board01/channel002 | 5 Jan 2006 | |
SubSys/straw3 | dist_1:CAEN/crate01/board01/channel003 | 5 Jan 2006 | |
In this example, one can see that the SubSys/straw1 aparently had some problems: it was initially mapped to first channel of first board, then on 6th of January 2006, reconnected to eleventh channel of first board, then again, on 10th of January 2006 it was reconnected to first channel of tenth board, and stays as such since then. The other two straws were not touched and stay connected to channel 2 and 3 on first board...
int _fwConfigurationDB_selectDevicesToLoad |
( |
string |
configurationName, |
|
|
string |
hierarchyType, |
|
|
dyn_string & |
deviceList, |
|
|
dyn_string & |
exceptionInfo, |
|
|
string |
topNode = "" |
|
) |
| |
Selects the devices to be loaded, prepares the data in ConfDB data-exchange tables.
There are two ways to specify the list of devices:
- explicitly: by passing it as input in deviceList parameter
- look-up in the DB: specify the top node, such as the system name; this mode is activated by the fact of passing empty deviceList on input (on output it will be populated with device names); the topNode parameter should be passed: if left empty, the name of the current system will be taken.
Then a cross-check is done on the deviceList passed on input: if all devices indeed exist in the specified configuration, the deviceList parameter, then they are sorted alphabeticaly (so that on return the deviceList param DIFFERS than the one on input) all the preparation is done and return code of zero is returned. However, if some of devices passed in deviceList are not present in the database, they will be skipped - on return a modified deviceList parameter will have the valid one, and the return value from the function will be 1
Return codes less than zero signify an error - details in exceptionInfo
int fwConfigurationDB_saveDevicesToDBMinimal |
( |
dyn_string & |
deviceList, |
|
|
dyn_string & |
exceptionInfo, |
|
|
bool |
abortWhenDeviceMissing = FALSE |
|
) |
| |
Stores "minimal" information about the devices to DB
This function stores minimal information about devices into the DB, so that recipes for these devices may also be stored.
- Parameters
-
[in,out] | deviceList | - list of names of devices; may include a mixture of devices from the HARDWARE and LOGICAL hierarchies; on exit, it will contain the list of devices that were actually stored/verified, namely: the non-existing devices are removed from the list, and devices that are needed to satisfy the hierarchical constraints (parents, grandparents,...) are added to the list |
[out] | exceptionInfo | - standard exception-handling parameter |
[in] | abortWhenDeviceMissing | (optional, default FALSE) - if set to TRUE, the function will abort (and return an error) if some of specified devices does not exist, i.e. it will not store the good ones in the database; otherwise (the default behaviour), the missing devices will be skipped, the good ones will be stored in the database, and the return value of 1 will signify that there were missing devices. |
- Return values
-
0 | - everything OK: all devices are in DB now |
1 | - some devices in the deviceList do not exist, and were skipped; the list of them is in the exceptionInfo; apart from that, everything was OK |
-1 | - there was an error while storing the devices; details in the exceptionInfo |
How to handle the return value and the exceptionInfo, when the abortWhenDeviceMissing
parameter is FALSE
. This example shows how to make sure that the recipeObject can be saved to DB. The devices that exist - are saved. For all devices that are missing, we post-process the recipeObject to remove the data for non-existing devices, then save the recipeObject to DB
dyn_dyn_mixed recipeObject;
if (rc!=0) {
if (rc==-1) {
fwExceptionHandling_display(exceptionInfo);
return FALSE;
} else if (rc==1) {
DebugN("There were some missing devices - the others were saved OK");
if (!dynContains(deviceList,dev)) {
dynRemove(recipeObject[j],i);
}
i--;
}
}
}
}
if (dynlen(exceptionInfo)){fwExceptionHandling_display(exceptionInfo);return;};