22 }; |
22 }; |
23 |
23 |
24 template "svg:*", mode="hmi_elements" { |
24 template "svg:*", mode="hmi_elements" { |
25 const "widget", "func:widget(@id)"; |
25 const "widget", "func:widget(@id)"; |
26 const "eltid","@id"; |
26 const "eltid","@id"; |
27 | "«@id»": new «$widget/@type»Widget ({ |
27 const "args" foreach "$widget/arg" > "«@value»"`if "position()!=last()" > ,` |
28 | args: [ |
28 const "indexes" foreach "$widget/path" { |
29 foreach "$widget/arg" |
|
30 | "«@value»"`if "position()!=last()" > ,` |
|
31 | ], |
|
32 | offset: 0, |
|
33 | indexes: [ |
|
34 foreach "$widget/path" { |
|
35 choose { |
29 choose { |
36 when "not(@index)" { |
30 when "not(@index)" { |
37 warning > Widget «$widget/@type» id="«$eltid»" : No match for path "«@value»" in HMI tree |
31 warning > Widget «$widget/@type» id="«$eltid»" : No match for path "«@value»" in HMI tree |
38 } |
32 } |
39 otherwise { |
33 otherwise { |
40 | «@index» /* «@value» */ `if "position()!=last()" > ,` |
34 > «@index»`if "position()!=last()" > ,` |
41 } |
35 } |
42 } |
36 } |
43 } |
37 } |
44 | ], |
38 |
45 | element: id("«@id»"), |
39 | "«@id»": new «$widget/@type»Widget ("«@id»",[«$args»],[«$indexes»],{ |
46 apply "$widget", mode="widget_defs" with "hmi_element","."; |
40 apply "$widget", mode="widget_defs" with "hmi_element","."; |
47 apply "$widget", mode="widget_subscribe" with "hmi_element","."; |
41 apply "$widget", mode="widget_subscribe" with "hmi_element","."; |
48 | })`if "position()!=last()" > ,` |
42 | })`if "position()!=last()" > ,` |
49 } |
43 } |
50 |
44 |