Parameters of the PROMOTIC object

The PROMOTIC object parameters are (designer created) constants, that can be created in all PROMOTIC 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 the configurator "PROMOTIC object parameters".

The PROMOTIC object parameters are very similar to the graphic item 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 while the application is launching). Caution! If the parameter value is entered by macro expression, then the reference to PROMOTIC object parameter (Macro expression $.par) will lead to the parameters of the parent, because the parameters of this PROMOTIC object do not exist yet (are being defined).
The PROMOTIC object parameter can be read by the PmObject.GetPar method, but mainly the parameter can be used as Macro expression $.par in the PROMOTIC object configurators. Both approaches read parameter the cascade way (bubbling), i.e. if the PROMOTIC 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 PmRoot object, that is the parent of all PROMOTIC objects.

Caution for prototypes and instances: The PmInstance object can receive only the parameters from the corresponding PmPrototype object, and can enter modified values there. I.e. 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 PmInstance object is therefore special from the parameter searching (bubbling) point of view, because the parameter search is terminated there and does not continue to the PmInstance 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 PmPrototype object (the name can be the same or different) and refer to the parameter of the instance parent either here or in the PmInstance 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 PROMOTIC object and the graphic items:

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

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

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