runtime/webinterface.js
author Andrey Skvortsov <andrej.skvortzov@gmail.com>
Mon, 26 Dec 2016 14:01:54 +0300
changeset 1615 af9b0ccb418e
parent 719 db54ccc96309
permissions -rw-r--r--
replace '-' with '.' in resource tab and transition/action SFC code


This makes tab names consistent with the way the same information is shown in variable panel.
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);