Pmg object parameters are very similar to the parameters of the Pma object.
If there are some Pmg object parameters and if the mouse cursor hovers over this Pmg object in the graphics editor then these parameters (including values) are displayed in the status bar of the graphics editor.
The parameter can be read:
Both approaches read parameter the cascade way (bubbling), i.e. if the object (in which the macro is used), does not have this parameter, then this parameter is searched in its parents (in the immersed object) and finally it is searched in the PmgRoot object.
The parameter is mainly used for configuration of Pmg object data binding. In this case the Pmg object (compound or single) can have more data bindings defined using this parameters such way, that the configuration change of parameter value will change the references to items in this data bindings. Another possible usage of the parameter is for text parametrization in PmgString, PmgButton, etc. objects.
The exception are the parameters of the PmgRoot object. These parameters can be modified when the panel is opened (contrary to the parameters in other Pmg objects). Then, after the panel is open, these parameters are static and cannot be modified. The parameter values of panels that are being open can be entered in two ways:
The main purpose of Pmg object parameters is related to creation of Pmg object interface. It is very easy to change the parameter value after copying the Pmg object, so it displays the data, for example, not for "Boiler1" but for "Boiler2". This way the Pmg object parameters make the creation of often used user Pmg objects in the graphics editor much easier.
The resulting displayed text: Temperature in boiler 1
Let´s have following data in the application: "/Boiler1/Data" and "/Boiler2/Data" of the same PmaData type. Both objects contain predefined variable "Temperature. Additional two objects for displaying both temperatures are located in the /PanelBoiler panel. If another object is added in the future, e.g. Boiler3, the new object created just by copying the existing object should display the temperature of the new object.
This way the Pmg object is configured properly. Now it is possible to copy the object and just by changing the parameter value BoilerNum to 2 in this copy, to let the Pmg object display the value of /Boiler2/Data/#vars/Temperature. Any time in the future it is possible to change the object parameter and thus change the target object of the displayed value.
Let´s have following data in the application: "/Boiler1/Data" and "/Boiler2/Data" of the same PmaData type. Both objects contain predefined variable "Temperature. There is the /PanelBoiler panel that displays the temperature of "Boiler1" or of "Boiler2" (according to the open window parameters).
This way the panel is filled in correctly. Now you just have to assure to open the panel always with the correct parameter. For example create another panel that will be used for opening the /PanelBoiler panel. Insert two buttons (PmgButton Pmg objects) into this panel. The first button will open the panel for "Boiler1", the second button will open the same panel but for "Boiler2". Into the event onButtonUp of the first button enter this script:
Into the same event of the second button enter similar script:
Launch the application and open the panel with buttons.
After pressing the first button the window for "Boiler1" is opened.
After pressing the second button the window for "Boiler2" is opened.