Canvas > Using Canvas Controls and Objects > Object

Object

Object icon An Object is a simple Canvas screen containing one or more controls, which can be used on one or many screens. The controls on an object might represent assets such as a well or compressor or device or facility. Once configured, you can drop an object onto many different screens. If you need to make a single edit to any one control on an object, you simply change the master object, save the object, and all screens containing that object will be automatically updated. Any change made to an object will affect all instances of that object on any Canvas screen where it is used. Objects are analogous to templated screens in CygNet Studio. An object and a screen share the same configuration properties, events, and methods.

Configuring Objects

Objects are, in configuration, identical to screens, although objects are saved with a .cob file extension to distinguish them from regular Canvas screens, which use a .can file extension. Objects contain all the power of a Canvas screen, including a script engine to add power and configuration to the controls within. Objects are added to a Canvas screen via the Toolbox pane. The default size of an object is small (200px by 200px), but can be easily resized to suit your needs. The background of an object is transparent. After configuring the object properties and adding and configuring controls as required, you save the object and add it to other screens as needed.

See Creating New Screens and Objects for more information about creating new objects.

Object Library

Objects are stored together in an Object Library, either on the Local file system, or in a BSS for system-wide access. See Configuring an Object Library for more information.

Objects in the Toolbox Pane

All objects in your object library are listed in the Toolbox pane for easy access, grouped by file location: BSS objects and local objects.

Each Canvas object displays a small dynamic sample image, which updates every time you save the object (.cob) file. You will see a .png file with the same file name stored in the same location as your objects. For example, if you save an object called "Refresh Button.cob", a related "Refresh Button.png" will also be saved in your object library.

Object Viewer Control

Drag and drop any object from the toolbox pane to your screen (or another object). In design mode a Canvas object is viewed in an Object Viewer control. The Object Viewer's properties are listed in the Properties pane in an Object Viewer control and have the same properties, events, and methods as the Nested View control. You can interact with an Object Viewer control via script in the same way you can with any Canvas control. An Object Viewer control can also have its own styles.

Object Paths

When dragging and dropping an object onto a screen (or another object) the full path to the object is populated in the Object Viewer's Screen path property.

However, you don't necessarily need to specify the full service or folder information in the path to find the related object. Objects without a full screen path are able to receive a SiteService or Facility update before the object has loaded its screen.

Linking between Canvas screens, objects, and nested views is quite flexible. You don't need to specify the service or folder information in the path to find related screens, objects, or nested views, although you can if desired. When specifying a path to another file, the following notes apply:

If the screen or object file is in the APPS or BSS, you can specify the:

If the screen or object file is in the local file system, you can specify the:

Property Inheritance

Property Inheritance

Property inheritance is a widely used concept in Canvas. The application supports an explicit relationship between screens, objects, and controls, where certain property values, such as SiteService and facility tags, are passed from one element to another via an inheritance framework. Screens, objects, and controls can be configured as property senders or property receivers and provide configuration options where you can explicitly define the source of the SiteService and facility. Depending on how you have your screens, objects, and controls set up, the SiteService and facility may come from any one of the following sources:

Broadcasting

Screens and objects support an additional notification option to broadcast their SiteService and facility selection changes to other open screens running in the Canvas or Canvas View application. If configured, a <Broadcast> option is available to source the screen's SiteService and facility properties from another open screen.

For example, a text tool can be configured to get its facility from the screen and the screen can be configured to get its facility from a tag chooser. Or Screen_A might source its facility from Screen_B, which gets its facility from a tag chooser.

Receiver or Sender

The object supports property inheritance, both as a receiver of its SiteService and facility from controls on the screen and from the other screens, and as a sender of its SiteService and facility to other controls on the screen and to other screens:

Receive from Send to
SiteService Facility SiteService Facility

Broadcast

Screen

Broadcast

Self

Other controls

Broadcast

Other controls

Broadcast

Other controls

This allows users to create dynamic screens that can be driven by a SiteService or facility configured on a different screen. See Interscreen Communication for more details about this option.

Related Topics


Let us know how we can improve this topic.

CygNet at weatherford.com

© 2020 Weatherford. All rights reserved.