runtime/webinterface.js
author Edouard Tisserant
Thu, 04 Apr 2019 13:59:22 +0200
branchrename_on_location_change
changeset 2575 aee08bd135d8
parent 719 db54ccc96309
permissions -rw-r--r--
Rename checkbox and immediately apply.
Added a checkbox in Location selection dialog (saved as user settings) to let user choose if variable is being renamed.
Also forced closing celle editor once new location is selected.
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);