SVGHMI: allow widgets to disable clipping on variables given with min and max. Setting this.clip = false disables clipping.
--- a/svghmi/widgets_common.ysl2 Thu May 05 10:31:16 2022 +0200
+++ b/svghmi/widgets_common.ysl2 Thu May 05 10:35:29 2022 +0200
@@ -183,6 +183,7 @@
this.pending = indexes.map(() => undefined);
this.bound_unhinibit = this.unhinibit.bind(this);
this.forced_frequency = freq;
+ this.clip = true;
}
unsub(){
@@ -269,14 +270,16 @@
if(realindex == undefined) return undefined;
let old_val = cache[realindex];
let new_val = eval_operation_string(old_val, opstr);
- new_val = this.clip_min_max(index, new_val);
+ if(this.clip)
+ new_val = this.clip_min_max(index, new_val);
return apply_hmi_value(realindex, new_val);
}
_apply_hmi_value(index, new_val) {
let realindex = this.get_variable_index(index);
if(realindex == undefined) return undefined;
- new_val = this.clip_min_max(index, new_val);
+ if(this.clip)
+ new_val = this.clip_min_max(index, new_val);
return apply_hmi_value(realindex, new_val);
}