runtime/webinterface.js
author Edouard Tisserant
Tue, 02 Jun 2020 13:37:34 +0200
changeset 2653 8b612b357679
parent 719 db54ccc96309
permissions -rw-r--r--
Runtime: create .md5 file at the end of all transfered files being written to disk, so that it presence indicates completeness of transfer.
369
bd54d41a7573 Adding support for twisted website HMI
laurent
parents:
diff changeset
     1
// import Nevow.Athena
bd54d41a7573 Adding support for twisted website HMI
laurent
parents:
diff changeset
     2
381
5c0f34a9ab00 Improving support for svgui, separating setting end getting attributes functions from creating function.
laurent
parents: 369
diff changeset
     3
function init() {
5c0f34a9ab00 Improving support for svgui, separating setting end getting attributes functions from creating function.
laurent
parents: 369
diff changeset
     4
  Nevow.Athena.Widget.fromAthenaID(1).callRemote('HMIexec', 'HMIinitialisation');
5c0f34a9ab00 Improving support for svgui, separating setting end getting attributes functions from creating function.
laurent
parents: 369
diff changeset
     5
}
5c0f34a9ab00 Improving support for svgui, separating setting end getting attributes functions from creating function.
laurent
parents: 369
diff changeset
     6
369
bd54d41a7573 Adding support for twisted website HMI
laurent
parents:
diff changeset
     7
WebInterface.PLC = Nevow.Athena.Widget.subclass('WebInterface.PLC');
bd54d41a7573 Adding support for twisted website HMI
laurent
parents:
diff changeset
     8
WebInterface.PLC.method(
bd54d41a7573 Adding support for twisted website HMI
laurent
parents:
diff changeset
     9
	 'updateHMI',
bd54d41a7573 Adding support for twisted website HMI
laurent
parents:
diff changeset
    10
	 function (self, data) {
bd54d41a7573 Adding support for twisted website HMI
laurent
parents:
diff changeset
    11
	   d = self.callRemote('getPLCElement');
bd54d41a7573 Adding support for twisted website HMI
laurent
parents:
diff changeset
    12
	   d.addCallback(
bd54d41a7573 Adding support for twisted website HMI
laurent
parents:
diff changeset
    13
			 function liveElementReceived(le) {
bd54d41a7573 Adding support for twisted website HMI
laurent
parents:
diff changeset
    14
				d2 = self.addChildWidgetFromWidgetInfo(le);
bd54d41a7573 Adding support for twisted website HMI
laurent
parents:
diff changeset
    15
				d2.addCallback(
bd54d41a7573 Adding support for twisted website HMI
laurent
parents:
diff changeset
    16
						function childAdded(widget) {
bd54d41a7573 Adding support for twisted website HMI
laurent
parents:
diff changeset
    17
						var node = self.nodeById('content');
bd54d41a7573 Adding support for twisted website HMI
laurent
parents:
diff changeset
    18
						node.replaceChild(widget.node, node.getElementsByTagName('div')[0]);
381
5c0f34a9ab00 Improving support for svgui, separating setting end getting attributes functions from creating function.
laurent
parents: 369
diff changeset
    19
						init();
369
bd54d41a7573 Adding support for twisted website HMI
laurent
parents:
diff changeset
    20
						});
bd54d41a7573 Adding support for twisted website HMI
laurent
parents:
diff changeset
    21
				});
381
5c0f34a9ab00 Improving support for svgui, separating setting end getting attributes functions from creating function.
laurent
parents: 369
diff changeset
    22
	   });
5c0f34a9ab00 Improving support for svgui, separating setting end getting attributes functions from creating function.
laurent
parents: 369
diff changeset
    23
5c0f34a9ab00 Improving support for svgui, separating setting end getting attributes functions from creating function.
laurent
parents: 369
diff changeset
    24
Divmod.Base.addLoadEvent(init);