lpcmanager

d8b12828e6aa
Enable IEC60870 server data loading and starting on PLC
// widget_cloudimage.ysl2
widget_desc("CloudImage") {
longdesc
||
If CloudImage widget is a svg:image element, then href content is replaced by
link to the file whose name is the value of given variable, being served from
/media/data/cloud folder.
||
shortdesc > Image display
}
widget_class("CloudImage")
||
frequency = 5;
dispatch(value, oldval, index) {
if (index == 0) {
this.given_url = "cloudfolder?image=" + value;
this.ready = true;
this.request_animate();
}
}
||
widget_defs("CloudImage") {
| given_url: "",
| ready: false,
| animate: function(){
| this.element.setAttribute('href', this.given_url);
| },
}
gen_index_xhtml { // following content is only available when generating xhtml file
// strip inkscape embedded bitmap when it is meant to be replaced by HMI:CloudImage widget
svgtmpl "svg:image[starts-with(@inkscape:label, 'HMI:CloudImage')]", mode="inline_svg" {
xsl:copy {
apply "@*[not(contains(name(), 'href'))] | node()", mode="inline_svg";
}
}
}