canvas



  canvas represents a canvas. canvas object provides canvas methods. Main functions are obtaining graphic items, executing timer, executing animations, maximizing / minimizing canvases.




Methods




Return Type

Method

Description


clearMark( shape )

Release the setMark of that object(shape).


closeCanvas()

Script closes the running canvas.


closeMe()

Close the currently active canvas.


connectValueChange( func, pointNames )

포인트값 변경시 수신되는 이벤트 핸들러를 등록합니다.

  PowerShape

createObject( objType, layerName )

Create a graphic object and add it to a specified layer.

  str

fileName()

Obtain the file path of the script executed canvas.


fitInScreen()

Fit a canvas on the screen.                

  list[str]

getAllObjectNames()

Obtain the name of all graphic objects on the canvas.

PowerShape

getObject( targetObj )

Obtain the selected graphic object.

  list[str]

getObjectNamesInLayer( layer )

Obtain the name of graphic objects belonging to the specified layer.

  PowerShape

hoveredObject()

Obtain the graphic object on the mouse cursor.

boolean

isLayerVisible( layer )

Obtain the state of the layer visible / invisible


maximize()

Maximize the canvas.


minimize()

Minimize the canvas.


moveAnimation( targetObj, xLength, yLength, msec, repeat, curve )

Move the selected graphic object(targetObj) for the specified distance for the specified time(msec).


moveAnimation( name, xLength, yLength, msec, repeat, curve )

Move the selected graphic object(name) for the specified distance for the specified time(msec).


moveOnCurveAnimation( moveObj, targetObj, dir, msec, repeat )

The graphic object(moveObj) moves on the direction of the selected graphic object(targetObj) for the specified time(msec).


opacityAnimation( targetObj, start, end, msec, repeat, curve )

Change the transparency of selected graphic object(targetObj).


replacePointName( texts )

Change the point name on that canvas.


replacePointName2( objs, texts )

Change the point name selecting certain graphic objects.


rotateAnimation( targetObj, angle, x, y, duration, repeat )

Maximize / Minimize the selected graphic object to the size of x,y for the specified time(msec).


rotateAnimation2( targetObj, angle, x, y, duration, repeat )

Rotate the selected graphic object.


saveScreen( loaction )

Capture the current screen and save it in the folder.


scaleAnimation( targetObj, x, y, msec, repeat, ankor )

Rotate the selected graphic object by a specified angle.


scrollAnimation( name, direction, msec )

Scroll the selected graphic object(name) for the specified direction for the specified time(msec).

  pyShape

selectedObject()

Obtain the selected graphic object.


setInterval( functionName, msec )

Execute the method regularly for the specified time interval.


setLayerVisible( layer, visible )

Set the layer visible / invisible.


setMark( shape )

Display the object(shape) on the canvas.


setZoomLevel( level )

Set the zoomLevel of canvases.


showTopLevel()

Display the canvas on the top.


singleShot( functionName, msec )

Execute the method once after the specified time(msec).


startBlink( targetObj, msec )

Give a blinking effect on the selected graphic object(tatgetObj).


stopBlink( targetObj )

Stop the startBlink of the selected object.


stopBlink2( name )

Stop the startBlink of the selected object.


stopInterval( functionName )

Stop the setInterval method.


stopMoveAnimation( targetObj )

Stop the moveAnimation of the selected object.


stopMoveAnimation2( name )

Stop the entered moveAnimation.


stopOpacityAnimation( targetObj )

Stop the opacityAnimation of the selected object.


stopOpacityAnimation2( name )

Stop the opacityAnimation of the selected object.


stopRotateAnimation( targetObj )

Stop the rotateAnimation of the selected object.


stopRotateAnimation2( name )

Stop the rotateAnimation of the selected object.


stopScaleAnimation( targetObj )

Stop the scaleAnimation of the selected object.


stopScaleAnimation2( name )

Stop the scaleAnimation of the selected object.


waitForClose()

캔버스가 닫힐 때까지 대기합니다.

  float

zoomLevel()

Read the zoom level of canvases.





  PowerShape getObject( targetObj:Graphic object )

 

  Obtain the graphic object(targetObj).


        ㆍ The way of entering targetObj is as follows:

                1) Single object : Enter 'Graphic name' to targetObj.

                2) Group object : Enter 'Group name.Graphic name' to targetObj.

                        Example) 'Group_1.Arc_1'


        ㆍ The graphic object obtained by getObject is used for the parameter of various functions on the canvas, and could change the state of graphic objects through getProperty, setProperty.

        ㆍ The detail of graphic objects is introduced in chapter 11.

 


  Example) Change the fill color of a single graphic object.


   


       obj = canvas.getObject('BlueCircle');  << Obtain 'BlueCircle'.


       obj.setProperty('BrushColor', QColor(255, 0, 0));  << Change the fill color of obtained object as QColor(255,0,0).


   



                               




 Example) Change the fill color of a group graphic object.


   


       obj = canvas.getObject('GroupA.A');  << Obtain 'A' on the 'GroupA'


       obj.setProperty('BrushColor', QColor(255, 0, 0));  << Change the fill color of the obtained object as QColor(255,0,0).


   



                                \




  setInterval( exp:Expression, msec:Executing interval )

 

  Execute the user-defined expression for every msec time(1000 = 1 second).


          ㆍ exp is entered as String.

          ㆍ msec is entered as Numeric.



  Example)

   


       canvas.setInterval('setDateTime()', 1000);  << Execute setDateTime for every second.


   


  The following is the result of time displaying using setInterval.


                               

                               



  stopInterval( exp:Expression )

 

  Stop the expression that the user set.


          ㆍ exp is entered as String.



  Example)

   


       canvas.stopInterval('setDateTime()');  << Stop setDateTime.


   


  Stop setDateTime() by stopInterval.


                               

                               



  singleShot( exp:Expression, msec:Executing interval )

 

  Execute the expression that the user set after the setup time(msec 1000 = 1 second)


          ㆍ exp is entered as String.

          ㆍ msec is entered as Numeric.



  Example)

   


       canvas.singleShot('SingleShow()', 1000 );  << Execute SingleShow after a second.


   


  singleShot works as follows:


                               



  setMark( shape:The object to be displayed )

 

  Display the shape object on canvases.


          ㆍ Enter the graphic object of canvases to shape.



  Example)

   


       Ob = canvas.getObject('LED2-OFF_1');  << Obtain 'LED2-OFF_1'.


       canvas.setMark(Ob);  << Display the obtained graphic object.


   


  The following is an example of How setMark works.

                               



  clearMark( shape:The object to be released )

 

  Release the setMark of shape objects on a canvas.


          ㆍ Enter the graphic object to shape.



  Example)

   


       Ob = canvas.getObject('LED2-OFF_1');  << Obtain 'LED2-OFF_1'


       canvas.clearMark(Ob);  << Release the setMark of the obtained graphic object.


   


  The following is an example of How clearMark works.

                               



  moveAnimation( targetObj:Graphic objects, xLength:X-axis distance to move, yLength:Y-axis distance to move, msec:Moving time, repeat:Repeat count, curve:Moving method )

 

  Move the graphic object.


        ㆍ targetObj moves to xLength and yLength direction for msec.

        ㆍ targetObj is a graphic object to move. (It is available entering the name of graphic objects.)

        ㆍ xLength is an X-axis distance to move.

                - pasitive : Move to the right.

                - negative : Move to the left.

        ㆍ yLength is a Y-axis distance to move.

                - pasitive : Move to the bottom.

                - negative: Move to the top.

        ㆍ msec is moving time.

        ㆍ repeat is the number of animation repetition of that graphic object.

                - When 1 entered, execute once.

                - When 0 entered, execute infinitely.

        ㆍ curve is a moving method, there is a total of 6 kinds.

            curve is introduced in an attachment.



  Example) Obtain the graphic object.

   


       obj1 = canvas.getObject('Image');  << Obtain 'Image' object.


       canvas.moveAnimation(obj1, -1670.79, 1629.82, 2500, 1, 0);  << Move the obtained graphic object once 1670.79 pixels to the left, 1629.82 to the top for 2.5 seconds.


   


Example) Enter the name of graphic objects directly.

   


     canvas.moveAnimation('Image', -1670.79, 1629.82, 2500, 1, 0);  << Move the graphic object once 1670.79 pixels to the left, 1629.82 pixels to the top for 2.5 seconds.


   

 

 This is an example of How moveAnimation works.


                               


                                 Move 'Image' object once 1670.79 pixels to the left, 1629.82 pixels to the top for 2.5 seconds.

                                 If you write canvas.moveAnimation(obj1, -1670.79, 1629.82, 2500, 2 0); as well, move twice for 2.5 seconds



  stopMoveAnimation( targetObj:Graphic objects )

 

  Stop the moveAnimation of targetObj.



  Example)

   


       obj1 = canvas.getObject('Image');  << Obtain 'Image' object.

 

       canvas.stopMoveAnimation(obj1);  << Stop the moveAnimation of obtained graphic object.


   



  stopMoveAnimation2( name:Graphic objects )

 

  Stop the moveAnimation of graphic objects(name).



  Example)

   


       canvas.stopMoveAnimation2('Image');  << Stop the moveAnimation of 'Image'.


   



  rotateAnimation( targetObj:Graphic objects., angle:Rotation angle, x:X-axis, y:Y-axis, duration:Rotation time, repeat:Repeat count )

 

  Rotate the graphic object.


        ㆍ targetObj rotates an angle for a duration based on x and y.

        ㆍ targetObj is a graphic object to rotate.

        ㆍ angle is a rotation angle.

        ㆍ x is an X-axis.

                - If 0 : It means the left edge of canvases.

                - Positive : The base axis moves to the right.

                - Negative : The base axis moves to the left.

        ㆍ y is a Y-axis,

                - If 0 : It means the top edge of canvases.

                - Positive : The base axis moves to the top.

                - Negative : The base axis moves to the bottom.

        ㆍ duration is a rotation time.

        ㆍ repeat represents the number of repetitions for tat graphic object.

                - When 1 entered, execute once.

                - When 0 entered, execute infinitely.



  Example)

   


       obj1 = canvas.getObject('Windmill');  << Obtain 'Windmill' object.


       canvas.rotateAnimation(obj1, 360, 295, 508, 1000, 0);  << Execute obtained object infinitely for a 360-degree rotating animation for a second based on the base axis.


   


  This is an example of How rotateAnimation works.


                               



  rotateAnimation2( targetObj:Graphic objects, angle:Rotation angle, x:X-axis, y:Y-axis, duration:Rotation time, repeat:Repeat count )

 

  Rotate the graphic object.


        ㆍ targetObj rotates an angle for a duration based on x and y.

        ㆍ targetObj is a graphic object to rotate.

        ㆍ angle is a rotation angle.

        ㆍ x is a X-axis.

                - If 0 : It means the center of graphic objects.

                - Positive : The base axis moves to the right.

                - Negative : The base axis moves to the left.

        ㆍ y is a Y-axis.

                - If 0 : It means the center of graphic objects.

                - Positive : The base axis moves to the right.

                - Negative : The base axis moves to the left.

        ㆍ duration is a rotation time.

        ㆍ repeat represents the number of repetitions for that graphic object.

                - When 1entered, execute once.

                - When 0 entered, execute infinitely.

       


  Example)

   


       obj1 = canvas.getObject('Windmill');  << Obtain 'Windmill' object.


       canvas.rotateAnimation2(obj1, 360, -0.2, 8.5, 1000, 0);  << Execute obtained object for a 360-degree rotating animation for a second based on base axis.


   


  This is an example of How rotateAnimation2 works.


                               



  stopRotateAnimation( targetObj:Graphic objects. )

 

  Stop the rotateAnimation of targetObj.

       


  Example)

   


       obj1 = canvas.getObject('Windmill');  << Obtain 'Windmill' object.


       canvas.stopRotateAnimation(obj1);  << Stop the rotateAnimation of the obtained graphic object.


   



  stopRotateAnimation2( name:Graphic objects )

 

  Stop the rotateAnimation of graphic objects(name).

       


  Example)

   


       canvas.stopRotateAnimation2('Windmill');  << Stop the rotateAnimation of 'Windmill'.


   



  scaleAnimation( targetObj:Graphic obejcts, x:X-axis scale size, y:Y-axis scale size, msec:scale time, repeat:Repeat count, ankor:Base axis )

 

  Maximize / minimize the graphic object.


        ㆍ targetObj is maximized / minimized to x,y scale size for msec based on own ankor.

        ㆍ targetObj is a graphic object to be maximized / minimized.

        ㆍ angle is a roation angle.

        ㆍ x is a X-axis based maximizing / minimizing ratio, and the base point is 100.

                - If x is 200 : Maximize double the horizontal scale from ankor.

        ㆍ y is a Y-axis based maximizing / minimizing ratio, the base point is 100.

                - If y is 50 : Minimize a half the vertical scale from ankor.

        ㆍ msec is a time for scaling.

        ㆍ repeat represents the number of repetition of that graphic object.

                - When 1 entered, execute once.

                - When 0 entered, execute infinitely.

        ㆍ ankor is the base point of maximizing / minimizing. It could be set in 9 kinds of direction.

        ㆍ ankor 9 kinds of direction

                - app.Center : Center

                - app.Top : Top

                - app.Bottom : Botton

                - app.Left : Left

                - app.Right : Right

                - app.TopLeft : The upper left

                - app.TopRight : The upper right

                - app.BottomLeft : The lower left

                - app.BottomRight : The lower right



  Example)

   


       obj1 = canvas.getObject('Image');  << 'Obtain 'Image" object.


       canvas.scaleAnimation(obj1, 300,  300, 1000, 1, app.Center );  << Maximize the obtained object triple the vertical scale and the horizontal scale for a second based on the center.


   


  This is an example of How scaleAnimation works


                               



  stopScaleAnimation( targetObj:Graphic objects )

 

  Stop the scaleAnimation of targetObj.

       


  Example)

   


       obj1 = canvas.getObject('Image');  << Obtain 'Image' object.


       canvas.stopScaleAnimation(obj1);  << Stop the scaleAnimation of the obtained object.


   



  stopScaleAnimation2( name:Graphic objects )

 

  Stop the scaleAnimation of graphic objects(name).

       


  Example)

   


       canvas.stopScaleAnimation2('Image');  << Stop the scaleAnimation of 'Image'.


   



  opacityAnimation( targetObj:Graphic objects, start:Start transparency, end:End transparency, msec:Changing time, repeat:Repeat count, curve:Method )

 

  Change the transparency of graphic objects.


        ㆍ Change the transparency of targetObj from start to end.

        ㆍ targetObj is a graphic object to change the transparency.

        ㆍ The range of start and end is 0~100, 0 is invisible.




       canvas.opacityAnimation(obj1, 20, 100, 10000, 1, 0);  << Execute obtained object once to change the transparency from 20 to 100 for 10 seconds.




  This is an example of How opacityAnimation works.

                               



  stopOpacityAnimation( targetObj:Graphic objects )

 

  Stop the opacityAnimation of targetObj.

       


  Example)

   


       obj1 = canvas.getObject('Image');  << Obtain 'Image'


       canvas.stopOpacityAnimation(obj1);  << Stop the opacityAnimation of the obtained object.


   



  stopOpacityAnimation2( name:Graphic objects  )

 

  Stop the opacityAnimation of graphic objects(name).

       


  Example)

   


       canvas.stopOpacityAnimation2('Image');  << Stop the opacityAnimation of 'Image'.


   



  startBlink( targetObj:Graphic obejcts, msec:Blinking interval )

 

  Blink the graphic object(targetObj) to the specified interval(msec)

       


  Example)

   


       obj1 = canvas.getObject('BlueCircle');  << 'Obtain 'BlueCircle'.


       canvas.startBlink(obj1, 1000);  << Blink the graphic object every second.


   


  This is an example of How startBlink works.

                               



 stopBlink( targetObj:Graphic objects )

 

  Stop the blinking of graphic objects(targetObj).

       


  Example)

   


       obj1 = canvas.getObject('BlueCircle');  << Obtain 'BlueCircle'.


       canvas.stopBlink(obj1);  << Stop the blinking of the graphic object.


   



  stopBlink2( name:Graphic objects )

 

  Stop the blinking of graphic objects(name).

       


  Example)

   


       canvas.stopBlink('BlueCircle');  << Stop the blinking of 'BlueCircle'.


   



  replacePointName( texts:String or a list of String )


  Users can change the random point name that the user sets when the data link.


        ㆍ Available point names are two things.

                1) Real point name.

                2) User-defined point name.


        ㆍ When setting a user-defined point name, the user can change it to the real point name using replacePointName.


        ㆍ Enter String or a list of String to texts.

                - The format is entered a random point name at the front and a real point name at the back based on a colon( : ).


                - If 1 point name to change : Enter as String

                        Example) 'Random point name:Station name.Point name'


                - If more than 2 point names to change : Enter as a list of String

                        Example) ['Random point name1:Station name1.Point name1', 'Random point name2:Station name2.Point name2']



  Example) If 1 point name to change

        - Random point name : A1

        - Real point name : Charger 1.Charging state


   


       canvas.replacePointName( 'A1:Charger 1.Charging state' );  << Change 'A1' to 'Charger 1.Charging state'.


   


                                                                                                                                                               

                               

                                                            [ Data link with a random point name ]                                                                                                                                                                                                                 



                               

                                                                         [ Data link with a real point name ]



  Example) If more than 2 point names to change

        - Random point name : A1, A2

        - Real point name : Charger 1.Charging state, Charger 1.Car SOC


   


       canvas.replacePointName( ['A1:Charger 1.Charging state', 'A2:Charger 1.Car SOC'] );  << Change 'A1' and 'A2' to 'Charger 1.Charging state' and 'Charger 1.Car SOC' respectively.


   

                                                                                                                                                                   


                               

                                                             [ Data link with a random point name ]                                                                                         


                               

                                                                         [ Data link with a real point name ]       




  replacePointName2( objs:Graphic objects, texts:String or a list of String )

 

  Users can change the random point name that the user sets when the data link.


        ㆍ Available point names are two things.

                1) Real point name

                2) User-defined point name


        ㆍ When setting a user-defined point name, users can change it to the real point name using replacePointName2.



        ㆍ Enter String or a list of String to objs.

                - If 1 graphic object to select : Enter as String

                        Example) 'Graphic object name'


                - If more than 2 graphic objects to select : Enter as a list of String

                        Example) ['Graphic object name1', 'Graphic object name2']


        ㆍ Enter String or a list of String to texts.

                - The format is entered a random point name at the front and a real point name at the back based on a colon( : ).


                - If 1 point name to change : Enter as String

                        Example) 'Random point name:Station name.Point name'


                - If more than 2 point names to change : Enter as a list of String

                        Example) ['Random point name1:Station name1.Point name1', 'Random point name2:Station2.Point name2']



  Example) If 1 point name to change on 1 graphic object

        - Graphic object : Red thermometer

        - Random point name : SliderTest

        - Real point name : Gauge.SliderGauge


   


       canvas.replacePointName2( 'Red thermometer', 'SliderTest:Gauge.SliderGauge' );  << Change 'SliderTest' to 'Gauge.SliderGauge' on 'Red thermometer' object.


   



                               




  Example) If 2 point names to change on 2 graphic objects.

        - Graphic object : Red thermometer, Round LED bar

        - Random point name : SliderTest, LEDTest

        - Real point name : Gauge.SliderGauge, Gauge.LEDGauge


   


       canvas.replacePointName2( ['Red thermometer', 'Round LED bar'], ['SliderTest:Gauge.SliderGauge', 'LEDTest:Gauge.LEDGauge'] );

       << Change 'SliderTest' and 'LEDTest' to 'Gauge.SliderGauge' and 'Gauge.LEDGauge' respectively.


   



                               






  setLayerVisible( layer:Layers, visible:Visible or invisible)

 

  Set the visible or invisible of layers


        ㆍ Enter the name of layers to layer

        ㆍ Enter the number to visible for visible / invisible set value.

                 - 1 : Visible

                 - 0 : Invisible

 


  Example)

   


       canvas.setLayerVisible('Layer 1', 0);  << Set 'Layer 1' as an invisible state.


       canvas.setLayerVisible('Layer 2', 1);  << Set 'Layer 2' as a visible state.


   


 

                               


                                ㆍ Layer1 and Layer2 are a canvas.

                                ㆍ Users can set various layers in one canvas.



                               


                                       canvas.setLayerVisible(‘Layer 1’, 1); canvas.setLayerVisible(‘Layer 2’, 0);

                                       canvas.setLayerVisible(‘Layer 1’, 0); canvas.setLayerVisible(‘Layer 2’, 1);



  boolean isLayerVisible( layer:Layers )

 

  Obtain the visible / invisible state of layers. The return type is boolean.


        ㆍ If the layer is visible, return TRUE(1).

        ㆍ If the layer is invisible, return FALSE(0).

       


  Example)

   


       Layer1 = canvas.isLayerVisible('Layer 1');  << Obtain the visible / invisible state of 'Layer 1'.

       Layer2 = canvas.isLayerVisible('Layer 2');  << Obtain the visible / invisible state of 'Layer 2'.


   


  This is an example of How isLayerVisible works.


                               



  closeCanvas()

 

  Close the canvas that scripts are running.



  Example)

   


       canvas.closeCanvas();  << Close the canvas.


   


  This is an example of How closeCanvas works.


                               



  str fileName()

 

  Read the path of canvas that scripts are running.  The return type is String.



  Example)

   


       canvas_File_Name = canvas.fileName();  << Read the path of canvases.


   


  This is an example of output using messageBox.


                               



  float zoomLevel()

 

  Read the maximizing / minimizing ratio of canvases. The return type is float.


        ㆍ The default ratio is 1.0.



  Example)

   


       Zoom_Value= canvas.zoomLevel();  << Read the maximizing / minimizing ratio of canvases.


   


  This is an example of zoomLevel.


                               



  setZoomLevel( level:Zoom level )

 

  Set the maximizing / minimizing zoom level of canvases. level is entered as Numeric.


        ㆍ The default ratio is 100.



  Example)

   


       canvas.setZoomLevel(100);  << Set the maximizing / minimizing zoom level of the canvas as 100.


   


  This is an example of using setZoomLevel on the button.


                               


                               



  maximize()

 

  Maximize the canvas.



  Example)

   


       canvas.maximize();  << Maximize the canvas.


   


  This is an example of How maximize works.


                               



  minimize()

 

  Minimize the canvas.



  Example)

   


       canvas.minimize();  << Minimize the canvas.


   


  This is an example of How minimize works.


                               



  fitInScreen()

 

  Fit the canvas on PowerScene window size to display the whole canvas.



  Example)

   


       canvas.fitInScreen();  << Fit the canvas on PowerScene window size.


   


  This is an example of How fitInScreen works.


                               



  pyShape selectedObject()

 

  Obtain the graphic object user selected.



  Example)

   


       Obj1 = canvas.selectedObject();  << Obtain the graphic object user selected.


   


  This is a screen that text information output of user selected object.


                               



  saveScreen( location:The folder path to save screenshot )

 

  Capture the current canvas screen and save it on the path.


        ㆍ The file is saved on the path with the name as 'Canvas name_Current hour_Current minute_Current second'.


        ㆍ Enter the folder path to the location



  Example)

   


       canvas.saveScreen('c:\');  << Capture the current canvas screen and save it on c:\.


   


  This is the result of saving current canvas screen on 'c:\'.


                               


  This is the result of opening the saved image.


                               



  closeMe()

 

  Close the current active canvas



  Example)

   


       canvas.closeMe();  << Close the current active canvas.


   


  This is the result of closeMe.


                               



  list[str] getAllObjectNames()

 

  Obtain the name of all graphic objects in the canvas.



  Example)

   


       objList = canvas.getAllObjectNames();  << Obtain the name of all graphic objects as a list.


   


  This is the result of getAllObjectNames.


                               



  list[str] getObjectNamesInLayer( layer:Layer to read graphic objects )

 

  Obtain the name of all graphic objects in the specified layer.



  Example)

   


       objList = canvas.getObjectNamesInLayer('Layer 1');  << Obtain the name of all graphic objects in 'Layer 1'.




  This is the result of getObjectNamesInLayer('Layer 1').


                               



  showTopLevel()

 

  Display the canvas on the forward. When canvases overlaid, showTopLevel brings the canvas to the forward.



  Example)

   


      canvas.showTopLevel()  << Display the canvas on the forward.

   




  PowerShape hoveredObject()

 

  Read the object on the mouse cursor.



  Example)

   


     obj =  canvas.hoveredObject()  << Read the object on the mouse cursor.


   



  PowerShape createObject( objectType:Shape type to create , layerName: The layer to be added the created shape. )

 

  Create a new graphic object and add to the layer.


        ㆍ objectType is a shape type to create, and the name of shapes are as follows.

        ㆍ layerName is the layer to be added to the created shape.

                - If no specified layer, it adds to the currently active layer.

       


Shape Type

Factor

Rectangular

rectShape

Line

lineShape

Ellipse

ellipseShape

Round Rectangular

roundrectShape

Poly Line

polylineShape

Polygon

polygonShape

Text

textShape

Image

pixmapShape

Pie

pieShape

Arcc

arcShape

GIF Image

gifShape

Graphic Button

graphicButtonShape

Path

pathShape

Combo Box

ComboBoxWidget

Check Box

CheckBoxWidget

List Box

listBoxWidget

Push Button

PushButtonWidget

Line Edit Widget

LineEditWidget

SVG Image

svgShape

Text Table

textTable



  Example)

   


      r = canvas.createObject('rectShape', 'Layer 1')  << Add the rectangular to 'Layer 1'.

      e = canvas.createObject('ellipseShape')  << Add the ellipse to the current canvas.


   



  moveOnCurveAnimation( moveObj:Graphic objects to move, targetObj:Graphic objects, dir:Location, msec:Time, repeat:Repeat times )

 

  moveOnCurveAnimation is a moving animation following towards targetObj.


        ㆍ moveObj is a graphic object to move.

        ㆍ moveObj moves on the targetObj.

        ㆍ dir represents the location when 0 entered, moveObj moves from the start point of targetObj to the end point of targetObj. When 1 entered, moves from the end point of targetObj to the start of targetObj.

                ㆍ Start point   :   0

                ㆍ End point    :   1

        ㆍ msec is a time, 1000msec equals a second.

        ㆍ repeat is the number of repetitions, the default value is 0, when repeat is 0, repeat to infinity.


  Below is an example of moveOnCurveAnimation.



  Example)

   


     canvas.moveOnCurveAnimation('arrow', 'Line_1', 0, 3000)  << 'arrow' object moves from the start point of 'Line_1' to the end point of 'Line_1' for 3 seconds and repeat to infinity.


   



         

 





  scrollAnimation( name:Graphic objects to move, direction:Direction, msec:Time )

 

  Graphic images(name) move to the specified direction for the specified time infinitely.

  For example, the lower caption of breaking news.


 


        ㆍ name is a graphic object to move.

        ㆍ direction represents a direction, when 0 is entered, move from left to right. When 1 is entered, move from right to left.

        ㆍ msec represents time, 1000msec equals a second.


 Below is an example of news object moves from left to right for 3 seconds.


  Example)

   


     canvas.scrollAnimation('news', 0, 3000)  << 'news' object moves from left to right for 3 seconds infinitely.


   


 



  connectValueChange ( func:함수, pointNames:포인트명 )

 

  입력한 포인트값이 변경될 때 등록된 이벤트 핸들러 함수가 실행됩니다.

       

        ㆍ func 에는 실행될 핸들러 함수를 입력합니다.

            ㆍ 핸들러 함수의 name 에는 변경된 포인트값의 이름이 전달됩니다.

            ㆍ 핸들러 함수의 value 에는 변경된 포인트값이 전달됩니다.

        ㆍ pointNames 에는 포인트명을 리스트형태로 입력합니다.


  예)

   

       def handleChange(name, value):

           if name == 'COM.1 충전상태':

               batteryObj = canvas.getObject('GroupBattery_1')

           elif name == 'COM.2 충전상태':

               batteryObj = canvas.getObject('GroupBattery_2')


           chargeObj = batteryObj.getObject('GroupCharge')

           dischargeObj = batteryObj.getObject('RectDischarge')


           if value == 0:

               chargeObj.setProperty('Visible', 0)

               dischargeObj.setProperty('Visible', 1)

           else:

               chargeObj.setProperty('Visible', 1)

               dischargeObj.setProperty('Visible', 0)


       lst = ['COM.1 충전상태', 'COM.2 충전상태']

       canvas.connectValueChange(handleChange, lst)




  'COM.1 충전상태', 'COM.2 충전상태' 포인트값의 변경에 따라 그래픽 개체의 보이기/감추기 속성이 변경됩니다.


         

 


  waitForClose ()

 

  캔버스 표시모드가 '윈도우 창 띄우기', '팝업' 인 캔버스가 닫힐 때까지 대기합니다.


  아래는 추가버튼을 눌러 띄운 사용자 팝업에서 사용자를 추가한 후 사용자 목록을 갱신하는 예시입니다.


  예)

   

     # 추가버튼 마우스 누름 스크립트

     userAddPopup = canvasManager.open(u'사용자_팝업.pws')  # 사용자 추가 팝업을 띄웁니다.

     userAddPopup.waitForClose()  # 사용자 추가 팝업이 종료될때까지 대기합니다.

     updateUserList(canvas.getObject('TextTable_1'))  # 사용자 목록 텍스트테이블을 갱신합니다.


   


  추가 버튼을 눌러 사용자 추가 팝업을 띄우면 waitForClose() 에서 팝업 종료까지 대기합니다.


         


  사용자 정보 입력 후 확인을 눌러 팝업이 닫히면 다음 스크립트인 updateUserList() 가 실행됩니다.