svghmi/gen_index_xhtml.xslt
branchsvghmi
changeset 3069 a9b03c2634c5
parent 3068 81758c94f3df
child 3079 1021c6c74dde
equal deleted inserted replaced
3068:81758c94f3df 3069:a9b03c2634c5
  3824 </xsl:text>
  3824 </xsl:text>
  3825   </xsl:template>
  3825   </xsl:template>
  3826   <xsl:template mode="widget_class" match="widget[@type='JsonTable']">
  3826   <xsl:template mode="widget_class" match="widget[@type='JsonTable']">
  3827     <xsl:text>class JsonTableWidget extends Widget{
  3827     <xsl:text>class JsonTableWidget extends Widget{
  3828 </xsl:text>
  3828 </xsl:text>
  3829     <xsl:text>    cache = [100,50];
  3829     <xsl:text>    // arbitrary defaults to avoid missing entries in query
       
  3830 </xsl:text>
       
  3831     <xsl:text>    cache = [0,100,50];
  3830 </xsl:text>
  3832 </xsl:text>
  3831     <xsl:text>    do_http_request(...opt) {
  3833     <xsl:text>    do_http_request(...opt) {
  3832 </xsl:text>
  3834 </xsl:text>
  3833     <xsl:text>        const query = {
  3835     <xsl:text>        const query = {
  3834 </xsl:text>
  3836 </xsl:text>
  3837     <xsl:text>            range: this.cache[1],
  3839     <xsl:text>            range: this.cache[1],
  3838 </xsl:text>
  3840 </xsl:text>
  3839     <xsl:text>            position: this.cache[2],
  3841     <xsl:text>            position: this.cache[2],
  3840 </xsl:text>
  3842 </xsl:text>
  3841     <xsl:text>            visible: this.visible,
  3843     <xsl:text>            visible: this.visible,
       
  3844 </xsl:text>
       
  3845     <xsl:text>            extra: this.cache.slice(4),
  3842 </xsl:text>
  3846 </xsl:text>
  3843     <xsl:text>            options: opt
  3847     <xsl:text>            options: opt
  3844 </xsl:text>
  3848 </xsl:text>
  3845     <xsl:text>        };
  3849     <xsl:text>        };
  3846 </xsl:text>
  3850 </xsl:text>
  4175 </xsl:text>
  4179 </xsl:text>
  4176     <xsl:text>        this.apply_hmi_value(2, position);
  4180     <xsl:text>        this.apply_hmi_value(2, position);
  4177 </xsl:text>
  4181 </xsl:text>
  4178     <xsl:text>        this.apply_hmi_value(3, this.visible);
  4182     <xsl:text>        this.apply_hmi_value(3, this.visible);
  4179 </xsl:text>
  4183 </xsl:text>
  4180     <xsl:text>        console.log(range,position,jdata);
       
  4181 </xsl:text>
       
  4182     <xsl:apply-templates mode="json_table_render_except_comments" select="$data_elt">
  4184     <xsl:apply-templates mode="json_table_render_except_comments" select="$data_elt">
  4183       <xsl:with-param name="expressions" select="$initexpr_ns"/>
  4185       <xsl:with-param name="expressions" select="$initexpr_ns"/>
  4184       <xsl:with-param name="widget_elts" select="$hmi_element/*[@inkscape:label = 'data']/descendant::svg:*"/>
  4186       <xsl:with-param name="widget_elts" select="$hmi_element/*[@inkscape:label = 'data']/descendant::svg:*"/>
  4185     </xsl:apply-templates>
  4187     </xsl:apply-templates>
  4186     <xsl:text>    }
  4188     <xsl:text>    }