svghmi/widget_list.ysl2
author Edouard Tisserant <edouard.tisserant@gmail.com>
Wed, 28 Oct 2020 18:21:12 +0200
branchsvghmi
changeset 3069 a9b03c2634c5
parent 3031 440d74319a74
child 3175 b2ba6eeb61ec
permissions -rw-r--r--
Arbitrary variables added to JsonTable subscription are now passed as 'extra' field in json query. As an example added JsonTable filtering in tests/svghmi
// widget_list.ysl2

template "widget[@type='List']", mode="widget_defs" {
    param "hmi_element";
    |     items: {
    foreach "$hmi_element/*[@inkscape:label]" {
    |         «@inkscape:label»: "«@id»",
    }
    |     },
}

template "widget[@type='TextStyleList']", mode="widget_defs" {
    param "hmi_element";
    |     styles: {
    foreach "$hmi_element/*[@inkscape:label]" {
        const "style", "func:refered_elements(.)[self::svg:text]/@style";
    |         «@inkscape:label»: "«$style»",
    }
    |     },
}