svghmi/gen_index_xhtml.xslt
branchsvghmi
changeset 2998 e8f707d99dc3
parent 2997 2f298089e32e
child 3003 9771a724af09
equal deleted inserted replaced
2997:2f298089e32e 2998:e8f707d99dc3
  1329     <xsl:text>    this.proportions = [rx, ry];
  1329     <xsl:text>    this.proportions = [rx, ry];
  1330 </xsl:text>
  1330 </xsl:text>
  1331     <xsl:text>},
  1331     <xsl:text>},
  1332 </xsl:text>
  1332 </xsl:text>
  1333   </xsl:template>
  1333   </xsl:template>
       
  1334   <xsl:template mode="widget_class" match="widget[@type='Display']">
       
  1335     <xsl:text>class DisplayWidget extends Widget{
       
  1336 </xsl:text>
       
  1337     <xsl:text>    frequency = 5;
       
  1338 </xsl:text>
       
  1339     <xsl:text>    dispatch(value) {
       
  1340 </xsl:text>
       
  1341     <xsl:text>        this.element.textContent = String(value);
       
  1342 </xsl:text>
       
  1343     <xsl:text>    }
       
  1344 </xsl:text>
       
  1345     <xsl:text>}
       
  1346 </xsl:text>
       
  1347   </xsl:template>
  1334   <xsl:template mode="widget_defs" match="widget[@type='Display']">
  1348   <xsl:template mode="widget_defs" match="widget[@type='Display']">
  1335     <xsl:param name="hmi_element"/>
  1349     <xsl:param name="hmi_element"/>
  1336     <xsl:text>    frequency: 5,
  1350     <xsl:if test="$hmi_element[not(self::svg:text)]">
  1337 </xsl:text>
  1351       <xsl:message terminate="yes">
  1338     <xsl:text>    dispatch: function(value) {
  1352         <xsl:text>Display Widget id="</xsl:text>
  1339 </xsl:text>
  1353         <xsl:value-of select="$hmi_element/@id"/>
  1340     <xsl:choose>
  1354         <xsl:text>" is not a svg::text element</xsl:text>
  1341       <xsl:when test="$hmi_element[self::svg:text]">
  1355       </xsl:message>
  1342         <xsl:text>      this.element.textContent = String(value);
  1356     </xsl:if>
  1343 </xsl:text>
       
  1344       </xsl:when>
       
  1345       <xsl:otherwise>
       
  1346         <xsl:message terminate="no">
       
  1347           <xsl:text>Display widget as a group not implemented</xsl:text>
       
  1348         </xsl:message>
       
  1349       </xsl:otherwise>
       
  1350     </xsl:choose>
       
  1351     <xsl:text>    },
       
  1352 </xsl:text>
       
  1353   </xsl:template>
  1357   </xsl:template>
  1354   <xsl:template mode="widget_defs" match="widget[@type='DropDown']">
  1358   <xsl:template mode="widget_defs" match="widget[@type='DropDown']">
  1355     <xsl:param name="hmi_element"/>
  1359     <xsl:param name="hmi_element"/>
  1356     <xsl:call-template name="defs_by_labels">
  1360     <xsl:call-template name="defs_by_labels">
  1357       <xsl:with-param name="hmi_element" select="$hmi_element"/>
  1361       <xsl:with-param name="hmi_element" select="$hmi_element"/>