diff -r fdc12f7d27c8 -r 700b39cb4525 svghmi/gen_index_xhtml.xslt --- a/svghmi/gen_index_xhtml.xslt Sun Jan 16 17:00:58 2022 +0100 +++ b/svghmi/gen_index_xhtml.xslt Wed Feb 02 20:27:17 2022 +0100 @@ -175,14 +175,26 @@ - + + + + + + + + + + + + + - + @@ -194,6 +206,11 @@ + + + + + @@ -998,7 +1015,7 @@ - + @@ -1228,13 +1245,25 @@ + + + + + + + undefined + + + " ": new Widget (" - ",[ + ", + + ,[ ],[ @@ -1424,12 +1453,14 @@ - constructor(elt_id,args,indexes,minmaxes,members){ + constructor(elt_id, freq, args, indexes, minmaxes, members){ this.element_id = elt_id; this.element = id(elt_id); + if(freq !== undefined) this.frequency = freq; + this.args = args; this.indexes = indexes; @@ -2183,6 +2214,62 @@ Boolean variable + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2313,6 +2400,10 @@ _action(){ + console.log("Entering state + + "); + } @@ -2331,74 +2422,80 @@ ); + + + frequency = 5; + + display = "inactive"; + + state = "init"; + + dispatch(value) { + + + } + + onmouseup(evt) { + + svg_root.removeEventListener("pointerup", this.bound_onmouseup, true); + + + + + } + + onmousedown(evt) { + + svg_root.addEventListener("pointerup", this.bound_onmouseup, true); + + + + + } + + + animate(){ + + if (this.active_elt && this.inactive_elt) { + + + if(this.display == " + + ") + + this. + + _elt.style.display = ""; + + else + + this. + + _elt.style.display = "none"; + + + } + + } + + init() { + + this.bound_onmouseup = this.onmouseup.bind(this); + + this.element.addEventListener("pointerdown", this.onmousedown.bind(this)); + + } + + class ButtonWidget extends Widget{ - frequency = 5; - - display = "inactive"; - - state = "init"; - - dispatch(value) { - - - } - - onmouseup(evt) { - - svg_root.removeEventListener("pointerup", this.bound_onmouseup, true); - - - - - } - - onmousedown(evt) { - - svg_root.addEventListener("pointerup", this.bound_onmouseup, true); - - - - - } - - - animate(){ - - if (this.active_elt && this.inactive_elt) { - - - if(this.display == " - - ") - - this. - - _elt.style.display = ""; - - else - - this. - - _elt.style.display = "none"; - - - } - - } - - init() { - - this.bound_onmouseup = this.onmouseup.bind(this); - - this.element.addEventListener("pointerdown", this.onmousedown.bind(this)); - - } - + + + } @@ -2412,6 +2509,28 @@ + + class + PushButtonWidget + extends Widget{ + + + + + + } + + + + + + + + active inactive + + + + @@ -8682,6 +8801,8 @@ function send_hmi_value(index, value) { + console.log("send_hmi_value("+index+", "+value+")") + if(index > last_remote_index){ updates.set(index, value); @@ -8730,9 +8851,11 @@ function apply_hmi_value(index, new_val) { - let old_val = cache[index]; - - if(new_val != undefined && old_val != new_val) + console.log("apply_hmi_value("+index+", "+new_val+")") + + /*let old_val = cache[index];*/ + + if(new_val != undefined /*&& old_val != new_val*/) send_hmi_value(index, new_val);