svghmi/widget_display.ysl2
branchsvghmi
changeset 3022 f6fe42b7ce60
parent 3008 dabad70db1bf
child 3035 d1fc8c55c1d3
equal deleted inserted replaced
3017:15e2df3e5610 3022:f6fe42b7ce60
    16 template "widget[@type='Display']", mode="widget_defs" {
    16 template "widget[@type='Display']", mode="widget_defs" {
    17     param "hmi_element";
    17     param "hmi_element";
    18     if "$hmi_element[not(self::svg:text)]"
    18     if "$hmi_element[not(self::svg:text)]"
    19         error > Display Widget id="«$hmi_element/@id»" is not a svg::text element
    19         error > Display Widget id="«$hmi_element/@id»" is not a svg::text element
    20 
    20 
    21     |     fields: [],
    21     const "field_initializer" foreach "path" {
       
    22         choose{
       
    23             when "@type='HMI_STRING'" > ""
       
    24             otherwise 0
       
    25         }
       
    26         if "position()!=last()" > ,
       
    27     }
       
    28     |     fields: [«$field_initializer»],
    22 }
    29 }
    23 
    30 
    24 emit "preamble:display"
    31 emit "preamble:display"
    25 ||
    32 ||
    26 /* https://github.com/alexei/sprintf.js/blob/master/src/sprintf.js */
    33 /* https://github.com/alexei/sprintf.js/blob/master/src/sprintf.js */