Main Page | File List | File Members | Related Pages

fwFsmConfDB.ctl File Reference


FSM-ConfDB Interface: Definition of constants

The following constants are used by the FSM - ConfDB Interface

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

Functions

int fwFSMConfDB_initialize (string sDomain, string sConfigurator)
int fwFSMConfDB_getFwHierarchy (string sDomain, string &sFwHierarchy)
int fwFSMConfDB_setFwHierarchy (string sDomain, string sFwHierarchy)
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 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_waitForConfiguratorApplyRecipe (string sDomain, string sConfigurator)
void fwFSMConfDB_terminateCurrentCommand (string sDomain, string sDevice)
int fwFSMConfDB_initConfDBConnection ()
dyn_string fwFSMConfDB_getConfiguratorDevices (string sConfigurator)
int fwFSMConfDB_cacheExists (string sCache)
int fwFSMConfDB_cacheAllRecipesForMode (string sDomain, string sMode="")
int fwFSMConfDB_cacheAllRecipes (string sDomain)
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_checkDevicesInRecipe (string sRecipe, dyn_string dsDevices, dyn_string &dsCommonDevices, bool useConfDB=false)
int fwFSMConfDB_getAllTreeCUs (string fsmTree, dyn_string &CUlist)
dyn_string fwFSMConfDB_getAllCUs ()
string fwFSMConfDB_getConfiguratorName (string sDomain)
int fwFSMConfDB_addConfigurator (string sDomain, string type="")
int fwFSMConfDB_changeConfigurator (string sDomain, int applyRecipeMode, int applyRecipeTimeout=20, bool useConfDB=FALSE)
int fwFSMConfDB_removeConfigurator (string sDomain, string sConfigurator)
int fwFSMConfDB_addAllConfigurators ()
string fwFSMConfDB_removeConfiguratorName (string sDpName)
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)

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)
Last update :
29 February 2008

Function Documentation

int fwFSMConfDB_addAllConfigurators  ) 
 

Add a configurator to all SMI++ domains for all trees.

Returns:
Error code: 0 if all OK, -1 if error.

int fwFSMConfDB_addConfigurator string  sDomain,
string  type = ""
 

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

Parameters:
sDomain name of the SMI++ domain
type configurator DU type
Returns:
Error code: 0 if all OK, -1 if error.

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:
sDomain name of the SMI++ domain
sConfigurator name of the configurator
sMode running 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:
sDomain name of the SMI++ domain
sDevice name of the device to apply the recipe to
sCommand SMI++ command
sMode running 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_applyRecipe string  sDomain,
string  sDevice,
string  sCommand,
string  sMode = ""
 

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

Parameters:
sDomain name of the SMI++ domain
sDevice name of the device to apply the recipe to
sCommand SMI++ command
sMode running 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:
sDomain name of the SMI++ domain
sDevice name of the device to apply the recipe to
sCommand SMI++ command
sMode running 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_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:
sDomain name of the SMI++ domain
sDevice name of the device to apply the recipe to
sCommand SMI++ command
sMode running 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_applyUserRecipe string  recipeName,
dyn_string  devices = ""
 

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

Parameters:
sDomain name of the SMI++ domain
devices list of devices to apply the recipe to
Returns:
error code: -1 in the event of error, 0 otherwise

int fwFSMConfDB_cacheAllRecipes string  sDomain  ) 
 

Loads to PVSS caches all existing recipes in the confDB

Parameters:
sDomain name of the SMI++ control domain
Returns:
error code: -1 in the event of error, 0 if 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:
sDomain name of the SMI++ control domain
sMode running 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_cacheExists string  sCache  ) 
 

Checks if a recipe cache exists

Parameters:
sCache recipe cache name
Returns:
error code: -1 if it does not exist or 0 if all OK

int fwFSMConfDB_changeConfigurator string  sDomain,
int  applyRecipeMode,
int  applyRecipeTimeout = 20,
bool  useConfDB = FALSE
 

The function changes the configurator settings.

Parameters:
sDomain name of the SMI++ domain
applyRecipeMode 0:device, 1:configurator, 2:configurator in simplified mode
applyRecipeTimeout  time interval to wait before the state of the configurator is set to ERROR, default is 20 sec.
useConfDBoptional flag to indicate whether to get the Recipe from the DB or Cache. The default value is FALSE.
Returns:
Error code: 0 if all OK, -1 if error.

int fwFSMConfDB_checkDevicesInRecipe string  sRecipe,
dyn_string  dsDevices,
dyn_string &  dsCommonDevices,
bool  useConfDB = false
 

Checks that all devices specified in the second argument are defined in the corresponding recipe

Parameters:
sRecipe name of the recipe
dsDevices list of requested devices
dsCommonDevices sublist of devices from the requested list of devices properly defined in the recipe
useConfDB optional flag to indicate whether to get the Recipe from the DB or Cache. The default value is FALSE.
Returns:
0 if all requested devices are properly defined in the recipe or -1 if there is a mismatch

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:
sDomain Name of the SMI++ domain as a string
sDevice name of the SMI++ device
Returns:
the index of the device, 0 if device doesn't exist in the list

dyn_string fwFSMConfDB_getAllCUs  ) 
 

Get all CU's from all Tree's nodes

Returns:
list of CUs

void fwFSMConfDB_getAllDevices string  domain,
string  lunit,
dyn_string &  devices,
int  ignore_disabled = 0
 

Gets all Device Units in a SMI++ domain recursively

Parameters:
domain Name of the SMI++ domain as a string
lunit logical unit
devices list of devices as a dyn_string
ignore_disabled optional flag to indicate whether the disabled devices must be included in the list or not. The default value is 0

int fwFSMConfDB_getAllTreeCUs string  fsmTree,
dyn_string &  CUlist
 

Get all CU's belonging to a Tree.

Parameters:
fsmTree name of the Tree
CUlist list of CUs in the tree

int fwFSMConfDB_getApplyRecipeUsingConfigurator string  sDomain  ) 
 

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

Parameters:
sConfigurator name 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_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:
sDomain name of the SMI++ control domain
sDevice name of the device to be configured
sCommand name of the command associated with the cache
sMode running mode of the experiment to load the recipes for
sCache name of the cache holding the configuration information
Returns:
error code: -1 in the event of error, 0 if OK

dyn_string fwFSMConfDB_getConfiguratorDevices string  sConfigurator  ) 
 

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

Parameters:
sConfigurator name of the configurator
Returns:
list of devices units

string fwFSMConfDB_getConfiguratorName string  sDomain  ) 
 

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

Parameters:
sDomain name of the SMI++ domain
Returns:
name of the configurator.

string fwFSMConfDB_getCurrentMode string  sConfigurator  ) 
 

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

Parameters:
sConfigurator name of the FSMConfDB configurator
Returns:
current running mode

string fwFSMConfDB_getDomainConfigurator string  sDomain  ) 
 

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

Parameters:
sDomain name of the SMI++ domain
Returns:
name of the FSMConfDB configurator

dyn_string fwFSMConfDB_getDomainDevices string  sDomain  ) 
 

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

Parameters:
sDomain Name of the SMI++ domain as a string
Returns:
list of devices in the SMI++ domain

int fwFSMConfDB_getFwHierarchy string  sDomain,
string &  sFwHierarchy
 

Gets the FW hierarchy in use for the specified control domain

Parameters:
sDomain Name of the SMI++ domain
sFwHierarchy name of the hierarchy
Returns:
Error code: 0 if all OK, -1 if invalid hierarchy name

bool fwFSMConfDB_getUseConfDB string  sConfigurator  ) 
 

Gets the UseConfDB flag

Parameters:
sConfigurator name of the configurator
Returns:
TRUE if ConfDB is in use, otherwise FALSE

int fwFSMConfDB_initConfDBConnection  ) 
 

Initializes the connection to the ConfDB for a given setup

Parameters:
setupName name of the setup in the configuration DB
Returns:
error code: -1 if error, 0 if OK

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:
sDomain Name of the SMI++ domain
sConfigurator name of the configurator
Returns:
error code: -1 if error, 0 if OK

bool fwFSMConfDB_isConfigurator string  sDevice  ) 
 

Function to check whether a device is a configurator or not

Parameters:
sDevice name of the device to be checked
Returns:
TRUE if the device is a configurator otherwise FALSE

int fwFSMConfDB_removeConfigurator string  sDomain,
string  sConfigurator
 

Removes a configurator of an SMI++ domain.

Parameters:
sDomain name of the SMI++ domain
sConfigurator name of the configurator
Returns:
Error code: 0 if all OK, -1 if error.

string fwFSMConfDB_removeConfiguratorName string  sDpName  ) 
 

Removes the configurator name from a dp-name

Parameters:
sDpName name of the dp
Returns:
dp-name without the configurator name

string fwFSMConfDB_removeSystemName string  sDpName  ) 
 

Removes the system name from a dp-name

Parameters:
sDpName name of the dp
Returns:
dp-name without the system name

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:
sDomain Name of the SMI++ domain as a string
sDevice name of the SMI++ device
sCommand SMI++ command
sMode running 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_setCurrentMode string  sConfigurator,
string  sMode
 

Sets the running mode to the FSMConfDB Configurator

Parameters:
sConfigurator name of the FSMConfDB configurator
sMode experiment's running mode
Returns:
error code: -1 in the event of error, 0 if OK

int fwFSMConfDB_setFwHierarchy string  sDomain,
string  sFwHierarchy
 

Sets the FW hierarchy in use for the specified control domain

Parameters:
sDomain Name of the SMI++ domain
sFwHierarchy name of the hierarchy to be set: fwDevice_HARDWARE or fwDevice_LOGICAL
Returns:
Error code: 0 if all OK, -1 if invalid hierarchy name

int fwFSMConfDB_setState string  sDevice,
string  sState
 

Sets the state of the FSMConfDB Configurator

Parameters:
sDevice name of the device to set the device to
sState desired state
Returns:
error code: -1 in the event of error, 0 if OK

void fwFSMConfDB_terminateCurrentCommand string  sDomain,
string  sDevice
 

Terminates the current action for a device in a SMI++ domain

Parameters:
sDomain Name of the SMI++ object
sDevice Name of the device

void fwFSMConfDB_updateDeviceList string  sDomain,
string  sConfigurator
 

Updates the internal list of devices handled by a FSMConfDB configurator

Parameters:
sDomain Name of the SMI++ domain as a string
sConfigurator name of the domain configurator

int fwFSMConfDB_waitForConfiguratorApplyRecipe string  sDomain,
string  sConfigurator
 

This function waits for the configurator to apply the recipes. Is intended to be called from the DU to pause their transitions while the configurator applies all recipes to the devices. Should only be used when the option:Configurator apply recipe is active.

Parameters:
sDomain Name of the SMI++ object
sConfigurator Name of the FSMConfDB Configurator
Returns:
0 if the recipe was applied otherwise -1

int fwFSMConfDB_waitForDevices string  sDomain,
string  sConfigurator
 

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

Parameters:
sDomain name of the SMI++ domain
sConfigurator name of the configurator
Returns:
error code: -1 in the event of error, 0 otherwise

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:
sDomain Name of the SMI++ object
sConfigurator Name of the FSMConfDB Configurator
timeout time interval to wait before the state of the configurator is set to ERROR
Returns:
flag indicating if the action has timed out or not.


Variable Documentation

const int fwFSMConfDB_ERROR = -1
 

general FSMCOnfDB error code

const int fwFSMConfDB_OK = 0
 

FSMConfDB return OK

const string g_csErrorState = "ERROR"
 

Name of the ERROR state of the configurator

const string g_csNotReadyState = "NOT_READY"
 

Name of the NOT_READY state of the configurator

const string g_csReadyState = "READY"
 

Name of the READY state of the configurator

global string g_sFwDevice_HIERARCHY
 

Name of the FW Hierarchy to be used


Generated on Fri Feb 29 12:04:02 2008 for FSM_ConfDB Interface by  doxygen 1.3.9.1