svghmi/detachable_pages.ysl2
branchsvghmi
changeset 2888 7beddc62a388
parent 2887 30cea13267b4
child 2894 4cf9ad35e6d0
equal deleted inserted replaced
2887:30cea13267b4 2888:7beddc62a388
    96     param "ancest";
    96     param "ancest";
    97     result "string-length($ancest) > 0 and starts-with($descend,$ancest)";
    97     result "string-length($ancest) > 0 and starts-with($descend,$ancest)";
    98 }
    98 }
    99 
    99 
   100 
   100 
       
   101 const "forEach_widgets_ids", "$parsed_widgets/widget[@type = 'ForEach']/@id";
       
   102 const "forEach_widgets", "$hmi_elements[@id = $forEach_widgets_ids]";
       
   103 const "in_forEach_widget_ids", "func:refered_elements($forEach_widgets)[not(@id = $forEach_widgets_ids)]/@id";
       
   104 
   101 template "svg:*", mode="page_desc" {
   105 template "svg:*", mode="page_desc" {
   102     const "desc", "func:widget(@id)";
   106     const "desc", "func:widget(@id)";
   103     const "page", ".";
   107     const "page", ".";
   104     const "p", "$geometry[@Id = $page/@id]";
   108     const "p", "$geometry[@Id = $page/@id]";
   105 
   109 
   106     const "page_all_elements", "func:all_related_elements($page)";
   110     const "page_all_elements", "func:all_related_elements($page)";
   107 
   111 
   108     const "all_page_widgets","$hmi_elements[@id = $page_all_elements/@id and @id != $page/@id]";
   112     const "all_page_widgets","$hmi_elements[@id = $page_all_elements/@id and @id != $page/@id and not(@id=$in_forEach_widget_ids)]";
   109 
       
   110     const "page_relative_widgets",
   113     const "page_relative_widgets",
   111         "$all_page_widgets[func:is_descendant_path(func:widget(@id)/path/@value, $desc/path/@value)]";
   114         "$all_page_widgets[func:is_descendant_path(func:widget(@id)/path/@value, $desc/path/@value)]";
   112 
   115 
   113     // Take closest ancestor in detachable_elements
   116     // Take closest ancestor in detachable_elements
   114     // since nested detachable elements are filtered out
   117     // since nested detachable elements are filtered out
   141     |     }
   144     |     }
   142     |   }`if "position()!=last()" > ,`
   145     |   }`if "position()!=last()" > ,`
   143 }
   146 }
   144 
   147 
   145 function "debug_detachables" {
   148 function "debug_detachables" {
       
   149     | DETACHABLES:
   146     foreach "$detachable_elements"{
   150     foreach "$detachable_elements"{
   147         |  «@id»
   151         |  «@id»
   148     }
   152     }
       
   153     | In Foreach:
       
   154     foreach "$in_forEach_widget_ids"{
       
   155         |  «.»
       
   156     }
   149 }
   157 }
   150 !debug_output_calls.append("debug_detachables")
   158 !debug_output_calls.append("debug_detachables")