Open viewer

In the previous steps, you have creted a new panel. In this chapter you will see several examples of opening such panel.

Selection from a list:

Press the "Panels" icon in the toolbar in the running application in order to open the window with the list of application panels included into this list.

In this case mark the window "Panel of Boiler no. 1" and press the "OK" button.

Button in the panel:

Second way of opening the panel "Panel" could be by the control button placed in the panel that is opened after starting the application.

Open the panel named "MainPanel" in the graphics editor. Insert the Preconfiguration "single state - only text" object anywhere in it from the One-state button group.

Then its configuration window opens.
- Enter the description of the button, for example, "Boiler1" into the "Text" configurator.
- In the "Action" configurator select "Open panel - in the main frame (target:main;)" from a list.

- Then in the "Path to panel" configurator set the path to panel "Panel" – Relative path to: MainPanel and confirm by the "OK" button. Then place the button into the panel.

Image as button:

The third way of opening the "Panel" window can be done by clicking the mouse over any image located in the panel.

Open the window named "MainPanel" in the graphics editor. Insert the HeatOven02.svg object anywhere in it from the Image group.

By clicking this object, its configuration window opens.

Select the "Events" tab. Then select the onMousePress event.
Open the menu by the right mouse button clicking and select Script wizard.

- In there, select "Condition - If" and then in the "Condition" configurator enter: pEvent.Action == 0

- Then move the cursor between the braces.
- Then select "CreateView method" and then in the "Pma object - path" configuration window set the path to Pma object "Panel" - Relative path to: MainPanel and confirm by the "Insert to cursor position" button.

The Script wizard will create the following:

JavaScriptSelect and copy to clipboard

if (pEvent.Action == 1)
var oCreator = Pm.CreateView(null, "../BoilerPlant/Boiler/Panel", "", "target:main;");
This way you call the Pm.CreateView method over the "Panel" object. This method opens the viewer of the "Panel" object. The content is now displayed in the same window as the content of the MainPanel object.

Confirm all by the "OK" button and save. After starting the application, new button with the description "Boiler1" appears in the panel. By clicking the boiler image or click and release this button, the window "Panel of Boiler no. 1" opens.

Open the panel after starting the application

Now we can do one handy setting, that will instruct the application to open your panel after starting the application. Path to default panel is defined in the "Viewer of component" configurator of the "main" frame in object "Workspace" in the tree of Pma objects, on the "Frames" tab.

PROMOTIC 9.0.22 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.