svghmi/gen_index_xhtml.ysl2
branchsvghmi
changeset 2814 2cabc4773885
parent 2810 63b9a37b73c7
child 2822 9101a72a1da0
equal deleted inserted replaced
2813:ac736a878188 2814:2cabc4773885
    53         otherwise > «func:parselabel($hmi_pages/@inkscape:label)/widget/arg[1]/@value»
    53         otherwise > «func:parselabel($hmi_pages/@inkscape:label)/widget/arg[1]/@value»
    54     }
    54     }
    55 
    55 
    56     const "_categories" {
    56     const "_categories" {
    57         noindex > HMI_ROOT
    57         noindex > HMI_ROOT
    58         noindex > HMI_LABEL
    58         noindex > HMI_NODE
    59         noindex > HMI_CLASS
       
    60         noindex > HMI_PLC_STATUS
    59         noindex > HMI_PLC_STATUS
    61         noindex > HMI_CURRENT_PAGE
    60         noindex > HMI_CURRENT_PAGE
    62     }
    61     }
    63     const "categories", "exsl:node-set($_categories)";
    62     const "categories", "exsl:node-set($_categories)";
    64     const "_indexed_hmitree" apply "$hmitree", mode="index";
    63     const "_indexed_hmitree" apply "$hmitree", mode="index";
   120     /*const "mark" > =HMI=\n*/
   119     /*const "mark" > =HMI=\n*/
   121 
   120 
   122     /* copy root node and add geometry as comment for a test */
   121     /* copy root node and add geometry as comment for a test */
   123     template "/" { 
   122     template "/" { 
   124         comment > Made with SVGHMI. https://beremiz.org
   123         comment > Made with SVGHMI. https://beremiz.org
   125         /* DEBUG DATA
   124         /* DEBUG DATA */
   126         comment {
   125         comment {
   127             apply "$hmi_geometry", mode="testgeo";
   126             apply "$hmi_geometry", mode="testgeo";
   128         }
   127         }
   129         comment {
   128         comment {
   130             apply "$hmitree", mode="testtree";
   129             apply "$hmitree", mode="testtree";
   131         }
   130         }
   132         comment {
   131         comment {
   133             apply "$indexed_hmitree", mode="testtree";
   132             apply "$indexed_hmitree", mode="testtree";
   134         }
   133         }
   135         */
   134         /**/
   136         html xmlns="http://www.w3.org/1999/xhtml" {
   135         html xmlns="http://www.w3.org/1999/xhtml" {
   137             head;
   136             head;
   138             body style="margin:0;overflow:hidden;" {
   137             body style="margin:0;overflow:hidden;" {
   139                 apply "svg:svg", mode="inline_svg";
   138                 apply "svg:svg", mode="inline_svg";
   140                 script{
   139                 script{
   227             |     indexes: [
   226             |     indexes: [
   228             foreach "$widget/path" {
   227             foreach "$widget/path" {
   229                 const "hmipath","@value";
   228                 const "hmipath","@value";
   230                 const "hmitree_match","$indexed_hmitree/*[@hmipath = $hmipath]";
   229                 const "hmitree_match","$indexed_hmitree/*[@hmipath = $hmipath]";
   231                 if "count($hmitree_match) = 0"
   230                 if "count($hmitree_match) = 0"
   232                     error > No match for HMI «$hmipath»;
   231                     error > No match for path "«$hmipath»" in HMI tree
   233             |         «$hmitree_match/@index»`if "position()!=last()" > ,`
   232             |         «$hmitree_match/@index»`if "position()!=last()" > ,`
   234             }
   233             }
   235             |     ],
   234             |     ],
   236             |     element: document.getElementById("«@id»"),
   235             |     element: document.getElementById("«@id»"),
   237             apply "$widget", mode="widget_defs" with "hmi_element",".";
   236             apply "$widget", mode="widget_defs" with "hmi_element",".";
   305     //     }
   304     //     }
   306     //     ||
   305     //     ||
   307     // }
   306     // }
   308 
   307 
   309 
   308 
   310     /*
   309     /**/
   311     template "bbox", mode="testgeo"{
   310     template "bbox", mode="testgeo"{
   312         | ID: «@Id» x: «@x» y: «@y» w: «@w» h: «@h»
   311         | ID: «@Id» x: «@x» y: «@y» w: «@w» h: «@h»
   313     }
   312     }
   314 
   313 
   315     template "*", mode="testtree"{
   314     template "*", mode="testtree"{
   319         > \n
   318         > \n
   320         apply "*", mode="testtree" {
   319         apply "*", mode="testtree" {
   321             with "indent" value "concat($indent,'>')"
   320             with "indent" value "concat($indent,'>')"
   322         };
   321         };
   323     }
   322     }
   324     */
   323     /**/
   325 
   324 
   326     function "defs_by_labels" {
   325     function "defs_by_labels" {
   327         param "labels","''";
   326         param "labels","''";
   328         param "mandatory","'yes'";
   327         param "mandatory","'yes'";
   329         param "hmi_element";
   328         param "hmi_element";