Starter Tango Class User‘s Guide

|  |  |  |  |  |  |

## Starter Tango Cpp Class

Contents :

- Description
- Properties
- Commands
  - State
  - Status
  - DevStart
  - DevStop
  - DevStartAll
  - DevStopAll
  - DevGetRunningServers
  - DevGetStopServers
  - DevReadLog
  - HardKillServer
  - NotifyDaemonState
  - ResetStatistics
  - UpdateServersInfo
- Attributes
  - NotifdState
  - HostState
  - RunningServers
  - StoppedServers
  - Servers
- States

Starter Class Identification : | Starter Class Inheritance :
Contact | : at esrf.fr - verdier
Class Family | : System
Platform | : All Platforms
Bus | : Not Applicable
Manufacturer | : none
Manufacturer ref. | :
| Tango::DeviceImpl Starter

Starter Class Description :

This device server is able to control Tango components (database, device servers, clients...).
It is able to start or stop and to report the status of these components.
This device server is able to control Tango device servers.
It is able to start or stop and to report the status of these components.
It gets a list of processes (device servers) from database to start/stop/control on the host .
To change the type of control by Starter for a server, use the tango administrator Astor .
WARNING :
- To be recognized by Astor the starter device must have a specific name.
  This name must be tango/admin/{hostname} (e.g. tango/admin/hal).

  The Starter device server ping the controlled servers during the State polled command.
  In case of answer or not, the host state is calculated, and could be read and displayed by Astor.

Starter Properties :

Class Properties
Name | Description | Type | Default Value
AutoRestartDuration | If this property is greater than 0, if a server has been running more than the specified value (in minutes), and has failed, it will be restart automatically. | int | 0
LogFileHome | The home directory to log servers traces. For Linux the default value is /var/tmp For Win32 it is c:\temp | String | none
NbStartupLevels | Number of startup levels managed by starter. | short | 5
ReadInfoDbPeriod | Period to read database for new info if not fired from Database server. | short | none
ServerStartupTimeout | Timeout on device server startup in seconds. | int | 1
StartServersAtStartup | Skip starting servers at startup if false. It a way to do not have a big re-start of many servers after a power cut. | boolean | true
UseEvents | Use events if not null. | short | 0

Device Properties
Name | Description | Type | Default Value
AutoRestartDuration | If this property is greater than 0, if a server has been running more than the specified value (in minutes), and has failed, it will be restart automatically. | int | 0
InterStartupLevelWait | Time to wait before two startup levels in seconds. | int | 1
KeepLogFiles | Number of log file kept. | int | 3
LogFileHome | The home directory to log servers traces. For Linux the default value is /var/tmp For Win32 it is c:\temp | String | none
ServerStartupTimeout | Timeout on device server startup in seconds. | int | 5
StartDsPath | Path to find executable files to start device servers | String[] | none
StartServersAtStartup | Skip starting servers at startup if false. | boolean | true
UseEvents | Use events if not null. | short | 0
WaitForDriverStartup | The Starter will wait a bit before starting servers, to be sure than the drivers are started.This time is in seconds. | short | 0

Starter Class Commands
Name | Input type | Output type | Level | Description
State | DEV_VOID | DEV_STATE | OPERATOR | This command gets the device state (stored in its device_state data member) and returns it to the caller.
Status | DEV_VOID | CONST_DEV_STRING | OPERATOR | This command gets the device status (stored in its device_status data member) and returns it to the caller.
DevStart | DEV_STRING | DEV_VOID | OPERATOR | Start the specified server.
DevStop | DEV_STRING | DEV_VOID | OPERATOR | Stop the specified server.
DevStartAll | DEV_SHORT | DEV_VOID | OPERATOR | Start all device servers controlled on the host for the argin level.
DevStopAll | DEV_SHORT | DEV_VOID | OPERATOR | Stop all device servers controlled on the host for the argin level.
DevGetRunningServers | DEV_BOOLEAN | DEVVAR_STRINGARRAY | OPERATOR | Control the running process from property list. And return the list of the processes which are really running.
DevGetStopServers | DEV_BOOLEAN | DEVVAR_STRINGARRAY | OPERATOR | Control the running process from property list. And return the list of the processes which are not running.
DevReadLog | DEV_STRING | CONST_DEV_STRING | OPERATOR | At server startup, its standard error is redirected to a log file. This command will read this file and return the read string from the file.
HardKillServer | DEV_STRING | DEV_VOID | OPERATOR | Hard kill a server (kill -9)
NotifyDaemonState | DEV_VOID | DEV_STATE | OPERATOR | Returns the Notify Daemon state.
ResetStatistics | DEV_VOID | DEV_VOID | EXPERT | Reset statistics file.
UpdateServersInfo | DEV_VOID | DEV_VOID | OPERATOR | Indicate to the device server than the information about servers to be controlled has been modified. The device server must read the database to update the servers info list. If the default case, this command is sent by Database server itself.

Command State :

This command gets the device state (stored in its device_state data member) and returns it to the caller.

State Definition
Input Argument | Tango::DEV_VOID | none.
Output Argument | Tango::DEV_STATE | State Code
DisplayLevel | OPERATOR | ..
Inherited | true | ..
Abstract | false | ..
Polling Period | 1000 | ..
Command allowed for | All states | ..

Command Status :

This command gets the device status (stored in its device_status data member) and returns it to the caller.

Status Definition
Input Argument | Tango::DEV_VOID | none.
Output Argument | Tango::CONST_DEV_STRING | Status description
DisplayLevel | OPERATOR | ..
Inherited | true | ..
Abstract | true | ..
Polling Period | Not polled | ..
Command allowed for | All states | ..

Command DevStart :

Start the specified server.

DevStart Definition
Input Argument | Tango::DEV_STRING | Server to be started.
Output Argument | Tango::DEV_VOID |
DisplayLevel | OPERATOR | ..
Inherited | false | ..
Abstract | false | ..
Polling Period | Not polled | ..
Command allowed for | All states | ..

Command DevStop :

Stop the specified server.

DevStop Definition
Input Argument | Tango::DEV_STRING | Servero be stopped.
Output Argument | Tango::DEV_VOID |
DisplayLevel | OPERATOR | ..
Inherited | false | ..
Abstract | false | ..
Polling Period | Not polled | ..
Command allowed for | All states | ..

Command DevStartAll :

Start all device servers controlled on the host for the argin level.

DevStartAll Definition
Input Argument | Tango::DEV_SHORT | Startup level.
Output Argument | Tango::DEV_VOID |
DisplayLevel | OPERATOR | ..
Inherited | false | ..
Abstract | false | ..
Polling Period | Not polled | ..
Command allowed for | All states | ..

Command DevStopAll :

Stop all device servers controlled on the host for the argin level.

DevStopAll Definition
Input Argument | Tango::DEV_SHORT | Startup Level.
Output Argument | Tango::DEV_VOID |
DisplayLevel | OPERATOR | ..
Inherited | false | ..
Abstract | false | ..
Polling Period | Not polled | ..
Command allowed for | All states | ..

Command DevGetRunningServers :

Control the running process from property list.
And return the list of the processes which are really running.

DevGetRunningServers Definition
Input Argument | Tango::DEV_BOOLEAN | True for all servers. False for controlled servers only.
Output Argument | Tango::DEVVAR_STRINGARRAY | List of the processes which are running.
DisplayLevel | OPERATOR | ..
Inherited | false | ..
Abstract | false | ..
Polling Period | Not polled | ..
Command allowed for | All states | ..

Command DevGetStopServers :

Control the running process from property list.
And return the list of the processes which are not running.

DevGetStopServers Definition
Input Argument | Tango::DEV_BOOLEAN | True for all servers. False for controlled servers only.
Output Argument | Tango::DEVVAR_STRINGARRAY | List of the processes which are not running.
DisplayLevel | OPERATOR | ..
Inherited | false | ..
Abstract | false | ..
Polling Period | Not polled | ..
Command allowed for | All states | ..

Command DevReadLog :

At server startup, its standard error is redirected to a log file.
This command will read this file and return the read string from the file.

DevReadLog Definition
Input Argument | Tango::DEV_STRING | server name and domain (e.g. Starter/corvus) If argin ==``Starter`` -> return Starter logg file content. If argin ==``Statistics`` -> return Starter statistics file content.
Output Argument | Tango::CONST_DEV_STRING | String found in log file.
DisplayLevel | OPERATOR | ..
Inherited | false | ..
Abstract | false | ..
Polling Period | Not polled | ..
Command allowed for | All states | ..

Command HardKillServer :

Hard kill a server (kill -9)

HardKillServer Definition
Input Argument | Tango::DEV_STRING | Server name
Output Argument | Tango::DEV_VOID |
DisplayLevel | OPERATOR | ..
Inherited | false | ..
Abstract | false | ..
Polling Period | Not polled | ..
Command allowed for | All states | ..

Command NotifyDaemonState :

Returns the Notify Daemon state.

NotifyDaemonState Definition
Input Argument | Tango::DEV_VOID |
Output Argument | Tango::DEV_STATE | Tango::ON if Notify daemon is running else Tango::FAULT.
DisplayLevel | OPERATOR | ..
Inherited | false | ..
Abstract | false | ..
Polling Period | Not polled | ..
Command allowed for | All states | ..

Command ResetStatistics :

Reset statistics file.

ResetStatistics Definition
Input Argument | Tango::DEV_VOID |
Output Argument | Tango::DEV_VOID |
DisplayLevel | EXPERT | ..
Inherited | false | ..
Abstract | false | ..
Polling Period | Not polled | ..
Command allowed for | All states | ..

Command UpdateServersInfo :

Indicate to the device server than the information about servers to be controlled has been modified.
The device server must read the database to update the servers info list.
If the default case, this command is sent by Database server itself.

UpdateServersInfo Definition
Input Argument | Tango::DEV_VOID |
Output Argument | Tango::DEV_VOID |
DisplayLevel | OPERATOR | ..
Inherited | false | ..
Abstract | false | ..
Polling Period | Not polled | ..
Command allowed for | All states | ..

Starter Class Attributes
Name | Inherited | Abstract | Attr. type | R/W type | Data type | Level | Description
NotifdState | false | false | Scalar | READ | Tango::DEV_STATE | OPERATOR | return ON or FAULT if notify daemon is running or not.
HostState | false | false | Scalar | READ | Tango::DEV_SHORT | OPERATOR |
RunningServers | false | false | Spectrum | READ | Tango::DEV_STRING | OPERATOR |
StoppedServers | false | false | Spectrum | READ | Tango::DEV_STRING | OPERATOR | Return all the Stopped servers.\n
Servers | false | false | Spectrum | READ | Tango::DEV_STRING | OPERATOR | Return all registered servers for this host.\nServer names are followed by their states and controls

There is no dynamic attribute defined.

Attribute NotifdState :

return ON or FAULT if notify daemon is running or not.

Attribute Definition
Attribute Type | Scalar
R/W Type | READ
Data Type | Tango::DEV_STATE
Display Level | OPERATOR
Inherited | false
Abstract | false
Polling Period | 1000
Memorized | Not set
Read allowed for | All states
Attribute Properties
label | Notifd State
unit |
standard unit |
display unit |
format |
max_value |
min_value |
max_alarm |
min_alarm |
max_warning |
min_warning |
delta_time |
delta_val |
Attribute Event Criteria
Periodic | Not set
Relative Change | Not set
Absolute Change | Not set
Archive Periodic | Not set
Archive Relative Change | Not set
Archive Absolute Change | Not set
Push Change event by user code | false
Push Archive event by user code | false
Push DataReady event by user code | Not set

Attribute HostState :

Attribute Definition
Attribute Type | Scalar
R/W Type | READ
Data Type | Tango::DEV_SHORT
Display Level | OPERATOR
Inherited | false
Abstract | false
Polling Period | 1000
Memorized | Not set
Read allowed for | All states
Attribute Properties
label |
unit |
standard unit |
display unit |
format |
max_value |
min_value |
max_alarm |
min_alarm |
max_warning |
min_warning |
delta_time |
delta_val |
Attribute Event Criteria
Periodic | Not set
Relative Change | Not set
Absolute Change | Not set
Archive Periodic | Not set
Archive Relative Change | Not set
Archive Absolute Change | Not set
Push Change event by user code | false
Push Archive event by user code | false
Push DataReady event by user code | false

Attribute RunningServers :

Attribute Definition
Attribute Type | Spectrum ( 200 )
R/W Type | READ
Data Type | Tango::DEV_STRING
Display Level | OPERATOR
Inherited | false
Abstract | false
Polling Period | 1000
Memorized | Not set
Read allowed for | All states
Attribute Properties
label |
unit |
standard unit |
display unit |
format |
max_value |
min_value |
max_alarm |
min_alarm |
max_warning |
min_warning |
delta_time |
delta_val |
Attribute Event Criteria
Periodic | Not set
Relative Change | Not set
Absolute Change | Not set
Archive Periodic | Not set
Archive Relative Change | Not set
Archive Absolute Change | Not set
Push Change event by user code | false
Push Archive event by user code | false
Push DataReady event by user code | Not set

Attribute StoppedServers :

Return all the Stopped servers.\n

Attribute Definition
Attribute Type | Spectrum ( 200 )
R/W Type | READ
Data Type | Tango::DEV_STRING
Display Level | OPERATOR
Inherited | false
Abstract | false
Polling Period | 1000
Memorized | Not set
Read allowed for | All states
Attribute Properties
label | All Stopped Servers
unit |
standard unit |
display unit |
format |
max_value |
min_value |
max_alarm |
min_alarm |
max_warning |
min_warning |
delta_time |
delta_val |
Attribute Event Criteria
Periodic | Not set
Relative Change | Not set
Absolute Change | Not set
Archive Periodic | Not set
Archive Relative Change | Not set
Archive Absolute Change | Not set
Push Change event by user code | false
Push Archive event by user code | false
Push DataReady event by user code | Not set

Attribute Servers :

Return all registered servers for this host.\nServer names are followed by their states and controls

Attribute Definition
Attribute Type | Spectrum ( 1024 )
R/W Type | READ
Data Type | Tango::DEV_STRING
Display Level | OPERATOR
Inherited | false
Abstract | false
Polling Period | 1000
Memorized | Not set
Read allowed for | All states
Attribute Properties
label | Servers
unit |
standard unit |
display unit |
format |
max_value |
min_value |
max_alarm |
min_alarm |
max_warning |
min_warning |
delta_time |
delta_val |
Attribute Event Criteria
Periodic | Not set
Relative Change | Not set
Absolute Change | Not set
Archive Periodic | Not set
Archive Relative Change | Not set
Archive Absolute Change | Not set
Push Change event by user code | false
Push Archive event by user code | false
Push DataReady event by user code | Not set

Starter Class States
Name | Description
UNKNOWN | This device server has NOT been correctly initialised.
ON | All controlled servers are running.
ALARM | At least one controlled device server is not running.
MOVING | The Sarter is starting servers.