# HG changeset patch # User Edouard Tisserant # Date 1633326078 -7200 # Node ID c3b1a4bfdf0af0d6bbb0040e16c7905b84d564b2 # Parent d44b6346d4c2c2fb3427f2e4040938282cab67ef SVGHMI: remove "value" element in meter and circularbar widget. Adding support for printf like formating make widget label too heavy. It is better to use Display widget instead. diff -r d44b6346d4c2 -r c3b1a4bfdf0a svghmi/widget_circularbar.ysl2 --- a/svghmi/widget_circularbar.ysl2 Mon Oct 04 07:38:46 2021 +0200 +++ b/svghmi/widget_circularbar.ysl2 Mon Oct 04 07:41:18 2021 +0200 @@ -9,14 +9,12 @@ If "min" a "max" labeled texts are provided, then they are used as respective minimum and maximum value. Otherwise, value is expected to be in between 0 and 100. - - If "value" labeled text is found, then its content is replaced by value. || shortdesc > Change end angle of Inkscape's arc - // TODO: add min/max arguments - // TODO: add printf-like format + arg name="min" count="optional" accepts="int,real" > minimum value + arg name="max" count="optional" accepts="int,real" > maximum value path name="value" accepts="HMI_INT,HMI_REAL" > Value to display @@ -52,6 +50,9 @@ } init() { + if(this.args.length >= 2) + [this.min, this.max]=this.args; + let [start, end, cx, cy, rx, ry] = ["start", "end", "cx", "cy", "rx", "ry"]. map(tag=>Number(this.path_elt.getAttribute('sodipodi:'+tag))) @@ -74,5 +75,5 @@ widget_defs("CircularBar") { labels("path"); - optional_labels("value min max"); + optional_labels("min max"); } diff -r d44b6346d4c2 -r c3b1a4bfdf0a svghmi/widget_meter.ysl2 --- a/svghmi/widget_meter.ysl2 Mon Oct 04 07:38:46 2021 +0200 +++ b/svghmi/widget_meter.ysl2 Mon Oct 04 07:41:18 2021 +0200 @@ -10,8 +10,6 @@ are provided, or if first and second argument are given, then they are used as respective minimum and maximum value. Otherwise, value is expected to be in between 0 and 100. - - If "value" labeled text is found, then its content is replaced by value. || shortdesc > Moves "needle" along "range" @@ -20,8 +18,6 @@ arg name="max" count="optional" accepts="int,real" > maximum value - // TODO: add printf-like format - path name="value" accepts="HMI_INT,HMI_REAL" > Value to display } @@ -59,7 +55,7 @@ widget_defs("Meter") { labels("needle range"); - optional_labels("value min max"); + optional_labels("min max"); }