Parameters
At the beginning SMI had only Objects, States and Actions. As the SMI project developed it has become obvious, that it would be useful to pass values around. An example would be Run Number distributed by master object to all its slaves etc. And so parameters were born. At present one comes across them in two distinct categories. Places where they are declared and places where they are used:
Parameter Declaration
There are two kinds of parameters: Object Parameters which are declated as part of Object Declaration and Action Parameters which are declared as part of Action declaration.
Object Declaration
Just after the Object Declaration, there can follow Parameter Declaration that define parameters associated with that object:
Object : object-name
Parameters : pd1 [,pd2, ... ,pdn]
where
- pdi
- is parameter declarator of the form: [type] name [=default-value]
- type
- is type definition and is either STRING or INT or FLOAT. If not present then it is assumed the type is STRING
- name
- is the name of the parameter
- default-value
- is the default value of the parameter and has to be a constant of the correct type. If the type is STRING, the value has to be enclosed in double quotes
where
Action Declaration
Action can have parameters associated with it declared as follows:
Action : action-name ( pd1 [,pd2, ... ,pdn] )
where pdi has the same meaning as above. When default value is not given, then when the action is invoked from a GUI, GUI will prompt user for the value. When action is received as a command from other object, then State Manager expects the value to be supplied.
Parameter Use
CREATE_OBJECT instruction
create_object $(action-parameter-name) of_class class-name
where action-parameter-name is a name of one of the action parameters declared in the current action.
INSERT, REMOVE instruction
insert $(action-parameter-name) in set-name
remove $(action-parameter-name) from set-name
where action-parameter-name is a name of one of the action parameters declared in the current action.
DO instruction
do action-name(pd1 [,pd2, ... ,pdn]) target-object-spec
where
- pdi
- has a format pnmi = indiVali
where
- pnmi
- is a name of one of the parameters declared in the action action-name
of the target object
and - indiVali
- is a reference to the actual value to be transmitted. Described in detail in indiValue
CALL instruction
CALL function-name(pd1 [,pd2, ... ,pdn])
where
- function-name
- is a name of one of the functions declared in the current object
- pdi
- has the same format as that for DO instruction, but pnmi is a name of one of the parameters declared in the function declaration
REPORT instruction
report (severity,msg)
where
- severity
- is one of : INFO, WARNING, ERROR, FATAL
- msg
- is the message to be sent and has form: indiVal1+indiVal2+...+indiValn
SET instruction
set object-parameter-name = indiVal1
set object-parameter-name = indiVal1 arithmetic-operator indiVal2
where
- object-parameter-name
- is the name of one of the declared parameters of the current object
- indiVal1(2)
- are Indirect Values. See indiValue
Simple Condition Type 4
( indiVal1 arithmetic-operator indiVal2)
where indival1(2) are Indirect Values. See indiValue
Predefined Reserved Keywords
They are used for special values of parameters and operands. At this time there are only 4:
_DOMAIN_ _OBJECT_ _STATE_ _ACTION_