27 const "hmi_elements", "//*[starts-with(@inkscape:label, 'HMI:')]"; |
27 const "hmi_elements", "//*[starts-with(@inkscape:label, 'HMI:')]"; |
28 const "hmi_geometry", "$geometry[@Id = $hmi_elements/@id]"; |
28 const "hmi_geometry", "$geometry[@Id = $hmi_elements/@id]"; |
29 |
29 |
30 const "hmi_pages", "$hmi_elements[func:parselabel(@inkscape:label)/widget/@type = 'Page']"; |
30 const "hmi_pages", "$hmi_elements[func:parselabel(@inkscape:label)/widget/@type = 'Page']"; |
31 |
31 |
|
32 const "default_page" choose { |
|
33 when "count($hmi_pages) > 1" { |
|
34 const "Home_page", |
|
35 "$hmi_pages[func:parselabel(@inkscape:label)/widget/arg[1]/@value = 'Home']"; |
|
36 choose { |
|
37 when "$Home_page" > Home |
|
38 otherwise { |
|
39 error "No Home page defined!"; |
|
40 } |
|
41 } |
|
42 } |
|
43 when "count($hmi_pages) = 0" { |
|
44 error "No page defined!"; |
|
45 } |
|
46 otherwise > «func:parselabel($hmi_pages/@inkscape:label)/widget/arg[1]/@value» |
|
47 } |
|
48 |
32 const "_categories" { |
49 const "_categories" { |
33 noindex > HMI_ROOT |
50 noindex > HMI_ROOT |
34 noindex > HMI_LABEL |
51 noindex > HMI_LABEL |
35 noindex > HMI_CLASS |
52 noindex > HMI_CLASS |
36 noindex > HMI_PLC_STATUS |
53 noindex > HMI_PLC_STATUS |
37 noindex > HMI_CURRENT_PAGE |
54 noindex > HMI_CURRENT_PAGE |
38 } |
55 } |
39 const "categories", "exsl:node-set($_categories)"; |
56 const "categories", "exsl:node-set($_categories)"; |
40 //const "indexed_hmitree", "$hmitree[not(local-name() = $categories/noindex/text())]"; |
|
41 const "_indexed_hmitree" apply "$hmitree", mode="index"; |
57 const "_indexed_hmitree" apply "$hmitree", mode="index"; |
42 const "indexed_hmitree", "exsl:node-set($_indexed_hmitree)"; |
58 const "indexed_hmitree", "exsl:node-set($_indexed_hmitree)"; |
43 |
59 |
44 template "*", mode="index" { |
60 template "*", mode="index" { |
45 param "index", "0"; |
61 param "index", "0"; |
194 | var page_desc = { |
210 | var page_desc = { |
195 |
211 |
196 foreach "$hmi_pages" { |
212 foreach "$hmi_pages" { |
197 const "desc", "func:parselabel(@inkscape:label)/widget"; |
213 const "desc", "func:parselabel(@inkscape:label)/widget"; |
198 | "«$desc/arg[1]/@value»": { |
214 | "«$desc/arg[1]/@value»": { |
199 | id: "«@id»" |
215 | id: "«@id»", |
200 | widgets: [ |
216 | widgets: [ |
201 const "page", "."; |
217 const "page", "."; |
202 const "p", "$hmi_geometry[@Id = $page/@id]"; |
218 const "p", "$hmi_geometry[@Id = $page/@id]"; |
203 foreach """$hmi_geometry[@Id != $page/@id and |
219 foreach """$hmi_geometry[@Id != $page/@id and |
204 @x >= $p/@x and @y >= $p/@y and |
220 @x >= $p/@x and @y >= $p/@y and |