482 */ |
482 */ |
483 |
483 |
484 | var hmi_widgets = { |
484 | var hmi_widgets = { |
485 foreach "$hmi_elements" { |
485 foreach "$hmi_elements" { |
486 const "widget", "func:parselabel(@inkscape:label)/widget"; |
486 const "widget", "func:parselabel(@inkscape:label)/widget"; |
487 | "«@id»": { |
487 | "«@id»": { |
488 | type: "«$widget/@type»", |
488 | type: "«$widget/@type»", |
489 | args: [ |
489 | args: [ |
490 foreach "$widget/arg" |
490 foreach "$widget/arg" |
491 | "«@value»"`if "position()!=last()" > ,` |
491 | "«@value»"`if "position()!=last()" > ,` |
492 | ], |
492 | ], |
493 | indexes: [ |
493 | indexes: [ |
494 foreach "$widget/path" { |
494 foreach "$widget/path" { |
495 const "hmipath","@value"; |
495 const "hmipath","@value"; |
496 const "hmitree_match","$indexed_hmitree/*[@hmipath = $hmipath]"; |
496 const "hmitree_match","$indexed_hmitree/*[@hmipath = $hmipath]"; |
497 choose { |
497 choose { |
498 when "count($hmitree_match) = 0" { |
498 when "count($hmitree_match) = 0" { |
499 warning > No match for path "«$hmipath»" in HMI tree |
499 warning > No match for path "«$hmipath»" in HMI tree |
500 } |
500 } |
501 otherwise { |
501 otherwise { |
502 | «$hmitree_match/@index»`if "position()!=last()" > ,` |
502 | «$hmitree_match/@index»`if "position()!=last()" > ,` |
503 } |
503 } |
504 } |
504 } |
505 } |
505 } |
506 | ], |
506 | ], |
507 | element: id("«@id»"), |
507 | element: id("«@id»"), |
508 apply "$widget", mode="widget_defs" with "hmi_element","."; |
508 apply "$widget", mode="widget_defs" with "hmi_element","."; |
509 | }`if "position()!=last()" > ,` |
509 | }`if "position()!=last()" > ,` |
510 } |
510 } |
511 | } |
511 | } |
512 | |
512 | |
513 | var heartbeat_index = «$indexed_hmitree/*[@hmipath = '/HEARTBEAT']/@index»; |
513 | var heartbeat_index = «$indexed_hmitree/*[@hmipath = '/HEARTBEAT']/@index»; |
514 | |
514 | |
515 | var hmitree_types = [ |
515 | var hmitree_types = [ |
516 |
516 |
517 foreach "$indexed_hmitree/*" { |
517 foreach "$indexed_hmitree/*" { |
518 | /* «@index» «@hmipath» */ "«substring(local-name(), 5)»"`if "position()!=last()" > ,` |
518 | /* «@index» «@hmipath» */ "«substring(local-name(), 5)»"`if "position()!=last()" > ,` |
519 } |
519 } |
520 |
520 |
521 | ] |
521 | ] |
522 | |
522 | |
523 |
523 |