svghmi/widget_display.ysl2
author Edouard Tisserant
Tue, 07 Apr 2020 10:01:23 +0200
branchsvghmi
changeset 2921 2670f5c53caf
parent 2883 8e3d130399b0
child 2998 e8f707d99dc3
permissions -rw-r--r--
SVGHMI: HMI is not speculating on PLC variable update anymore when sending new variable value.

HMI variable cache in JS was changed in advance for more responsive behaviour when updating a HMI tree variable. This was leading to display value different from hmi tree variable in case the expected update did not happen because PLC program did revert it.
// widget_display.ysl2


template "widget[@type='Display']", mode="widget_defs" {
    param "hmi_element";
    |     frequency: 5,
    |     dispatch: function(value) {
    choose {
        when "$hmi_element[self::svg:text]"{
        // TODO : care about <tspan> ?
    |       this.element.textContent = String(value);
        }
        otherwise {
            warning > Display widget as a group not implemented
        }
    }
    |     },

}