Skip to main content

Examples of using Data binding

This page shows how to create a data binding source using Courier Editor and how to configure data binding using Scene Composer. As an example, an Industrial solution will be used.


1. Creating a Data binding source

First, create a new Data binding source using the Courier Editor.

Open the Industrial solution from the Samples and Templates section of Scene Composer Startup panel.

drawing-7-1716528195.png

From [ File > Define application specification ] on the Scene Composer menu bar, open the "Specification File Selection and Search Path" dialog, and select [ Edit... ] to start CourierEditor.

drawing-7-1716528420.png

A CourierEditor window opens. From the menu bar, click [ File > New ]. 

drawing-7-1716528511.png

The Include Path dialog will appear. This example does not use Include Path, so click [ OK ] to skip it.

drawing-7-1716528617.png

The Browse for Folder dialog opens. Set the destination for the newly create Data binding source and click [ OK ].

drawing-7-1716539735.png

Set a name for the newly will be create Data binding source and click [ OK ].

drawing-7-1716528666.png

Use "xhcdl" as the Data binding source extension.

These steps create a new Data binding source.

drawing-7-1716528713.png

Add Data binding items (data name/type) to the created Data binding source.

  • Click the [ + ] button on the Binding Sources tab. "[0] bindingSource" is added.
    drawing-7-1716528748.png

  • [0] Click on bindingSource to view the content and set name to "Industrial".
    drawing-7-1716528779.png

  • Click the [ + ] button for items and click [ Add new item ]. "[0] item" is added.
    drawing-7-1716528817.png

  • Set "[0] item" to:
    name = Temp
    type = FeatStd::Int32
    drawing-7-1716528850.png

The creation of the data binding source is now complete. Save by selecting [ File > Save ] from the menu bar.

Please refer to Courier Editor for more information on how to create data binding sources.


2. Linking Data binding source to Scene Composer

drawing-7-1716529126.png

3. Configuring Data binding using the Scene Composer

Set up data binding to any property using the Scene Composer. Configure data binding using the chain icon on the far right of any property in the Properties panel.

For more information about data binding, please refer to Data Binding.

In the scene tree of the Scene1_Main scene, select [ GauegeTemperature ], and in the properties panel, click the [ Control > Value ] chain icon. The Define Data Binding dialog opens. Select "Industrial > Temp (FeatSte::Int32)" from the data item and click [ OK ].

drawing-7-1716529487.png

When data binding is set, the color of the chain icon changes to blue.

drawing-7-1716529543.png

4. Operation confirmation using Live Preview panel

You can check the operation of data binding settings in the live preview panel.

Display the live preview panel from [ View > Live Preview ] on the Scene Compsoer menu bar, and set the [ On/Off ] button at the top right of the panel to "On".

drawing-7-1716529638.png

Set the Needle (Variant) value to your desired value. Confirm that the position of the thermometer needle displayed in the scene editor changes to match the value you set.

drawing-7-1716529776.png