diff -r 0c0d3895b036 -r 2a97688c94c5 svghmi/gen_index_xhtml.xslt --- a/svghmi/gen_index_xhtml.xslt Tue Oct 08 13:27:00 2019 +0200 +++ b/svghmi/gen_index_xhtml.xslt Wed Oct 09 09:04:35 2019 +0200 @@ -1,5 +1,5 @@ - + @@ -83,6 +83,9 @@ + + Made with SVGHMI. https://beremiz.org + @@ -104,191 +107,7 @@ - - var hmi_index = { - - - - - : { - - name: " - - ", - - hmipath: " - - " - - ids: [ - - - - " - - " - - , - - - - - ] - - } - - , - - - - - } - - - - var page_desc = { - - - - - - - - - - - - - } - - // svghmi.js - - - - (function(){ - - // Open WebSocket to relative "/ws" address - - var ws = new WebSocket(window.location.href.replace(/^http(s?:\/\/[^\/]*)\/.*$/, 'ws$1/ws')); - - - - // Register message reception handler - - ws.onmessage = function (evt) { - - // TODO : dispatch and cache hmi tree updates - - - - var received_msg = evt.data; - - // TODO : check for hmitree hash header - - // if not matching, reload page - - alert("Message is received..."+received_msg); - - }; - - - - // Once connection established - - ws.onopen = function (evt) { - - // TODO : enable the HMI (was previously offline, or just starts) - - // show main page - - - - - - // TODO : prefix with hmitree hash header - - ws.send("test"); - - }; - - - - var pending_updates = {}; - - - - // subscription state, as it should be in hmi server - - // expected {index:period} - - const subscriptions = new Map(); - - - - - - // subscription state as needed by widget now - - // expected {index:[widgets]}; - - var subscribers = {}; - - - - // return the diff in between curently subscribed and subscription - - function update_subscriptions() { - - let delta = []; - - Object.keys(subscribers).forEach(index => { - - - - let previous_period = subscriptions.get(index); - - delete subscriptions[index]; - - - - let new_period = Math.min(...widgets.map(widget => widget.period)); - - - - if(previous_period != new_period) - - delta.push({index: index, period: new_period}); - - }) - - return result; - - } - - - - - - function update_value(index, value) { - - - - }; - - - - function switch_page(page_name) { - - - - }; - - - - })(); - - - + @@ -313,28 +132,211 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + var hmi_index = { + + + + + : { + + name: " + + ", + + hmipath: " + + " + + ids: [ + + + + " + + " + + , + + + + + ] + + } + + , + + + + + } + + + + var page_desc = { + + + + + + + + + } + + // svghmi.js + + + + (function(){ + + // Open WebSocket to relative "/ws" address + + var ws = new WebSocket(window.location.href.replace(/^http(s?:\/\/[^\/]*)\/.*$/, 'ws$1/ws')); + + + + // Register message reception handler + + ws.onmessage = function (evt) { + + // TODO : dispatch and cache hmi tree updates + + + + var received_msg = evt.data; + + // TODO : check for hmitree hash header + + // if not matching, reload page + + alert("Message is received..."+received_msg); + + }; + + + + // Once connection established + + ws.onopen = function (evt) { + + // TODO : enable the HMI (was previously offline, or just starts) + + // show main page + + + + + + // TODO : prefix with hmitree hash header + + ws.send("test"); + + }; + + + + var pending_updates = {}; + + + + // subscription state, as it should be in hmi server + + // expected {index:period} + + const subscriptions = new Map(); + + + + + + // subscription state as needed by widget now + + // expected {index:[widgets]}; + + var subscribers = {}; + + + + // return the diff in between curently subscribed and subscription + + function update_subscriptions() { + + let delta = []; + + Object.keys(subscribers).forEach(index => { + + + + let previous_period = subscriptions.get(index); + + delete subscriptions[index]; + + + + let new_period = Math.min(...widgets.map(widget => widget.period)); + + + + if(previous_period != new_period) + + delta.push({index: index, period: new_period}); + + }) + + return result; + + } + + + + + + function update_value(index, value) { + + + + }; + + + + function switch_page(page_name) { + + + + }; + + + + })(); +