Promotic
WikipediaLinkedInYoutubeTwitterFacebook

Parameters of the Pma object

The Pma object parameters are (designer created) constants, that can be created in all Pma objects. It is used for application parametrization. It is used especially in the concept of prototypes and instaneces, where different instances of the same prototype can be distinguished. See "Pma object parameters" configurator.

The Pma object parameters are very similar to the Pmg object parameters.

 
The parameter has its name and value:
The parameter name is a system name (no diacritics, no spaces, must start with a letter).
The parameter value can be any text string. Macro expression can be used for input (it is evaluated after starting the application). Caution! If the parameter value is entered by macro expression, then the reference to Pma object parameter (Macro expression $.par) will lead to the parameters of the parent, because the parameters of this Pma object do not exist yet (are being defined).
 
The Pma object parameter can be read by the PmaObject.GetPar method, but mainly the parameter can be used as Macro expression $.par in the Pma object configurators. Both approaches read parameter the cascade way (bubbling), i.e. if the Pma object, that uses the macro/method, does not have this parameter, then this parameter is searched in its parent. This procedure is repeated until the parameter is found. The parameter search procedure (bubbling) ends in the PmaRoot object, that is the parent of all Pma objects.
 

Caution for prototypes and instances: The PmaInstance object can receive only the parameters from the corresponding PmaPrototype object, and can enter modified values there. It means that the instance can modify the existing parameter values of the corresponding prototype. The instance, or the instance parents, cannot add new parameters. Instance (prototyp) can access only the parameters defined in the prototype, but cannot access the parameters of instance parent. This way it is ensured that all instances of the individual prototype has the same set of parameters with different values. The PmaInstance object is therefore special from the parameter searching (bubbling) point of view, because the parameter search is terminated in this object and does not continue to the PmaInstance object parent. This way the instance of the prototype is isolated from other parameters present in the application. If it is necessary to obtain the value of the parameter for the prototype from the instanece parent, then the parameter must be created in the PmaPrototype object (the name can be the same or different) and refer to the parameter of the instance parent either here or in the PmaInstance object. The reference to the parent parameter is done by Macro expression $.par in the parameter value in the instance or prototype.

For example in the prototype, create a new parameter boiler, and link the value to the boiler parameter value of the instance parent: boiler:$.par("boiler");

 
The relation between Pma objects and Pmg objects:

It is important that it is possible to deliver the Pma object parameter into the panel as a Pmg object parameter. The basic principle is that the Pma object parameter cannot get inside the panel autoamtically (the Pmg object cannot directly "see" the parameter defined outside the panel). It is necessary to to create the corresponding parameter in the PmgRoot object and set it to the value of the Pma object parameter when opening the panel. This can be done:

- by sParams parameter of OpenView method or
- by macro expression in the panel in the "sParams default value" configurator.


History:
Pm8.00.06: Created
PROMOTIC 9.0.6 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice