Skip to main content

Datalink

Datalink is the mean through which widget property is connected to data or in general to another widget property.

  • Target widget: is the widget that receives updates from the datalink
  • Target property: is the property of the target widget that receive updates from the datalink
  • Source widget: is the widget that send updates to the datalink
  • Source property: is the property of the source widget that sends updates to the datalink

Device Slot and TagMgr

In a dashbaord we can add Device Slot. A Device Slot is defined by a model and a device, and they are the main way to get IoT data in a dashboard. Device slots are managed by a global widget called TagMgr. This widget is a singleton and it is always present in the dashboard tree. All datalinks connected to a device slot are managed by the TagMgr.

The datalink property of a widget stores the information of all sources that are providing data updates to the corresponding target widget properties.

The property datalinks is an object map where the key is a string that identifies the datalink and the value is a Datalink object. Every time a datalink is added or removed from a target widget the system calls the method addDatalink or removeDatalink of the widget.

note

Datalinks are stored in the target widget only.

When a property of a widget gets updated, if it is a source property of a datalink, the update propagates to the target widget property calling the method setPropertyValue of the target widget.

  • BaseWgt::setPropertyValue( { prop, value } ): prop is a string and contains the name of the property to updated, value is the new value of the property.

Every time you need to get the value of a property can use the method getPropertyValue of the widget.

  • BaseWgt::getPropertyValue( property ): property is a string and contains the name of the property to return.