svghmi/detachable_pages.ysl2
author Edouard Tisserant <edouard.tisserant@gmail.com>
Wed, 19 Oct 2022 20:53:01 +0200
branchwxPython4
changeset 3635 5107a2712b17
parent 3622 98ce26040117
child 3653 d5ff60e906b0
permissions -rw-r--r--
Update README.md
2885
f398896b7ebf SVGHMI: intermediate untested state. Excluded ForEach widget from pages handled widgets.
Edouard Tisserant
parents: 2877
diff changeset
     1
// detachable_pages.ysl2
2875
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
     2
//
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
     3
// compute what elements are required by pages
2887
30cea13267b4 SVGHMI: cosmetic changes
Edouard Tisserant
parents: 2886
diff changeset
     4
// and decide where to cut when removing/attaching
2875
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
     5
// pages elements on page switch
2779
75c6a31caca6 SVGHMI: Work In Progress : fixed pointer types in ctypes interface, cleaned up server startup and cleanup code, changed document type to XHTML, cleaner JS script : encapsulated in a function and in CDATA.
Edouard Tisserant
parents: 2763
diff changeset
     6
2887
30cea13267b4 SVGHMI: cosmetic changes
Edouard Tisserant
parents: 2886
diff changeset
     7
const "hmi_pages_descs", "$parsed_widgets/widget[@type = 'Page']";
30cea13267b4 SVGHMI: cosmetic changes
Edouard Tisserant
parents: 2886
diff changeset
     8
const "hmi_pages", "$hmi_elements[@id = $hmi_pages_descs/@id]";
2877
682bce953795 SVGHMI: detachable_elements.ysl2 becomes detachable_pages.ysl2, and includes logic to process pages elements. Other minor code moves.
Edouard Tisserant
parents: 2876
diff changeset
     9
682bce953795 SVGHMI: detachable_elements.ysl2 becomes detachable_pages.ysl2, and includes logic to process pages elements. Other minor code moves.
Edouard Tisserant
parents: 2876
diff changeset
    10
const "default_page" choose {
682bce953795 SVGHMI: detachable_elements.ysl2 becomes detachable_pages.ysl2, and includes logic to process pages elements. Other minor code moves.
Edouard Tisserant
parents: 2876
diff changeset
    11
    when "count($hmi_pages) > 1" {
682bce953795 SVGHMI: detachable_elements.ysl2 becomes detachable_pages.ysl2, and includes logic to process pages elements. Other minor code moves.
Edouard Tisserant
parents: 2876
diff changeset
    12
        choose {
2887
30cea13267b4 SVGHMI: cosmetic changes
Edouard Tisserant
parents: 2886
diff changeset
    13
            when "$hmi_pages_descs/arg[1]/@value = 'Home'" > Home
2877
682bce953795 SVGHMI: detachable_elements.ysl2 becomes detachable_pages.ysl2, and includes logic to process pages elements. Other minor code moves.
Edouard Tisserant
parents: 2876
diff changeset
    14
            otherwise {
3117
f058542d0caa SVGHMI: Make an error when pages are nested
Edouard Tisserant
parents: 3107
diff changeset
    15
                error > No Home page defined!
2877
682bce953795 SVGHMI: detachable_elements.ysl2 becomes detachable_pages.ysl2, and includes logic to process pages elements. Other minor code moves.
Edouard Tisserant
parents: 2876
diff changeset
    16
            }
682bce953795 SVGHMI: detachable_elements.ysl2 becomes detachable_pages.ysl2, and includes logic to process pages elements. Other minor code moves.
Edouard Tisserant
parents: 2876
diff changeset
    17
        }
682bce953795 SVGHMI: detachable_elements.ysl2 becomes detachable_pages.ysl2, and includes logic to process pages elements. Other minor code moves.
Edouard Tisserant
parents: 2876
diff changeset
    18
    }
682bce953795 SVGHMI: detachable_elements.ysl2 becomes detachable_pages.ysl2, and includes logic to process pages elements. Other minor code moves.
Edouard Tisserant
parents: 2876
diff changeset
    19
    when "count($hmi_pages) = 0" {
3117
f058542d0caa SVGHMI: Make an error when pages are nested
Edouard Tisserant
parents: 3107
diff changeset
    20
        error > No page defined!
2877
682bce953795 SVGHMI: detachable_elements.ysl2 becomes detachable_pages.ysl2, and includes logic to process pages elements. Other minor code moves.
Edouard Tisserant
parents: 2876
diff changeset
    21
    }
2886
6c82fad8be65 SVGHMI: Simplification and optimization. func:parselabel becomes a template.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2885
diff changeset
    22
    otherwise > «func:widget($hmi_pages/@id)/arg[1]/@value»
2877
682bce953795 SVGHMI: detachable_elements.ysl2 becomes detachable_pages.ysl2, and includes logic to process pages elements. Other minor code moves.
Edouard Tisserant
parents: 2876
diff changeset
    23
}
682bce953795 SVGHMI: detachable_elements.ysl2 becomes detachable_pages.ysl2, and includes logic to process pages elements. Other minor code moves.
Edouard Tisserant
parents: 2876
diff changeset
    24
2941
ef13a4007538 SVGHMI: spread JS code from svghmi/scripts.ysl2 in other .ysl2 files, using dedicated preamble and epilogue namespaces
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2940
diff changeset
    25
emit "preamble:default-page" {
ef13a4007538 SVGHMI: spread JS code from svghmi/scripts.ysl2 in other .ysl2 files, using dedicated preamble and epilogue namespaces
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2940
diff changeset
    26
    |
ef13a4007538 SVGHMI: spread JS code from svghmi/scripts.ysl2 in other .ysl2 files, using dedicated preamble and epilogue namespaces
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2940
diff changeset
    27
    | var default_page = "«$default_page»";
ef13a4007538 SVGHMI: spread JS code from svghmi/scripts.ysl2 in other .ysl2 files, using dedicated preamble and epilogue namespaces
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2940
diff changeset
    28
}
ef13a4007538 SVGHMI: spread JS code from svghmi/scripts.ysl2 in other .ysl2 files, using dedicated preamble and epilogue namespaces
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2940
diff changeset
    29
ef13a4007538 SVGHMI: spread JS code from svghmi/scripts.ysl2 in other .ysl2 files, using dedicated preamble and epilogue namespaces
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2940
diff changeset
    30
const "keypads_descs", "$parsed_widgets/widget[@type = 'Keypad']";
ef13a4007538 SVGHMI: spread JS code from svghmi/scripts.ysl2 in other .ysl2 files, using dedicated preamble and epilogue namespaces
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2940
diff changeset
    31
const "keypads", "$hmi_elements[@id = $keypads_descs/@id]";
ef13a4007538 SVGHMI: spread JS code from svghmi/scripts.ysl2 in other .ysl2 files, using dedicated preamble and epilogue namespaces
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2940
diff changeset
    32
2875
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    33
// returns all directly or indirectly refered elements
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    34
def "func:refered_elements" {
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    35
    param "elems";
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    36
    const "descend", "$elems/descendant-or-self::svg:*";
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    37
    const "clones", "$descend[self::svg:use]";
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    38
    const "originals", "//svg:*[concat('#',@id) = $clones/@xlink:href]";
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    39
    choose {
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    40
        when "$originals"
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    41
            result "$descend | func:refered_elements($originals)";
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    42
        otherwise
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    43
            result "$descend";
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    44
    }
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    45
}
2792
0c0d3895b036 SVGHMI: moved/fixed some templates, avoided namespace problems, added parsing of HMI:* inkscape labels
Edouard Tisserant
parents: 2791
diff changeset
    46
3165
2db69e2c5673 SVGHMI: Optimized overlapping geometry (widget ot page belonging) computation. Added human readable messages for progress. Includes updated XSLT.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3161
diff changeset
    47
// variable "overlapping_geometry" was added for optimization.
2db69e2c5673 SVGHMI: Optimized overlapping geometry (widget ot page belonging) computation. Added human readable messages for progress. Includes updated XSLT.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3161
diff changeset
    48
// It avoids calling func:overlapping_geometry 3 times for each page
2db69e2c5673 SVGHMI: Optimized overlapping geometry (widget ot page belonging) computation. Added human readable messages for progress. Includes updated XSLT.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3161
diff changeset
    49
// (apparently libxml doesn't cache exslt function results)
2db69e2c5673 SVGHMI: Optimized overlapping geometry (widget ot page belonging) computation. Added human readable messages for progress. Includes updated XSLT.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3161
diff changeset
    50
// in order to optimize further, func:overlapping_geometry 
2db69e2c5673 SVGHMI: Optimized overlapping geometry (widget ot page belonging) computation. Added human readable messages for progress. Includes updated XSLT.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3161
diff changeset
    51
// should be implemented in python or even C,
2db69e2c5673 SVGHMI: Optimized overlapping geometry (widget ot page belonging) computation. Added human readable messages for progress. Includes updated XSLT.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3161
diff changeset
    52
// as this is still the main bottleneck here
2db69e2c5673 SVGHMI: Optimized overlapping geometry (widget ot page belonging) computation. Added human readable messages for progress. Includes updated XSLT.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3161
diff changeset
    53
const "_overlapping_geometry" {
2db69e2c5673 SVGHMI: Optimized overlapping geometry (widget ot page belonging) computation. Added human readable messages for progress. Includes updated XSLT.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3161
diff changeset
    54
    foreach "$hmi_pages | $keypads" {
3170
aaa203270ab0 SVGHMI: Make build log less redundant, and refactor progress information code a bit, to make it also a bit less redundant.
Edouard Tisserant
parents: 3165
diff changeset
    55
        const "k", "concat('overlapping:', @id)";
aaa203270ab0 SVGHMI: Make build log less redundant, and refactor progress information code a bit, to make it also a bit less redundant.
Edouard Tisserant
parents: 3165
diff changeset
    56
        value "ns:ProgressStart($k, concat('collecting membership of ', @inkscape:label))";
3165
2db69e2c5673 SVGHMI: Optimized overlapping geometry (widget ot page belonging) computation. Added human readable messages for progress. Includes updated XSLT.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3161
diff changeset
    57
        elt {
2db69e2c5673 SVGHMI: Optimized overlapping geometry (widget ot page belonging) computation. Added human readable messages for progress. Includes updated XSLT.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3161
diff changeset
    58
            attrib "id" > «@id»
2db69e2c5673 SVGHMI: Optimized overlapping geometry (widget ot page belonging) computation. Added human readable messages for progress. Includes updated XSLT.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3161
diff changeset
    59
            copy "func:overlapping_geometry(.)";
2db69e2c5673 SVGHMI: Optimized overlapping geometry (widget ot page belonging) computation. Added human readable messages for progress. Includes updated XSLT.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3161
diff changeset
    60
        }
3170
aaa203270ab0 SVGHMI: Make build log less redundant, and refactor progress information code a bit, to make it also a bit less redundant.
Edouard Tisserant
parents: 3165
diff changeset
    61
        value "ns:ProgressEnd($k)";
aaa203270ab0 SVGHMI: Make build log less redundant, and refactor progress information code a bit, to make it also a bit less redundant.
Edouard Tisserant
parents: 3165
diff changeset
    62
    }
3165
2db69e2c5673 SVGHMI: Optimized overlapping geometry (widget ot page belonging) computation. Added human readable messages for progress. Includes updated XSLT.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3161
diff changeset
    63
}
2db69e2c5673 SVGHMI: Optimized overlapping geometry (widget ot page belonging) computation. Added human readable messages for progress. Includes updated XSLT.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3161
diff changeset
    64
2db69e2c5673 SVGHMI: Optimized overlapping geometry (widget ot page belonging) computation. Added human readable messages for progress. Includes updated XSLT.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3161
diff changeset
    65
const "overlapping_geometry", "exsl:node-set($_overlapping_geometry)";
2db69e2c5673 SVGHMI: Optimized overlapping geometry (widget ot page belonging) computation. Added human readable messages for progress. Includes updated XSLT.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3161
diff changeset
    66
2875
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    67
def "func:all_related_elements" {
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    68
    param "page";
3165
2db69e2c5673 SVGHMI: Optimized overlapping geometry (widget ot page belonging) computation. Added human readable messages for progress. Includes updated XSLT.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3161
diff changeset
    69
    const "page_overlapping_geometry", "$overlapping_geometry/elt[@id = $page/@id]/*";
2875
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    70
    const "page_overlapping_elements", "//svg:*[@id = $page_overlapping_geometry/@Id]";
3622
98ce26040117 SVGHMI: do not discard out-of-page elements inside widgets that are ovelapping pages.
Edouard Tisserant
parents: 3384
diff changeset
    71
    const "page_widgets_elements", """
98ce26040117 SVGHMI: do not discard out-of-page elements inside widgets that are ovelapping pages.
Edouard Tisserant
parents: 3384
diff changeset
    72
        $hmi_elements[not(@id=$page/@id)
98ce26040117 SVGHMI: do not discard out-of-page elements inside widgets that are ovelapping pages.
Edouard Tisserant
parents: 3384
diff changeset
    73
                      and descendant-or-self::svg:*/@id = $page_overlapping_elements/@id]
98ce26040117 SVGHMI: do not discard out-of-page elements inside widgets that are ovelapping pages.
Edouard Tisserant
parents: 3384
diff changeset
    74
        /descendant-or-self::svg:*""";
98ce26040117 SVGHMI: do not discard out-of-page elements inside widgets that are ovelapping pages.
Edouard Tisserant
parents: 3384
diff changeset
    75
    const "page_sub_elements", "func:refered_elements($page | $page_overlapping_elements | $page_widgets_elements)";
2875
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    76
    result "$page_sub_elements";
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    77
}
2808
dc78ffa5253d SVGHMI: SVG viewport now defined so that HMI take scales and fit to the view. Implemented page switch through viewport change, no hiding of widget for now.
Edouard Tisserant
parents: 2807
diff changeset
    78
3165
2db69e2c5673 SVGHMI: Optimized overlapping geometry (widget ot page belonging) computation. Added human readable messages for progress. Includes updated XSLT.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3161
diff changeset
    79
2875
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    80
def "func:required_elements" {
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    81
    param "pages"; 
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    82
    choose{
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    83
        when "$pages"{
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    84
            result """func:all_related_elements($pages[1])
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    85
                      | func:required_elements($pages[position()!=1])""";
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    86
        }otherwise{
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    87
            result "/..";
2844
eee5dcd9fc92 SVGHMI: detachable and discardable elements sets, Reworked geometric intersection, toward more accurate page content detection.
Edouard Tisserant
parents: 2843
diff changeset
    88
        }
eee5dcd9fc92 SVGHMI: detachable and discardable elements sets, Reworked geometric intersection, toward more accurate page content detection.
Edouard Tisserant
parents: 2843
diff changeset
    89
    }
2875
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    90
}
2844
eee5dcd9fc92 SVGHMI: detachable and discardable elements sets, Reworked geometric intersection, toward more accurate page content detection.
Edouard Tisserant
parents: 2843
diff changeset
    91
3186
1e9b9d7451cd SVGHMI: Ensure that when a HMI:List is refered, none of its refered elements are discarded.
Edouard Tisserant
parents: 3170
diff changeset
    92
const "required_page_elements",
1e9b9d7451cd SVGHMI: Ensure that when a HMI:List is refered, none of its refered elements are discarded.
Edouard Tisserant
parents: 3170
diff changeset
    93
    "func:required_elements($hmi_pages | $keypads)/ancestor-or-self::svg:*";
1e9b9d7451cd SVGHMI: Ensure that when a HMI:List is refered, none of its refered elements are discarded.
Edouard Tisserant
parents: 3170
diff changeset
    94
3384
bd337d21f686 SVGHMI: changes that should fix some corner cases about unlinking and discardable element that still didn't show until now.
Edouard Tisserant
parents: 3381
diff changeset
    95
const "required_list_elements", "func:refered_elements(($hmi_lists | $hmi_textlists)[@id = $required_page_elements/@id])/ancestor-or-self::svg:*";
3186
1e9b9d7451cd SVGHMI: Ensure that when a HMI:List is refered, none of its refered elements are discarded.
Edouard Tisserant
parents: 3170
diff changeset
    96
3199
1582753e409b SVGHMI: Filter unseen geometry from inkscape CSV output.
Edouard Tisserant
parents: 3186
diff changeset
    97
const "required_elements", "$defs | $required_list_elements | $required_page_elements";
2873
022db76c3bff SVGHMI : create hmi_tree.ysl2, rename bbox_intersect.ysl2 into geometry.ysl2 and move more code into. Add per included ysl2 file debug output.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2872
diff changeset
    98
2875
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    99
const "discardable_elements", "//svg:*[not(@id = $required_elements/@id)]";
2844
eee5dcd9fc92 SVGHMI: detachable and discardable elements sets, Reworked geometric intersection, toward more accurate page content detection.
Edouard Tisserant
parents: 2843
diff changeset
   100
2875
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
   101
def "func:sumarized_elements" {
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
   102
    param "elements";
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
   103
    const "short_list", "$elements[not(ancestor::*/@id = $elements/@id)]";
3161
edd558965f58 SVGHMI: Optimize sumarized_elements xslt function, taking most of SVGHMI build time.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3121
diff changeset
   104
    const "filled_groups", """$short_list/parent::*[
edd558965f58 SVGHMI: Optimize sumarized_elements xslt function, taking most of SVGHMI build time.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3121
diff changeset
   105
        not(child::*[
2875
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
   106
            not(@id = $discardable_elements/@id) and
3161
edd558965f58 SVGHMI: Optimize sumarized_elements xslt function, taking most of SVGHMI build time.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3121
diff changeset
   107
            not(@id = $short_list/@id)
2875
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
   108
        ])]""";
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
   109
    const "groups_to_add", "$filled_groups[not(ancestor::*/@id = $filled_groups/@id)]";
3161
edd558965f58 SVGHMI: Optimize sumarized_elements xslt function, taking most of SVGHMI build time.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3121
diff changeset
   110
    result "$groups_to_add | $short_list[not(ancestor::*/@id = $filled_groups/@id)]";
2875
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
   111
}
2844
eee5dcd9fc92 SVGHMI: detachable and discardable elements sets, Reworked geometric intersection, toward more accurate page content detection.
Edouard Tisserant
parents: 2843
diff changeset
   112
2875
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
   113
def "func:detachable_elements" {
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
   114
    param "pages";
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
   115
    choose{
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
   116
        when "$pages"{
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
   117
            result """func:sumarized_elements(func:all_related_elements($pages[1]))
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
   118
                      | func:detachable_elements($pages[position()!=1])""";
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
   119
        }otherwise{
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
   120
            result "/..";
2846
7b1db17287b6 SVGHMI: now compute discardable elements first so that we can do better grouping of required elements when sumarizing.
Edouard Tisserant
parents: 2845
diff changeset
   121
        }
7b1db17287b6 SVGHMI: now compute discardable elements first so that we can do better grouping of required elements when sumarizing.
Edouard Tisserant
parents: 2845
diff changeset
   122
    }
2875
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
   123
}
2846
7b1db17287b6 SVGHMI: now compute discardable elements first so that we can do better grouping of required elements when sumarizing.
Edouard Tisserant
parents: 2845
diff changeset
   124
2875
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
   125
// Avoid nested detachables
2911
211d6a185e31 SVGHMI: More infrastructure for editing values with a keypad.
Edouard Tisserant
parents: 2904
diff changeset
   126
const "_detachable_elements", "func:detachable_elements($hmi_pages | $keypads)";
2875
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
   127
const "detachable_elements", "$_detachable_elements[not(ancestor::*/@id = $_detachable_elements/@id)]";
2846
7b1db17287b6 SVGHMI: now compute discardable elements first so that we can do better grouping of required elements when sumarizing.
Edouard Tisserant
parents: 2845
diff changeset
   128
2943
304e88bae115 SVGHMI: added more meaningful namespaces to emit javascript code from.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2941
diff changeset
   129
emit "declarations:detachable-elements" {
2941
ef13a4007538 SVGHMI: spread JS code from svghmi/scripts.ysl2 in other .ysl2 files, using dedicated preamble and epilogue namespaces
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2940
diff changeset
   130
    |
ef13a4007538 SVGHMI: spread JS code from svghmi/scripts.ysl2 in other .ysl2 files, using dedicated preamble and epilogue namespaces
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2940
diff changeset
   131
    | var detachable_elements = {
ef13a4007538 SVGHMI: spread JS code from svghmi/scripts.ysl2 in other .ysl2 files, using dedicated preamble and epilogue namespaces
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2940
diff changeset
   132
    foreach "$detachable_elements"{
ef13a4007538 SVGHMI: spread JS code from svghmi/scripts.ysl2 in other .ysl2 files, using dedicated preamble and epilogue namespaces
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2940
diff changeset
   133
    |     "«@id»":[id("«@id»"), id("«../@id»")]`if "position()!=last()" > ,`
ef13a4007538 SVGHMI: spread JS code from svghmi/scripts.ysl2 in other .ysl2 files, using dedicated preamble and epilogue namespaces
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2940
diff changeset
   134
    }
ef13a4007538 SVGHMI: spread JS code from svghmi/scripts.ysl2 in other .ysl2 files, using dedicated preamble and epilogue namespaces
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2940
diff changeset
   135
    | }
ef13a4007538 SVGHMI: spread JS code from svghmi/scripts.ysl2 in other .ysl2 files, using dedicated preamble and epilogue namespaces
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2940
diff changeset
   136
}
ef13a4007538 SVGHMI: spread JS code from svghmi/scripts.ysl2 in other .ysl2 files, using dedicated preamble and epilogue namespaces
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2940
diff changeset
   137
2888
7beddc62a388 SVGHMI: Exclude (again) sub-widgets of forEach widget from page-switch managed widget.
Edouard Tisserant
parents: 2887
diff changeset
   138
const "forEach_widgets_ids", "$parsed_widgets/widget[@type = 'ForEach']/@id";
3121
8094494113b6 SVGHMI: Prevent excluded widget to appear in generated pages' widget list.
Edouard Tisserant
parents: 3117
diff changeset
   139
const "forEach_widgets", "$hmi_widgets[@id = $forEach_widgets_ids]";
2888
7beddc62a388 SVGHMI: Exclude (again) sub-widgets of forEach widget from page-switch managed widget.
Edouard Tisserant
parents: 2887
diff changeset
   140
const "in_forEach_widget_ids", "func:refered_elements($forEach_widgets)[not(@id = $forEach_widgets_ids)]/@id";
7beddc62a388 SVGHMI: Exclude (again) sub-widgets of forEach widget from page-switch managed widget.
Edouard Tisserant
parents: 2887
diff changeset
   141
2877
682bce953795 SVGHMI: detachable_elements.ysl2 becomes detachable_pages.ysl2, and includes logic to process pages elements. Other minor code moves.
Edouard Tisserant
parents: 2876
diff changeset
   142
template "svg:*", mode="page_desc" {
3117
f058542d0caa SVGHMI: Make an error when pages are nested
Edouard Tisserant
parents: 3107
diff changeset
   143
    if "ancestor::*[@id = $hmi_pages/@id]" error > HMI:Page «@id» is nested in another HMI:Page
f058542d0caa SVGHMI: Make an error when pages are nested
Edouard Tisserant
parents: 3107
diff changeset
   144
3165
2db69e2c5673 SVGHMI: Optimized overlapping geometry (widget ot page belonging) computation. Added human readable messages for progress. Includes updated XSLT.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3161
diff changeset
   145
2886
6c82fad8be65 SVGHMI: Simplification and optimization. func:parselabel becomes a template.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2885
diff changeset
   146
    const "desc", "func:widget(@id)";
3170
aaa203270ab0 SVGHMI: Make build log less redundant, and refactor progress information code a bit, to make it also a bit less redundant.
Edouard Tisserant
parents: 3165
diff changeset
   147
    const "pagename", "$desc/arg[1]/@value";
aaa203270ab0 SVGHMI: Make build log less redundant, and refactor progress information code a bit, to make it also a bit less redundant.
Edouard Tisserant
parents: 3165
diff changeset
   148
    const "msg", "concat('generating page description ', $pagename)";
aaa203270ab0 SVGHMI: Make build log less redundant, and refactor progress information code a bit, to make it also a bit less redundant.
Edouard Tisserant
parents: 3165
diff changeset
   149
    value "ns:ProgressStart($pagename, $msg)";
2877
682bce953795 SVGHMI: detachable_elements.ysl2 becomes detachable_pages.ysl2, and includes logic to process pages elements. Other minor code moves.
Edouard Tisserant
parents: 2876
diff changeset
   150
    const "page", ".";
682bce953795 SVGHMI: detachable_elements.ysl2 becomes detachable_pages.ysl2, and includes logic to process pages elements. Other minor code moves.
Edouard Tisserant
parents: 2876
diff changeset
   151
    const "p", "$geometry[@Id = $page/@id]";
682bce953795 SVGHMI: detachable_elements.ysl2 becomes detachable_pages.ysl2, and includes logic to process pages elements. Other minor code moves.
Edouard Tisserant
parents: 2876
diff changeset
   152
682bce953795 SVGHMI: detachable_elements.ysl2 becomes detachable_pages.ysl2, and includes logic to process pages elements. Other minor code moves.
Edouard Tisserant
parents: 2876
diff changeset
   153
    const "page_all_elements", "func:all_related_elements($page)";
682bce953795 SVGHMI: detachable_elements.ysl2 becomes detachable_pages.ysl2, and includes logic to process pages elements. Other minor code moves.
Edouard Tisserant
parents: 2876
diff changeset
   154
3121
8094494113b6 SVGHMI: Prevent excluded widget to appear in generated pages' widget list.
Edouard Tisserant
parents: 3117
diff changeset
   155
    const "all_page_widgets","$hmi_widgets[@id = $page_all_elements/@id and @id != $page/@id]";
2901
3f5194bba67d SVGHMI: Jump widget now make errors if path given for relative jump doesn't match target page reference path class.
Edouard Tisserant
parents: 2894
diff changeset
   156
    const "page_managed_widgets","$all_page_widgets[not(@id=$in_forEach_widget_ids)]";
2877
682bce953795 SVGHMI: detachable_elements.ysl2 becomes detachable_pages.ysl2, and includes logic to process pages elements. Other minor code moves.
Edouard Tisserant
parents: 2876
diff changeset
   157
    const "page_relative_widgets",
2901
3f5194bba67d SVGHMI: Jump widget now make errors if path given for relative jump doesn't match target page reference path class.
Edouard Tisserant
parents: 2894
diff changeset
   158
        "$page_managed_widgets[func:is_descendant_path(func:widget(@id)/path/@value, $desc/path/@value)]";
2877
682bce953795 SVGHMI: detachable_elements.ysl2 becomes detachable_pages.ysl2, and includes logic to process pages elements. Other minor code moves.
Edouard Tisserant
parents: 2876
diff changeset
   159
682bce953795 SVGHMI: detachable_elements.ysl2 becomes detachable_pages.ysl2, and includes logic to process pages elements. Other minor code moves.
Edouard Tisserant
parents: 2876
diff changeset
   160
    // Take closest ancestor in detachable_elements
682bce953795 SVGHMI: detachable_elements.ysl2 becomes detachable_pages.ysl2, and includes logic to process pages elements. Other minor code moves.
Edouard Tisserant
parents: 2876
diff changeset
   161
    // since nested detachable elements are filtered out
3165
2db69e2c5673 SVGHMI: Optimized overlapping geometry (widget ot page belonging) computation. Added human readable messages for progress. Includes updated XSLT.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3161
diff changeset
   162
    const "sumarized_page", 
2db69e2c5673 SVGHMI: Optimized overlapping geometry (widget ot page belonging) computation. Added human readable messages for progress. Includes updated XSLT.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3161
diff changeset
   163
        """func:sumarized_elements($page_all_elements)""";
2db69e2c5673 SVGHMI: Optimized overlapping geometry (widget ot page belonging) computation. Added human readable messages for progress. Includes updated XSLT.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3161
diff changeset
   164
2877
682bce953795 SVGHMI: detachable_elements.ysl2 becomes detachable_pages.ysl2, and includes logic to process pages elements. Other minor code moves.
Edouard Tisserant
parents: 2876
diff changeset
   165
    const "required_detachables", 
3165
2db69e2c5673 SVGHMI: Optimized overlapping geometry (widget ot page belonging) computation. Added human readable messages for progress. Includes updated XSLT.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3161
diff changeset
   166
        """$sumarized_page/
2877
682bce953795 SVGHMI: detachable_elements.ysl2 becomes detachable_pages.ysl2, and includes logic to process pages elements. Other minor code moves.
Edouard Tisserant
parents: 2876
diff changeset
   167
           ancestor-or-self::*[@id = $detachable_elements/@id]""";
682bce953795 SVGHMI: detachable_elements.ysl2 becomes detachable_pages.ysl2, and includes logic to process pages elements. Other minor code moves.
Edouard Tisserant
parents: 2876
diff changeset
   168
3170
aaa203270ab0 SVGHMI: Make build log less redundant, and refactor progress information code a bit, to make it also a bit less redundant.
Edouard Tisserant
parents: 3165
diff changeset
   169
    |   "«$pagename»": {
2955
64e603b84aa3 SVGHMI: Exclude non-widget HMI:* labeled elements from hmi_widget. Namely : HMI:Page HMI:Lang and HMI:List have been excluded.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
   170
    //|     widget: hmi_widgets["«@id»"],
2877
682bce953795 SVGHMI: detachable_elements.ysl2 becomes detachable_pages.ysl2, and includes logic to process pages elements. Other minor code moves.
Edouard Tisserant
parents: 2876
diff changeset
   171
    |     bbox: [«$p/@x», «$p/@y», «$p/@w», «$p/@h»],
682bce953795 SVGHMI: detachable_elements.ysl2 becomes detachable_pages.ysl2, and includes logic to process pages elements. Other minor code moves.
Edouard Tisserant
parents: 2876
diff changeset
   172
    if "$desc/path/@value" {
682bce953795 SVGHMI: detachable_elements.ysl2 becomes detachable_pages.ysl2, and includes logic to process pages elements. Other minor code moves.
Edouard Tisserant
parents: 2876
diff changeset
   173
        if "count($desc/path/@index)=0"
682bce953795 SVGHMI: detachable_elements.ysl2 becomes detachable_pages.ysl2, and includes logic to process pages elements. Other minor code moves.
Edouard Tisserant
parents: 2876
diff changeset
   174
            warning > Page id="«$page/@id»" : No match for path "«$desc/path/@value»" in HMI tree
682bce953795 SVGHMI: detachable_elements.ysl2 becomes detachable_pages.ysl2, and includes logic to process pages elements. Other minor code moves.
Edouard Tisserant
parents: 2876
diff changeset
   175
    |     page_index: «$desc/path/@index»,
3381
3a0908b0319d SVGHMI: add CURRENT_PAGE_{location} global variable to reflect currently visible page. If PLC wites some valid page reference in that variable, it triggers page switch. Additionally, fixed /HEARTBEAT being subscribed systematically by JS code even when wtchdog is not enabled.
Edouard Tisserant
parents: 3352
diff changeset
   176
    |     page_class: "«$indexed_hmitree/*[@hmipath = $desc/path/@value]/@class»",
2877
682bce953795 SVGHMI: detachable_elements.ysl2 becomes detachable_pages.ysl2, and includes logic to process pages elements. Other minor code moves.
Edouard Tisserant
parents: 2876
diff changeset
   177
    }
3005
ff9ae4f4e3be SVGHMI: widgets are not anymore binary relative or absolute, but have a "relativeness".
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2955
diff changeset
   178
    |     widgets: [
ff9ae4f4e3be SVGHMI: widgets are not anymore binary relative or absolute, but have a "relativeness".
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2955
diff changeset
   179
    foreach "$page_managed_widgets" {
ff9ae4f4e3be SVGHMI: widgets are not anymore binary relative or absolute, but have a "relativeness".
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2955
diff changeset
   180
        const "widget_paths_relativeness" 
ff9ae4f4e3be SVGHMI: widgets are not anymore binary relative or absolute, but have a "relativeness".
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2955
diff changeset
   181
            foreach "func:widget(@id)/path" {
ff9ae4f4e3be SVGHMI: widgets are not anymore binary relative or absolute, but have a "relativeness".
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2955
diff changeset
   182
                value "func:is_descendant_path(@value, $desc/path/@value)";
ff9ae4f4e3be SVGHMI: widgets are not anymore binary relative or absolute, but have a "relativeness".
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2955
diff changeset
   183
                if "position()!=last()" > ,
ff9ae4f4e3be SVGHMI: widgets are not anymore binary relative or absolute, but have a "relativeness".
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2955
diff changeset
   184
            }
ff9ae4f4e3be SVGHMI: widgets are not anymore binary relative or absolute, but have a "relativeness".
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2955
diff changeset
   185
    |         [hmi_widgets["«@id»"], [«$widget_paths_relativeness»]]`if "position()!=last()" > ,`
2877
682bce953795 SVGHMI: detachable_elements.ysl2 becomes detachable_pages.ysl2, and includes logic to process pages elements. Other minor code moves.
Edouard Tisserant
parents: 2876
diff changeset
   186
    }
682bce953795 SVGHMI: detachable_elements.ysl2 becomes detachable_pages.ysl2, and includes logic to process pages elements. Other minor code moves.
Edouard Tisserant
parents: 2876
diff changeset
   187
    |     ],
2903
881d0248b3ce SVGHMI: Jump widget can now display as active or inactive, if corresponfing "active" and "inactive labeled elements are provided.
Edouard Tisserant
parents: 2901
diff changeset
   188
    |     jumps: [
881d0248b3ce SVGHMI: Jump widget can now display as active or inactive, if corresponfing "active" and "inactive labeled elements are provided.
Edouard Tisserant
parents: 2901
diff changeset
   189
    foreach "$parsed_widgets/widget[@id = $all_page_widgets/@id and @type='Jump']" {
881d0248b3ce SVGHMI: Jump widget can now display as active or inactive, if corresponfing "active" and "inactive labeled elements are provided.
Edouard Tisserant
parents: 2901
diff changeset
   190
    |         hmi_widgets["«@id»"]`if "position()!=last()" > ,`
881d0248b3ce SVGHMI: Jump widget can now display as active or inactive, if corresponfing "active" and "inactive labeled elements are provided.
Edouard Tisserant
parents: 2901
diff changeset
   191
    }
881d0248b3ce SVGHMI: Jump widget can now display as active or inactive, if corresponfing "active" and "inactive labeled elements are provided.
Edouard Tisserant
parents: 2901
diff changeset
   192
    |     ],
2877
682bce953795 SVGHMI: detachable_elements.ysl2 becomes detachable_pages.ysl2, and includes logic to process pages elements. Other minor code moves.
Edouard Tisserant
parents: 2876
diff changeset
   193
    |     required_detachables: {
682bce953795 SVGHMI: detachable_elements.ysl2 becomes detachable_pages.ysl2, and includes logic to process pages elements. Other minor code moves.
Edouard Tisserant
parents: 2876
diff changeset
   194
    foreach "$required_detachables" {
682bce953795 SVGHMI: detachable_elements.ysl2 becomes detachable_pages.ysl2, and includes logic to process pages elements. Other minor code moves.
Edouard Tisserant
parents: 2876
diff changeset
   195
    |         "«@id»": detachable_elements["«@id»"]`if "position()!=last()" > ,`
682bce953795 SVGHMI: detachable_elements.ysl2 becomes detachable_pages.ysl2, and includes logic to process pages elements. Other minor code moves.
Edouard Tisserant
parents: 2876
diff changeset
   196
    }
682bce953795 SVGHMI: detachable_elements.ysl2 becomes detachable_pages.ysl2, and includes logic to process pages elements. Other minor code moves.
Edouard Tisserant
parents: 2876
diff changeset
   197
    |     }
3232
7bdb766c2a4d SVGHMI: In order to allow widget signature and description to coexist in same ysl2 file, introduced widget_class, widget_defs to declare widget codegen templates and gen_index_xhtml to mark templates that are only usefull in gen_index_xhtml.xslt.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3199
diff changeset
   198
    apply "$parsed_widgets/widget[@id = $all_page_widgets/@id]", mode="widget_page"{
2901
3f5194bba67d SVGHMI: Jump widget now make errors if path given for relative jump doesn't match target page reference path class.
Edouard Tisserant
parents: 2894
diff changeset
   199
        with "page_desc", "$desc";
3f5194bba67d SVGHMI: Jump widget now make errors if path given for relative jump doesn't match target page reference path class.
Edouard Tisserant
parents: 2894
diff changeset
   200
    }
2877
682bce953795 SVGHMI: detachable_elements.ysl2 becomes detachable_pages.ysl2, and includes logic to process pages elements. Other minor code moves.
Edouard Tisserant
parents: 2876
diff changeset
   201
    |   }`if "position()!=last()" > ,`
3170
aaa203270ab0 SVGHMI: Make build log less redundant, and refactor progress information code a bit, to make it also a bit less redundant.
Edouard Tisserant
parents: 3165
diff changeset
   202
    value "ns:ProgressEnd($pagename)";
2877
682bce953795 SVGHMI: detachable_elements.ysl2 becomes detachable_pages.ysl2, and includes logic to process pages elements. Other minor code moves.
Edouard Tisserant
parents: 2876
diff changeset
   203
}
682bce953795 SVGHMI: detachable_elements.ysl2 becomes detachable_pages.ysl2, and includes logic to process pages elements. Other minor code moves.
Edouard Tisserant
parents: 2876
diff changeset
   204
3007
360300a8b995 SVGHMI : have to move some JS declarations from "preamble" to "declarations" and others from "declarations" to "definitions" section to make room for JS libraries that would be used by widget classes.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3005
diff changeset
   205
emit "definitions:page-desc" {
2941
ef13a4007538 SVGHMI: spread JS code from svghmi/scripts.ysl2 in other .ysl2 files, using dedicated preamble and epilogue namespaces
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2940
diff changeset
   206
    |
ef13a4007538 SVGHMI: spread JS code from svghmi/scripts.ysl2 in other .ysl2 files, using dedicated preamble and epilogue namespaces
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2940
diff changeset
   207
    | var page_desc = {
ef13a4007538 SVGHMI: spread JS code from svghmi/scripts.ysl2 in other .ysl2 files, using dedicated preamble and epilogue namespaces
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2940
diff changeset
   208
    apply "$hmi_pages", mode="page_desc";
ef13a4007538 SVGHMI: spread JS code from svghmi/scripts.ysl2 in other .ysl2 files, using dedicated preamble and epilogue namespaces
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2940
diff changeset
   209
    | }
ef13a4007538 SVGHMI: spread JS code from svghmi/scripts.ysl2 in other .ysl2 files, using dedicated preamble and epilogue namespaces
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2940
diff changeset
   210
}
ef13a4007538 SVGHMI: spread JS code from svghmi/scripts.ysl2 in other .ysl2 files, using dedicated preamble and epilogue namespaces
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2940
diff changeset
   211
3232
7bdb766c2a4d SVGHMI: In order to allow widget signature and description to coexist in same ysl2 file, introduced widget_class, widget_defs to declare widget codegen templates and gen_index_xhtml to mark templates that are only usefull in gen_index_xhtml.xslt.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3199
diff changeset
   212
template "*", mode="widget_page";
2901
3f5194bba67d SVGHMI: Jump widget now make errors if path given for relative jump doesn't match target page reference path class.
Edouard Tisserant
parents: 2894
diff changeset
   213
2904
92d115d8828d SVGHMI: collect debug data through xslt reflectivity instead of yml2/python trick
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2903
diff changeset
   214
2940
034b6ce4f885 SVGHMI: Introduced "emit" to simplify producing per-topic code and content from anywhere in code. Applied to debug output, next to JS.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2939
diff changeset
   215
emit "debug:detachable-pages" {
2941
ef13a4007538 SVGHMI: spread JS code from svghmi/scripts.ysl2 in other .ysl2 files, using dedicated preamble and epilogue namespaces
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2940
diff changeset
   216
    |
2888
7beddc62a388 SVGHMI: Exclude (again) sub-widgets of forEach widget from page-switch managed widget.
Edouard Tisserant
parents: 2887
diff changeset
   217
    | DETACHABLES:
2876
d2adbc273125 SVGHMI: moved debug code
Edouard Tisserant
parents: 2875
diff changeset
   218
    foreach "$detachable_elements"{
d2adbc273125 SVGHMI: moved debug code
Edouard Tisserant
parents: 2875
diff changeset
   219
        |  «@id»
d2adbc273125 SVGHMI: moved debug code
Edouard Tisserant
parents: 2875
diff changeset
   220
    }
3622
98ce26040117 SVGHMI: do not discard out-of-page elements inside widgets that are ovelapping pages.
Edouard Tisserant
parents: 3384
diff changeset
   221
    | DISCARDABLES:
98ce26040117 SVGHMI: do not discard out-of-page elements inside widgets that are ovelapping pages.
Edouard Tisserant
parents: 3384
diff changeset
   222
    foreach "$discardable_elements"{
98ce26040117 SVGHMI: do not discard out-of-page elements inside widgets that are ovelapping pages.
Edouard Tisserant
parents: 3384
diff changeset
   223
        |  «@id»
98ce26040117 SVGHMI: do not discard out-of-page elements inside widgets that are ovelapping pages.
Edouard Tisserant
parents: 3384
diff changeset
   224
    }
2888
7beddc62a388 SVGHMI: Exclude (again) sub-widgets of forEach widget from page-switch managed widget.
Edouard Tisserant
parents: 2887
diff changeset
   225
    | In Foreach:
7beddc62a388 SVGHMI: Exclude (again) sub-widgets of forEach widget from page-switch managed widget.
Edouard Tisserant
parents: 2887
diff changeset
   226
    foreach "$in_forEach_widget_ids"{
7beddc62a388 SVGHMI: Exclude (again) sub-widgets of forEach widget from page-switch managed widget.
Edouard Tisserant
parents: 2887
diff changeset
   227
        |  «.»
7beddc62a388 SVGHMI: Exclude (again) sub-widgets of forEach widget from page-switch managed widget.
Edouard Tisserant
parents: 2887
diff changeset
   228
    }
3165
2db69e2c5673 SVGHMI: Optimized overlapping geometry (widget ot page belonging) computation. Added human readable messages for progress. Includes updated XSLT.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3161
diff changeset
   229
    | Overlapping 
2db69e2c5673 SVGHMI: Optimized overlapping geometry (widget ot page belonging) computation. Added human readable messages for progress. Includes updated XSLT.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3161
diff changeset
   230
    apply "$overlapping_geometry", mode="testtree";
2db69e2c5673 SVGHMI: Optimized overlapping geometry (widget ot page belonging) computation. Added human readable messages for progress. Includes updated XSLT.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3161
diff changeset
   231
}