svghmi/detachable_pages.ysl2
author Edouard Tisserant <edouard.tisserant@gmail.com>
Fri, 26 Feb 2021 10:00:14 +0100
branchsvghmi
changeset 3165 2db69e2c5673
parent 3161 edd558965f58
child 3170 aaa203270ab0
permissions -rw-r--r--
SVGHMI: Optimized overlapping geometry (widget ot page belonging) computation. Added human readable messages for progress. Includes updated XSLT.
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
    const "k", "'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
    55
    const "m", "'computing belonging of widgets to pages'";
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
    56
    value "ns:ProgressStart($k, $m)";
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
    foreach "$hmi_pages | $keypads" {
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
        const "k2", "concat('overlapping:', @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
        const "m2", "concat('collecting membership of ', @inkscape:label)";
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
        value "ns:ProgressStart($k2, $m2)";
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
    61
        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
    62
            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
    63
            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
    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
        value "ns:ProgressEnd($k2, $m2)";
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
    }
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
    67
    value "ns:ProgressEnd($k, $m)";
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
    68
}
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
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
    70
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
    71
2875
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    72
def "func:all_related_elements" {
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    73
    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
    74
    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
    75
    const "page_overlapping_elements", "//svg:*[@id = $page_overlapping_geometry/@Id]";
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    76
    const "page_sub_elements", "func:refered_elements($page | $page_overlapping_elements)";
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    77
    result "$page_sub_elements";
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    78
}
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
    79
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
    80
2875
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    81
def "func:required_elements" {
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    82
    param "pages"; 
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    83
    choose{
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    84
        when "$pages"{
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    85
            result """func:all_related_elements($pages[1])
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    86
                      | func:required_elements($pages[position()!=1])""";
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    87
        }otherwise{
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    88
            result "/..";
2844
eee5dcd9fc92 SVGHMI: detachable and discardable elements sets, Reworked geometric intersection, toward more accurate page content detection.
Edouard Tisserant
parents: 2843
diff changeset
    89
        }
eee5dcd9fc92 SVGHMI: detachable and discardable elements sets, Reworked geometric intersection, toward more accurate page content detection.
Edouard Tisserant
parents: 2843
diff changeset
    90
    }
2875
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    91
}
2844
eee5dcd9fc92 SVGHMI: detachable and discardable elements sets, Reworked geometric intersection, toward more accurate page content detection.
Edouard Tisserant
parents: 2843
diff changeset
    92
2875
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    93
const "required_elements",
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    94
    """//svg:defs/descendant-or-self::svg:*
2911
211d6a185e31 SVGHMI: More infrastructure for editing values with a keypad.
Edouard Tisserant
parents: 2904
diff changeset
    95
       | func:required_elements($hmi_pages | $keypads)/ancestor-or-self::svg:*""";
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
    96
2875
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    97
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
    98
2875
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
    99
def "func:sumarized_elements" {
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
   100
    param "elements";
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
   101
    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
   102
    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
   103
        not(child::*[
2875
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
   104
            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
   105
            not(@id = $short_list/@id)
2875
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
   106
        ])]""";
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
   107
    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
   108
    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
   109
}
2844
eee5dcd9fc92 SVGHMI: detachable and discardable elements sets, Reworked geometric intersection, toward more accurate page content detection.
Edouard Tisserant
parents: 2843
diff changeset
   110
2875
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
   111
def "func:detachable_elements" {
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
   112
    param "pages";
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
   113
    choose{
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
   114
        when "$pages"{
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
   115
            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
   116
                      | func:detachable_elements($pages[position()!=1])""";
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
   117
        }otherwise{
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
   118
            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
   119
        }
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
   120
    }
2875
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
   121
}
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
   122
2875
6a12e1084deb SVGHMI: created detachable_elements.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2874
diff changeset
   123
// Avoid nested detachables
2911
211d6a185e31 SVGHMI: More infrastructure for editing values with a keypad.
Edouard Tisserant
parents: 2904
diff changeset
   124
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
   125
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
   126
2943
304e88bae115 SVGHMI: added more meaningful namespaces to emit javascript code from.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2941
diff changeset
   127
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
   128
    |
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
   129
    | 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
   130
    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
   131
    |     "«@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
   132
    }
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
    | }
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
2888
7beddc62a388 SVGHMI: Exclude (again) sub-widgets of forEach widget from page-switch managed widget.
Edouard Tisserant
parents: 2887
diff changeset
   136
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
   137
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
   138
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
   139
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
   140
template "svg:*", mode="page_desc" {
3117
f058542d0caa SVGHMI: Make an error when pages are nested
Edouard Tisserant
parents: 3107
diff changeset
   141
    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
   142
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
   143
2886
6c82fad8be65 SVGHMI: Simplification and optimization. func:parselabel becomes a template.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2885
diff changeset
   144
    const "desc", "func:widget(@id)";
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
    const "msg", "concat('generating page description ', $desc/arg[1]/@value)";
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
   146
    value "ns:ProgressStart($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
   147
    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
   148
    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
   149
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_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
   151
3121
8094494113b6 SVGHMI: Prevent excluded widget to appear in generated pages' widget list.
Edouard Tisserant
parents: 3117
diff changeset
   152
    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
   153
    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
   154
    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
   155
        "$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
   156
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
    // 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
   158
    // 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
   159
    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
   160
        """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
   161
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
   162
    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
   163
        """$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
   164
           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
   165
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
   166
    |   "«$desc/arg[1]/@value»": {
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
   167
    //|     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
   168
    |     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
   169
    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
   170
        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
   171
            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
   172
    |     page_index: «$desc/path/@index»,
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
    }
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
   174
    |     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
   175
    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
   176
        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
   177
            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
   178
                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
   179
                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
   180
            }
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
    |         [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
   182
    }
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
   183
    |     ],
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
   184
    |     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
   185
    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
   186
    |         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
   187
    }
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
    |     ],
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
   189
    |     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
   190
    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
   191
    |         "«@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
   192
    }
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
    |     }
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
   194
    /* TODO generate some code for init() instead */
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
   195
    apply "$parsed_widgets/widget[@id = $all_page_widgets/@id]", mode="per_page_widget_template"{
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
   196
        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
   197
    }
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
   198
    |   }`if "position()!=last()" > ,`
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
   199
    value "ns:ProgressEnd($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
   200
}
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
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
   202
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
   203
    |
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
   204
    | 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
   205
    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
   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
}
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
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
   209
template "*", mode="per_page_widget_template";
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
   210
2904
92d115d8828d SVGHMI: collect debug data through xslt reflectivity instead of yml2/python trick
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2903
diff changeset
   211
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
   212
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
   213
    |
2888
7beddc62a388 SVGHMI: Exclude (again) sub-widgets of forEach widget from page-switch managed widget.
Edouard Tisserant
parents: 2887
diff changeset
   214
    | DETACHABLES:
2876
d2adbc273125 SVGHMI: moved debug code
Edouard Tisserant
parents: 2875
diff changeset
   215
    foreach "$detachable_elements"{
d2adbc273125 SVGHMI: moved debug code
Edouard Tisserant
parents: 2875
diff changeset
   216
        |  «@id»
d2adbc273125 SVGHMI: moved debug code
Edouard Tisserant
parents: 2875
diff changeset
   217
    }
2888
7beddc62a388 SVGHMI: Exclude (again) sub-widgets of forEach widget from page-switch managed widget.
Edouard Tisserant
parents: 2887
diff changeset
   218
    | In Foreach:
7beddc62a388 SVGHMI: Exclude (again) sub-widgets of forEach widget from page-switch managed widget.
Edouard Tisserant
parents: 2887
diff changeset
   219
    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
   220
        |  «.»
7beddc62a388 SVGHMI: Exclude (again) sub-widgets of forEach widget from page-switch managed widget.
Edouard Tisserant
parents: 2887
diff changeset
   221
    }
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
   222
    | 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
   223
    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
   224
}