Object
Note: Object Files in CygNet Thin Web Client
Canvas object files (.cob) are generally not supported in the CygNet Thin Web Client, with the exception of an object file used as the reverse side of the Detail control when flipped. Object files created for this purpose must following the TWC naming and storage rules: no spaces in the file name, no special characters, and the .cob file must be saved in a BSS folder, preferably in the same folder as the screen file with the Detail control. Note that while many of an Object's properties are visible in the Canvas user interface, they may not be supported in an object file created for a Detail control. Consult the Object Properties topic for more information.
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.
Note: Enabling script support for an object increases the overhead associated with initializing and running that object. If you can avoid enabling script it will allow the object to load faster and use fewer resources when used in another object or screen.
Object Library
Objects are stored together in an Object Library, either in an APPS or BSS folder or in a local or network file-system folder 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 an APPS or BSS folder, you can specify the:
- full path of the file
- folder\filename.can of the file (Canvas uses the source file's service)
- filename.can of the file (Canvas uses source file's service and folder)
If the screen or object file is in the local file system, you can specify the:
- full path of the file
- filename.can of the file (Canvas uses source file's path)
Property Inheritance
Property Inheritance
Property inheritance, or sending and receiving, is a widely used concept in Canvas. The application supports an explicit relationship between screens, objects, and controls, where certain property values, such as facilities and SiteService details, 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 facility and SiteService. Depending on how you have your screens, objects, and controls configured, the facility and SiteService may be received from any one of the following sources:
- from itself — indicated by selecting <Self> and then explicitly configuring the property
- received from the screen — indicated by selecting Screen, which is always present as a sender
- received from another control — indicated by selecting the Name of the sending control.
Broadcasting
Screens and objects support an additional notification option to broadcast their facility and SiteService selection changes to other open screens. If configured, a <Broadcast> option is available to source the screen's facility and SiteService 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.
