fwFSMConfDB  8.4.0
fwFsmConfDB.ctl File Reference

Functions

int fwFSMConfDB_initialize (string sDomain, string sConfigurator)
 
bool fwFSMConfDB_getUseConfDB (string sConfigurator)
 
void fwFSMConfDB_updateDeviceList (string sDomain, string sConfigurator)
 
dyn_string fwFSMConfDB_getDomainDevices (string sDomain)
 
void fwFSMConfDB_getAllDevices (string domain, string lunit, dyn_string &devices, int ignore_disabled=0, bool excludeMajority=true)
 
bool fwFSMConfDB_isConfigurator (string sDevice)
 
string fwFSMConfDB_getDomainConfigurator (string sDomain)
 
string fwFSMConfDB_removeSystemName (string sDpName)
 
bool fwFSMConfDB_waitForStateChange (string sDomain, string sConfigurator, time timeout)
 
int fwFSMConfDB_initConfDBConnection ()
 
dyn_string fwFSMConfDB_getConfiguratorDevices (string sConfigurator)
 
int fwFSMConfDB_cacheExists (string sCache)
 
int fwFSMConfDB_cacheAllRecipesForMode (string sDomain, string sMode="")
 
int fwFSMConfDB_setState (string sDevice, string sState)
 
int fwFSMConfDB_setCurrentMode (string sConfigurator, string sMode)
 
string fwFSMConfDB_getCurrentMode (string sConfigurator)
 
int fwFSMConfDB_applyRecipe (string sDomain, string sDevice, string sCommand, string sMode="")
 
int fwFSMConfDB_ApplyRecipe (string sDomain, string sDevice, string sCommand, string sMode="")
 
int fwFSMConfDB_applyUserRecipe (string recipeName, dyn_string devices="")
 
int fwFSMConfDB_getAllTreeCUs (string fsmTree, dyn_string &CUlist)
 
string fwFSMConfDB_getConfiguratorName (string sDomain)
 
int fwFSMConfDB_addConfigurator (string sDomain, string type="")
 
int fwFSMConfDB_removeConfigurator (string sDomain, string sConfigurator)
 
int fwFSMConfDB_getApplyRecipeUsingConfigurator (string sDomain)
 
int fwFSMConfDB_waitForDevices (string sDomain, string sConfigurator)
 
int fwFSMConfDB_applyAllRecipesFromCache (string sDomain, string sConfigurator, string sMode="")
 
int fwFSMConfDB_applyRecipeFromCache (string sDomain, string sDevice, string sCommand, string sMode="")
 
int fwFSMConfDB_ApplyRecipeFromCache (string sDomain, string sDevice, string sCommand, string sMode="")
 
int fwFSMConfDB_findDeviceNumber (string sDomain, string sDevice)
 
int fwFSMConfDB_requestApplyRecipes (string sDomain, string sDevice, string sCommand, string sMode="")
 
int fwFSMConfDB_getCache (string sDomain, string sDevice, string sCommand, string sMode, string &sCache)
 
void fwFSMConfDB_combineRecipes (dyn_dyn_mixed &dstRecipeObject, dyn_dyn_mixed srcRecipeObject1, dyn_dyn_mixed srcRecipeObject2, dyn_string &exceptionInfo, string mergeMode="")
 

Variables

FSM-ConfDB Interface: Definition of constants

The following constants are used by the FSM - ConfDB Interface

global string fwFSMConfDB_gConfigurationName = "FsmConfDB"
 
global string fwFSMConfDB_gConfigurationDescription = "FSM-ConDB Device Configuration"
 
global string fwFSMConfDB_defaultRecipeMergeMode ="DEVICE"
 
const string g_csErrorState = "ERROR"
 
const string g_csReadyState = "READY"
 
const string g_csNotReadyState = "NOT_READY"
 
const int fwFSMConfDB_OK = 0
 
const int fwFSMConfDB_ERROR = -1
 
const string g_csFSMConfDBDPT = "FwFSMConfDB"
 
const string g_csFwFSMConfDBDelimiter = "/"
 
const string g_csFwFSMConfDBSetup = "FwFSMConfDB"
 
const string g_csModeDelimiter = "|"
 
const string g_csDevicesDPE = ".devices"
 
const string g_csCommandsDPE = ".commands"
 
const string g_csCachesDPE = ".caches"
 
const string g_csRecipesDPE = ".recipes"
 
const string g_csUseConfDBDPE = ".useConfDB"
 
const int g_maxCmdNr = 10
 
const string g_CachePrefix = "FwFSMConfDB"
 
const string g_csSplitAtDpe = "FwFSMConfDBParametrization.splitCachesAt"
 
const string g_csForceUpdate = "FwFSMConfDBParametrization.forceUpdateFromDB"
 
const string g_csStopOnError = "FwFSMConfDBParametrization.stopOnError"
 
const string g_csStopNoRecipes = "FwFSMConfDBParametrization.stopNoRecipes"
 
const string g_csClearCaches = "FwFSMConfDBParametrization.clearCaches"
 
const string g_csDUTypesDPE = ".duTypes"
 
const string g_csConfiguratorDUType = "FwFSMConfDBDUT"
 
const string g_csDelayInterval = "FwFSMConfDBParametrization.delayInterval"
 
const string g_csApplyRecipesTimeout = ".applyRecipes.timeout"
 
const string g_csApplyRecipeUsingConfigurator = ".applyRecipes.usingConfigurator"
 
const string g_csApplyRecipeSimplified = ".applyRecipes.simplifiedAR"
 
const string g_csRecipePattern = ".recipePattern"
 
const string g_csIgnoreDeviceList = ".ignoreDeviceList"
 
FSM-ConfDB Interface: Definition of variables

The following variables are used by the FSM - ConfDB Interface

global string g_sFwDevice_HIERARCHY
 

Detailed Description

This package contains the functions used by the interface between the Finite State Machine and the Configuration DB.

Author
Francisca Calheiros(IT-CO/BE) and Fernando Varela (IT-CO/BE)
Date
29th of July 2008

Function Documentation

int fwFSMConfDB_initialize ( string  sDomain,
string  sConfigurator 
)

Initializes the FSMConfDB configurator. In addition, it also initializes the connection to the Configuration DB and the internal list of devices to be configured in the SMI++ domain. If connection to ConfDB cannot be established, the configurator goes to an ERROR state, otherwise to NOT_READY state.

Parameters
sDomainName of the SMI++ domain
sConfiguratorname of the configurator
Returns
error code: -1 if error, 0 if OK
bool fwFSMConfDB_getUseConfDB ( string  sConfigurator)

Gets the UseConfDB flag

Parameters
sConfiguratorname of the configurator
Returns
TRUE if ConfDB is in use, otherwise FALSE
void fwFSMConfDB_updateDeviceList ( string  sDomain,
string  sConfigurator 
)

Updates the internal list of devices handled by a FSMConfDB configurator

Parameters
sDomainName of the SMI++ domain as a string
sConfiguratorname of the domain configurator
dyn_string fwFSMConfDB_getDomainDevices ( string  sDomain)

Retrives the list of devices to be handle by a FSMConfDB configurator

Parameters
sDomainName of the SMI++ domain as a string
Returns
list of devices in the SMI++ domain
void fwFSMConfDB_getAllDevices ( string  domain,
string  lunit,
dyn_string &  devices,
int  ignore_disabled = 0,
bool  excludeMajority = true 
)

Gets all Device Units in a SMI++ domain recursively

Parameters
domainName of the SMI++ domain as a string
lunitlogical unit
deviceslist of devices as a dyn_string
ignore_disabledoptional flag to indicate whether the disabled devices must be included in the list or not. The default value is 0
bool fwFSMConfDB_isConfigurator ( string  sDevice)

Function to check whether a device is a configurator or not

Parameters
sDevicename of the device to be checked
Returns
TRUE if the device is a configurator otherwise FALSE
string fwFSMConfDB_getDomainConfigurator ( string  sDomain)

Retrieves the name of the configurator object in an SMI++ domain

Parameters
sDomainname of the SMI++ domain
Returns
name of the FSMConfDB configurator
string fwFSMConfDB_removeSystemName ( string  sDpName)

Removes the system name from a dp-name

Parameters
sDpNamename of the dp
Returns
dp-name without the system name
bool fwFSMConfDB_waitForStateChange ( string  sDomain,
string  sConfigurator,
time  timeout 
)

This function connects to the state of the FSMConfDB configurator. Should the state of the configurator is set to READY after the time given by the timeout value the function returns TRUE, otherwise FALSE. This function is intended to be called from the DU in the hierarchy to pause their transitions while the configurator object loads all recipes from the ConfDB.

Parameters
sDomainName of the SMI++ object
sConfiguratorName of the FSMConfDB Configurator
timeouttime interval to wait before the state of the configurator is set to ERROR
Returns
flag indicating if the action has timed out or not.
int fwFSMConfDB_initConfDBConnection ( )

Initializes the connection to the ConfDB for a given setup

Parameters
setupNamename of the setup in the configuration DB
Returns
error code: -1 if error, 0 if OK
dyn_string fwFSMConfDB_getConfiguratorDevices ( string  sConfigurator)

Gets the list of device units to be configured by a FSMConfDB configurator

Parameters
sConfiguratorname of the configurator
Returns
list of devices units
int fwFSMConfDB_cacheExists ( string  sCache)

Checks if a recipe cache exists

Parameters
sCacherecipe cache name
Returns
error code: -1 if it does not exist or 0 if all OK
int fwFSMConfDB_cacheAllRecipesForMode ( string  sDomain,
string  sMode = "" 
)

Synchronizes the contents (i.e. recipes) of the configuration DB and the internal PVSS caches used by the Configuration DB tool, for a given running mode of the experiment. This function also sets up the internal data-points which hold the so-called "Recipe Dictionary". The recipe dictionary is an internal table which holds the cache names for the different devices and recipes in a SMI++ control domain.

Parameters
sDomainname of the SMI++ control domain
sModerunning mode of the experiment to load the recipes for. This is an optional parameter. If left empty, the current running mode of the experiment is resolved by the FWFSMConfDB Interface
Returns
error code: -1 in the event of error, 0 if OK
int fwFSMConfDB_setState ( string  sDevice,
string  sState 
)

Sets the state of the FSMConfDB Configurator

Parameters
sDevicename of the device to set the device to
sStatedesired state
Returns
error code: -1 in the event of error, 0 if OK
int fwFSMConfDB_setCurrentMode ( string  sConfigurator,
string  sMode 
)

Sets the running mode to the FSMConfDB Configurator

Parameters
sConfiguratorname of the FSMConfDB configurator
sModeexperiment's running mode
Returns
error code: -1 in the event of error, 0 if OK
string fwFSMConfDB_getCurrentMode ( string  sConfigurator)

Gets the running mode(PHYSICS,COSMICS,...) to the FSMConfDB Configurator

Parameters
sConfiguratorname of the FSMConfDB configurator
Returns
current running mode
int fwFSMConfDB_applyRecipe ( string  sDomain,
string  sDevice,
string  sCommand,
string  sMode = "" 
)

Applies a recipe cache associated to a FSM command to a device

Parameters
sDomainname of the SMI++ domain
sDevicename of the device to apply the recipe to
sCommandSMI++ command
sModerunning mode. This parameter is optional. If empty, it is current running mode resolved by the function
Returns
error code: -1 in the event of error, 0 otherwise
int fwFSMConfDB_ApplyRecipe ( string  sDomain,
string  sDevice,
string  sCommand,
string  sMode = "" 
)

Applies a recipe cache associated to a FSM command to a device

Parameters
sDomainname of the SMI++ domain
sDevicename of the device to apply the recipe to
sCommandSMI++ command
sModerunning mode. This parameter is optional. If empty, it is current running mode resolved by the function
Returns
error code: -1 in the event of error, 0 otherwise
Deprecated:
use fwFSMConfDB_applyRecipe instead
int fwFSMConfDB_applyUserRecipe ( string  recipeName,
dyn_string  devices = "" 
)

Applies a user recipe cache associated to a device or group of devices

Parameters
sDomainname of the SMI++ domain
deviceslist of devices to apply the recipe to
Returns
error code: -1 in the event of error, 0 otherwise
int fwFSMConfDB_getAllTreeCUs ( string  fsmTree,
dyn_string &  CUlist 
)

Get all CU's belonging to a Tree.

Parameters
fsmTreename of the Tree
CUlistlist of CUs in the tree
string fwFSMConfDB_getConfiguratorName ( string  sDomain)

The function returns the name of the configurator to an SMI++ domain

Parameters
sDomainname of the SMI++ domain
Returns
name of the configurator.
int fwFSMConfDB_addConfigurator ( string  sDomain,
string  type = "" 
)

The function adds a configurator to a SMI++ domain.

Parameters
sDomainname of the SMI++ domain
typeconfigurator DU type
Returns
Error code: 0 if all OK, -1 if error.
int fwFSMConfDB_removeConfigurator ( string  sDomain,
string  sConfigurator 
)

Removes a configurator of an SMI++ domain.

Parameters
sDomainname of the SMI++ domain
sConfiguratorname of the configurator
Returns
Error code: 0 if all OK, -1 if error.
int fwFSMConfDB_getApplyRecipeUsingConfigurator ( string  sDomain)

Gets the flag value that indicates the mode to be used to apply recipes

Parameters
sConfiguratorname of the configurator
Returns
1: configurator applies recipes to all enabled devices in its CU, 2: configurator applies the same recipe to all anabled devices(simplified APPLY_RECIPE) 0: device apply recipe to itself
int fwFSMConfDB_waitForDevices ( string  sDomain,
string  sConfigurator 
)

Waits for the requests of all the enabled devices that are executing an action

Parameters
sDomainname of the SMI++ domain
sConfiguratorname of the configurator
Returns
error code: -1 in the event of error, 0 otherwise
int fwFSMConfDB_applyAllRecipesFromCache ( string  sDomain,
string  sConfigurator,
string  sMode = "" 
)

Fuction used by the configurator to apply the recipes to all enabled devices in a CU

Parameters
sDomainname of the SMI++ domain
sConfiguratorname of the configurator
sModerunning mode. This parameter is optional. If empty, it is current running mode resolved by the function
Returns
error code: -1 in the event of error, 0 otherwise
int fwFSMConfDB_applyRecipeFromCache ( string  sDomain,
string  sDevice,
string  sCommand,
string  sMode = "" 
)

Checks if it's either the configurator or the device to apply the recipe and calls respectively the function fwFSMConfDB_requestApplyRecipes()or fwFSMConfDB_applyRecipe().

Parameters
sDomainname of the SMI++ domain
sDevicename of the device to apply the recipe to
sCommandSMI++ command
sModerunning mode. This parameter is optional. If empty, it is current running mode
Returns
error code: -1 in the event of error, 0 otherwise
int fwFSMConfDB_ApplyRecipeFromCache ( string  sDomain,
string  sDevice,
string  sCommand,
string  sMode = "" 
)

Checks if it's either the configurator or the device to apply the recipe and calls respectively the function fwFSMConfDB_requestApplyRecipes()or fwFSMConfDB_ApplyRecipe().

Parameters
sDomainname of the SMI++ domain
sDevicename of the device to apply the recipe to
sCommandSMI++ command
sModerunning mode. This parameter is optional. If empty, it is current running mode
Returns
error code: -1 in the event of error, 0 otherwise
Deprecated:
use fwFSMConfDB_applyRecipeFromCache instead
int fwFSMConfDB_findDeviceNumber ( string  sDomain,
string  sDevice 
)

Finds the index number of the sDevice in the list of devices handle by a FSMConfDB configurator

Parameters
sDomainName of the SMI++ domain as a string
sDevicename of the SMI++ device
Returns
the index of the device, 0 if device doesn't exist in the list
int fwFSMConfDB_requestApplyRecipes ( string  sDomain,
string  sDevice,
string  sCommand,
string  sMode = "" 
)

Request configurator to apply recipe(populate configurator's variables)if command comes from a parent, otherwise apply recipe to current device

Parameters
sDomainName of the SMI++ domain as a string
sDevicename of the SMI++ device
sCommandSMI++ command
sModerunning mode. This parameter is optional. If empty, it is current running mode resolved by the function
Returns
error code: -1 in the event of error, 0 otherwise
int fwFSMConfDB_getCache ( string  sDomain,
string  sDevice,
string  sCommand,
string  sMode,
string &  sCache 
)

Retrieves the cache name where the configuration information is stored for a given mode and command in a SMI++ domain

Parameters
sDomainname of the SMI++ control domain
sDevicename of the device to be configured
sCommandname of the command associated with the cache
sModerunning mode of the experiment to load the recipes for
sCachename of the cache holding the configuration information
Returns
error code: -1 in the event of error, 0 if OK
void fwFSMConfDB_combineRecipes ( dyn_dyn_mixed &  dstRecipeObject,
dyn_dyn_mixed  srcRecipeObject1,
dyn_dyn_mixed  srcRecipeObject2,
dyn_string &  exceptionInfo,
string  mergeMode = "" 
)

combines two recipe objects This function combines two recipe object into third object. For the entries that exist in both source recipes, the one in the second recipe have precedence, and will be used.

The meta-information is treated in the following way: if there is no meta information yet in the first recipe, the meta information from srcRecipeObject2 is taken; otherwise, if there is already a meta-information in the srcRecipeObject1, it is discarded except the recipe type name - this one will be set in the dstRecipeObject if it is set in both srcRecipeObjects to equal values.

Parameters
dstRecipeObjecton return will contain the combined recipe
srcRecipeObject1first recipe to combine
srcRecipeObject2second recipe to combine
exceptionInfostandard exception handling variable
mergeMode(optional, default="") determines the mode in which the merge is performed; "DEVICE" - the mode is per device "ELEMENT" - the mode is per element "" - take the global setting
See Also
qstart_recipes section of Quick Start

Variable Documentation

const string g_csErrorState = "ERROR"

Name of the ERROR state of the configurator

const string g_csReadyState = "READY"

Name of the READY state of the configurator

const string g_csNotReadyState = "NOT_READY"

Name of the NOT_READY state of the configurator

const int fwFSMConfDB_OK = 0

FSMConfDB return OK

const int fwFSMConfDB_ERROR = -1

general FSMCOnfDB error code

global string g_sFwDevice_HIERARCHY

Name of the FW Hierarchy to be used