canvasManager



 canvasManager is an administrator of canvases. Main function is opening a canvas.




Methods




Return Type

Method

Description

  canvas

activeCanvas()

Obtain the currently active canvas.

 

close()

Close the currently active canvas.

  canvas

open( filename )

Open canvases. If the canvas already opened, activate it.

  canvas

open( filename, replacePointNames )

When opening a canvas, change the name of points data linked on the canvas.

 

openSessionCanvas( session, filename, str )

When executing multi HMI in a PC, it used to open another HMI from the current one.


waitForClose()

After the canvas opened, wait for it close.


  canvas activeCanvas()

 

  Obtain the currently active canvas.



  Example)

   


       canvasManager_OBJ = canvasManager.activeCanvas();  << Obtain the currently active canvas.


   



  close()

 

  Close the currently active canvas.



  Example)

   


       canvasManager.close();  << Close the currently active canvas.


   


 The following is the result of the closing canvas using the script close.


                               



  canvas open( name: Canvas name )

 

  It is used to open the canvas. If it is already opened, activate it.


         Enter the name of canvas including '.pws' to name.

                1) If the canvas is in the project folder : Enter the file name.

                2) If the canvas is not in the project folder : Enter the entire path.                  


         Using a canvas object, the user can use canvas methods.



  Example)

   


       canvas_OBJ = canvasManager.open('MainCanvas.pws');  << Open that canvas


       canvas_OBJ = canvasManager.open('C:/Project/MainCanvas.pws');  << Open the canvas including entire path.

   



 The following is the result of the opening canvas using the script open.


                               



  canvas open( name:Canvas name, replacePointNames:A list of the user name and real name )

 

  When opening a canvas, change the name of points data linked on the canvas


         Enter the name of canvas including '.pws' to name.

                1) If the canvas is in the project folder : Enter the file name.

                2) If the canvas is not in the project folder : Enter the entire path.

 

         A list of existing names and new names enter on replacePointNames.

                - Enter type : 'Existing name : new name'

                        Example)  When changing $1 and $2 to $A and $B respectively : ['$1:$A', '$2:$B']



  Example)

   


       data = list();  << Declare the variable data as a form of a list.


       data.append('$1:$A');  << Change $1 to $A

       data.append('$2:$B');  << Change $2 to $B


       canvasManager_OBJ = canvasManager.open('DC.pws', data);  << When opening DC.pws, change $1 and $2 to $A and $B respectively.


   


 Set a data link for the user-defined point on a canvas, then change to real point name.


 1) Set a data link for $1.$2 on DC.pws.


                               


 2) When opening DC.pws, change $1,$2 to $A and $B respectively by writing scripts.

 

                               



  openSessionCanvas( session:HMI number, filename:Canvas name )

 

  When executing multi HMI on a PC, open another HMI from the current one.


         session is the HMI number.

         The following is the HMI number registration.

                1) Make the shortcut icon of the PowerScene program.

                2) Click the property of the shortcut icon and move to the shortcut tab.

                3) Add '-s HM number' on the end of PowerScene.exe in the shortcut tab.



  Example)

   


       canvasManager.openSessionCanvas(1, ‘MainCanvas.pws’);  << Open 'MainCanvas.pws' on the first HMI


   


 Make the shortcut icon of PowerScene.


                               


 The following is an example of entering the HMI number.


                               


 The following is an example of executing the HMI program and the HMI to be modified.


                               


 The following is the window which modifies the HMI window.


                               



  waitForClose()

 

  After the canvas opened, and wait for it closed. waitForClose is used to process follow-up tasks.

  For example, it opens the pop-up when adding a schedule, enters the schedule information, waits for the closing pop-up, brings the entered schedule, and saves it.



  Example)

   


       canvasManager_OBJ = canvasManager.open('Screen.pws')  << Open the canvas inside the project folder.


       canvasManager_OBJ.waitForClse()  << Wait for the canvas closed.


       schdule_Name = canvasManager_OBJ.getObject('schName')  << Obtain the schedule before the canvas closed.


       print schdule_Name.getText()