--- a/svghmi/svghmi.js Wed Sep 21 11:51:05 2022 +0200
+++ b/svghmi/svghmi.js Thu Sep 22 09:42:38 2022 +0200
@@ -46,14 +46,6 @@
}
};
-// Apply updates recieved through ws.onmessage to subscribed widgets
-function apply_updates() {
- updates.forEach((value, index) => {
- dispatch_value(index, value);
- });
- updates.clear();
-}
-
// Called on requestAnimationFrame, modifies DOM
var requestAnimationFrameID = null;
function animate() {
@@ -126,14 +118,13 @@
if(iectype != undefined){
let dvgetter = dvgetters[iectype];
let [value, bytesize] = dvgetter(dv,i);
- updates.set(index, value);
+ dispatch_value(index, value);
i += bytesize;
} else {
throw new Error("Unknown index "+index);
}
};
- apply_updates();
// register for rendering on next frame, since there are updates
} catch(err) {
// 1003 is for "Unsupported Data"
--- a/svghmi/widgets_common.ysl2 Wed Sep 21 11:51:05 2022 +0200
+++ b/svghmi/widgets_common.ysl2 Thu Sep 22 09:42:38 2022 +0200
@@ -189,7 +189,6 @@
]);
var persistent_indexes = new Map();
var cache = hmitree_types.map(_ignored => undefined);
- var updates = new Map();
function page_local_index(varname, pagename){
let pagevars = hmi_locals[pagename];
@@ -209,7 +208,6 @@
let defaultval = local_defaults[varname];
if(defaultval != undefined) {
cache[new_index] = defaultval;
- updates.set(new_index, defaultval);
if(persistent_locals.has(varname))
persistent_indexes.set(new_index, varname);
}