svghmi/detachable_pages.ysl2
branchsvghmi
changeset 2911 211d6a185e31
parent 2904 92d115d8828d
child 2939 4296ab974d4d
equal deleted inserted replaced
2910:1a1caf71b1cc 2911:211d6a185e31
     4 // and decide where to cut when removing/attaching
     4 // and decide where to cut when removing/attaching
     5 // pages elements on page switch
     5 // pages elements on page switch
     6 
     6 
     7 const "hmi_pages_descs", "$parsed_widgets/widget[@type = 'Page']";
     7 const "hmi_pages_descs", "$parsed_widgets/widget[@type = 'Page']";
     8 const "hmi_pages", "$hmi_elements[@id = $hmi_pages_descs/@id]";
     8 const "hmi_pages", "$hmi_elements[@id = $hmi_pages_descs/@id]";
       
     9 
       
    10 const "keypads_descs", "$parsed_widgets/widget[@type = 'Keypad']";
       
    11 const "keypads", "$hmi_elements[@id = $keypads_descs/@id]";
     9 
    12 
    10 const "default_page" choose {
    13 const "default_page" choose {
    11     when "count($hmi_pages) > 1" {
    14     when "count($hmi_pages) > 1" {
    12         choose {
    15         choose {
    13             when "$hmi_pages_descs/arg[1]/@value = 'Home'" > Home
    16             when "$hmi_pages_descs/arg[1]/@value = 'Home'" > Home
    56     }
    59     }
    57 }
    60 }
    58 
    61 
    59 const "required_elements",
    62 const "required_elements",
    60     """//svg:defs/descendant-or-self::svg:*
    63     """//svg:defs/descendant-or-self::svg:*
    61        | func:required_elements($hmi_pages)/ancestor-or-self::svg:*""";
    64        | func:required_elements($hmi_pages | $keypads)/ancestor-or-self::svg:*""";
    62 
    65 
    63 const "discardable_elements", "//svg:*[not(@id = $required_elements/@id)]";
    66 const "discardable_elements", "//svg:*[not(@id = $required_elements/@id)]";
    64 
    67 
    65 def "func:sumarized_elements" {
    68 def "func:sumarized_elements" {
    66     param "elements";
    69     param "elements";
    86         }
    89         }
    87     }
    90     }
    88 }
    91 }
    89 
    92 
    90 // Avoid nested detachables
    93 // Avoid nested detachables
    91 const "_detachable_elements", "func:detachable_elements($hmi_pages)";
    94 const "_detachable_elements", "func:detachable_elements($hmi_pages | $keypads)";
    92 const "detachable_elements", "$_detachable_elements[not(ancestor::*/@id = $_detachable_elements/@id)]";
    95 const "detachable_elements", "$_detachable_elements[not(ancestor::*/@id = $_detachable_elements/@id)]";
    93 
    96 
    94 const "forEach_widgets_ids", "$parsed_widgets/widget[@type = 'ForEach']/@id";
    97 const "forEach_widgets_ids", "$parsed_widgets/widget[@type = 'ForEach']/@id";
    95 const "forEach_widgets", "$hmi_elements[@id = $forEach_widgets_ids]";
    98 const "forEach_widgets", "$hmi_elements[@id = $forEach_widgets_ids]";
    96 const "in_forEach_widget_ids", "func:refered_elements($forEach_widgets)[not(@id = $forEach_widgets_ids)]/@id";
    99 const "in_forEach_widget_ids", "func:refered_elements($forEach_widgets)[not(@id = $forEach_widgets_ids)]/@id";