unDistributedControl  8.4.0
unDistributedControl.ctl File Reference

LIBRARY: unDistributedControl.ctl

const string c_unDistributedControl_dpType = "_UnDistributedControl"
 
const string c_unDistributedControl_dpName = "_unDistributedControl_"
 
const string c_unDistributedControl_dpElementName =".connected"
 
const string c_unDistributedControl_dpConfigElementName =".config"
 
const string c_unDistributedControl_separator =";"
 
const string UNDISTRIBUTEDCONTROL_DEFAULT_DIST_PORT = "4777"
 
const int UN_DISTRIBUTED_CONTROL_SYSTEM_NAME = 1
 
const int UN_DISTRIBUTED_CONTROL_SYSTEM_NUMBER = 2
 
const int UN_DISTRIBUTED_CONTROL_SYSTEM_HOST = 3
 
const int UN_DISTRIBUTED_CONTROL_SYSTEM_PORT = 4
 
const int UN_DISTRIBUTED_CONTROL_SYSTEM_REDU_HOST = 5
 
void unDistributedControl_addSystem (dyn_mixed systemInfo, dyn_string &exception)
 
 unDistributedControl_addToConfigFile (dyn_string &exceptionInfo)
 
bool unDistributedControl_systemDpExists (int systemNumber, string host, int port, string reduHost, bool &infoMatches, dyn_string &exception)
 
bool unDistributedControl_isSystemInFile (int systemNumber, string host, int port, string reduHost, bool &infoMatches, dyn_string &exception)
 
void unDistributedControl_getAllDeviceConfigFromFile (dyn_int &diFileSystemId, dyn_string &dsFileHostName, dyn_int &diFilePortNumber, dyn_string &dsFileReduHostName, dyn_string &exception)
 
 unDistributedControl_register (string sAdviseFunction, bool &bRes, bool &bConnected, string sSystemName, dyn_string &exceptionInfo)
 
 unDistributedControl_deregister (string sAdviseFunction, bool &bRes, bool &bConnected, string sSystemName, dyn_string &exceptionInfo)
 
 unDistributedControl_isRemote (bool &isRemoteSystem, string sSystemName)
 
 unDistributedControl_isConnected (bool &isConnected, string sSystemName)
 
 unDistributedControl_getAllDeviceConfig (dyn_string &dsSystemName, dyn_int &diSystemId, dyn_string &dsHostName, dyn_int &diPortNumber)
 
 unDistributedControl_setDeviceConfig (string sSystemName, int iSystemId, string sHostName, int iPortNumber, dyn_string &exceptionInfo)
 
 unDistributedControl_checkCreateDp (string sDpName, dyn_string &exceptionInfo)
 
 unDistributedControl_checkSetAlias (string sDpName, string systemName, dyn_string &exceptionInfo)
 
 unDistributedControl_convertHostPort (string &sHostName, string &sPortNumber)
 
string unDistributedControl_getDSHostname ()
 
 unDistributedControl_saveInConfigFile (dyn_string &exceptionInfo)
 

Detailed Description

This library contains functions for the unDistributedControl component. The DistributedControl component checks if the remote PVSS systems defined in the config file are connected or not. The result of this check can be used to set the graphical characteristics of a component, send a message to the operator, send email, send an SMS, etc.

Author
: Herve Milcent (LHC-IAS)

Creation Date: 31/04/2002

Function Documentation

unDistributedControl_register ( string  sAdviseFunction,
bool &  bRes,
bool &  bConnected,
string  sSystemName,
dyn_string &  exceptionInfo 
)

Purpose: to register a call back function to the unDistributedControl component. This function does a dpConnect of the sAdviseFunction call back function to the _unDistributedControl_xxx (xxx = system name of the remote PVSS system).

In case of error, bResult is set to false and an exception is raised in exceptionInfo.

The call back function must be like: CBFunc(string sDp, bool bConnected) { } bConnected: true (the remote system is connected and synchronised)/false (the remote system is not connected)

it is recommended to do nothing if the bConnected is true. it is better to have another dpConnect function to other data. When a remote system is reconnected, any callback function to dp of the remot system will be called after the initialisation of the remote connection. Therefore the CBFunc will be called first and then any other call back function for the remote dp.

@param sAdviseFunction: string, input, the name of the call back function
@param bRes: bool, output, the result of the register call
@param bConnected: bool, output, is the remote system connected
@param sSystemName: string, input, the name of remote PVSS system
@param exceptionInfo: dyn_string, output, Details of any exceptions are returned here

Usage: Public

PVSS manager usage: CTRL (WCCOACTRL), UI

Constraints: . constant: . c_unDistributedControl_dpElementName: the data point element of the _unDistributedControl . data point type needed: _UnDistributedControl . data point: an instance of _UnDistributedControl: _unDistributedControl_xxx where xxx = system name . PVSS version: 3.0 . operating system: Linux, NT and W2000, but tested only under W2000. . distributed system: yes.

unDistributedControl_deregister ( string  sAdviseFunction,
bool &  bRes,
bool &  bConnected,
string  sSystemName,
dyn_string &  exceptionInfo 
)

Purpose: to deregister a call back function to the unDistributedControl component. This function does a dpDisconnect of the sAdviseFunction call back function to the _unDistributedControl_xxx (xxx = system name of the remote PVSS system).

@param sAdviseFunction: string, input, the name of the call back function
@param bRes: bool, output, the result of the register call
@param bConnected: bool, output, is the remote system connected
@param sSystemName: string, input, the name of remote PVSS system
@param exceptionInfo: dyn_string, output, Details of any exceptions are returned here

Usage: Public

PVSS manager usage: CTRL (WCCOACTRL), UI

Constraints: . constant: . c_unDistributedControl_dpElementName: the data point element of the _unDistributedControl . data point type needed: _UnDistributedControl . data point: an instance of _UnDistributedControl: _unDistributedControl_xxx where xxx = system name . PVSS version: 3.0 . operating system: Linux, NT and W2000, but tested only under W2000. . distributed system: yes.

unDistributedControl_isRemote ( bool &  isRemoteSystem,
string  sSystemName 
)

Purpose: To check if a given PVSS system name is a remote system This function returns true if the sSystemName is the local PVSS system, i.e.: if it is the system name (getSystemName()) of the caller of this function. Otherwise it returns false.

@param isRemoteSystem: bool, output, is the PVSS system a remote system
@param sSystemName: string, input, the name of remote PVSS system

Usage: Public

PVSS manager usage: CTRL (WCCOACTRL), UI

Constraints: . PVSS version: 3.0 . operating system: Linux, NT and W2000, but tested only under W2000. . distributed system: yes.

unDistributedControl_isConnected ( bool &  isConnected,
string  sSystemName 
)

Purpose: to check if the PVSS system is connected. If the sSystemName is the local system (getSystemName()) is Connected is true.

@param isConnected: bool, output, is the PVSS system connected
@param sSystemName: string, input, the name of remote PVSS system

Usage: Public

PVSS manager usage: CTRL (WCCOACTRL), UI

Constraints: . PVSS version: 3.0 . operating system: Linux, NT and W2000, but tested only under W2000. . distributed system: yes.

unDistributedControl_getAllDeviceConfig ( dyn_string &  dsSystemName,
dyn_int &  diSystemId,
dyn_string &  dsHostName,
dyn_int &  diPortNumber 
)

Purpose: get the config of all the declared _UnDistribtuedControl. empty field or 0 means default value.

@param dsSystemName: dyn_string, output, list of all the PVSS systemName of the declared _UnDistribtuedControl
@param diSystemId: dyn_int, output, list of all the PVSS system ID of the declared _UnDistribtuedControl
@param dsHostName: dyn_string, output, list of all the hostname of the declared _UnDistribtuedControl
@param diPortNumber: dyn_int, output, list of all the port number of the WCCILdist of the declared _UnDistribtuedControl

Usage: Public

PVSS manager usage: CTRL (WCCOACTRL), UI

Constraints: . PVSS version: 3.0 . operating system: Linux, NT and W2000, but tested only under W2000. . distributed system: yes.

unDistributedControl_setDeviceConfig ( string  sSystemName,
int  iSystemId,
string  sHostName,
int  iPortNumber,
dyn_string &  exceptionInfo 
)

Purpose: set the config of all the _UnDistribtuedControl_systemName. empty field or 0 means default value.

@param sSystemName: string, input, the PVSS systemName with or without : of the declared _UnDistribtuedControl
@param iSystemId: int, input, the PVSS system ID of the declared _UnDistribtuedControl
@param sHostName: string, input, the hostname of the declared _UnDistribtuedControl
@param iPortNumber: int, input, the port number of the WCCILdist of the declared _UnDistribtuedControl
@param exceptionInfo: dyn_string, output, the error is returned here

Usage: Public

PVSS manager usage: CTRL (WCCOACTRL), UI

Constraints: . PVSS version: 3.0 . operating system: Linux, NT and W2000, but tested only under W2000. . distributed system: yes.

unDistributedControl_checkCreateDp ( string  sDpName,
dyn_string &  exceptionInfo 
)

Purpose: This function checks if the dp _unDistributedControl_XXX_n: of type _UnDistributedControl exists, if not it creates it.

@param sDpName: string, input, the data point name
@param exceptionInfo: dyn_string, output, Details of any exceptions are returned here

Usage: Public

PVSS manager usage: CTRL (WCCOACTRL)

Constraints: . constant: . c_unDistributedControl_dpType: the DistributedControl component data point type . data point type needed: _UnDistributedControl . PVSS version: 3.0 . operating system: W2000, NT and Linux, but tested only under W2000 and Linux. . distributed system: yes.

unDistributedControl_convertHostPort ( string &  sHostName,
string &  sPortNumber 
)
convert the hostname and port number to be copatible with the centrally managed installation tool
Constraints
None
Usage
Public
PVSS managers
Ui, CTRL
Parameters
sHostNameoutput, the hostname
sPortNumberoutput, the port number
string unDistributedControl_getDSHostname ( )
get the hostname of the data server
Constraints
None
Usage
Public
PVSS managers
Ui, CTRL
Returns
the hostname of the data server
unDistributedControl_saveInConfigFile ( dyn_string &  exceptionInfo)
save the dist config in the config file
Constraints
None
Usage
Public
PVSS managers
Ui, CTRL
Parameters
exceptionInfooutput, error are returned here