svghmi/widget_button.ysl2
author Edouard Tisserant
Tue, 02 Jun 2020 13:37:34 +0200
branchsvghmi
changeset 2975 8e8812f13d9d
parent 2961 00825316ed00
child 2976 99c4521bb844
permissions -rw-r--r--
Runtime: create .md5 file at the end of all transfered files being written to disk, so that it presence indicates completeness of transfer.
// widget_button.ysl2

template "widget[@type='Button']", mode="widget_class"
    ||
    class ButtonWidget extends Widget{
        frequency = 5;
        init() {
            this.element.addEventListener(
              "mousedown",
              evt => {
                  change_hmi_value(this.indexes[0], "=1");
              });
            this.element.addEventListener(
              "mouseup",
              evt => {
                  change_hmi_value(this.indexes[0], "=0");
              });
        }
    }
    ||