svghmi/detachable_pages.ysl2
branchsvghmi
changeset 2887 30cea13267b4
parent 2886 6c82fad8be65
child 2888 7beddc62a388
equal deleted inserted replaced
2886:6c82fad8be65 2887:30cea13267b4
     1 // detachable_pages.ysl2
     1 // detachable_pages.ysl2
     2 //
     2 //
     3 // compute what elements are required by pages
     3 // compute what elements are required by pages
     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_ids", "$parsed_widgets/widget[@type = 'Page']/@id";
     7 const "hmi_pages_descs", "$parsed_widgets/widget[@type = 'Page']";
     8 const "hmi_pages", "$hmi_elements[@id = $hmi_pages_ids]";
     8 const "hmi_pages", "$hmi_elements[@id = $hmi_pages_descs/@id]";
     9 
     9 
    10 const "default_page" choose {
    10 const "default_page" choose {
    11     when "count($hmi_pages) > 1" {
    11     when "count($hmi_pages) > 1" {
    12         const "Home_page", 
       
    13             "$hmi_pages[func:widget(@id)/arg[1]/@value = 'Home']";
       
    14         choose {
    12         choose {
    15             when "$Home_page" > Home
    13             when "$hmi_pages_descs/arg[1]/@value = 'Home'" > Home
    16             otherwise {
    14             otherwise {
    17                 error "No Home page defined!";
    15                 error "No Home page defined!";
    18             }
    16             }
    19         }
    17         }
    20     }
    18     }