runtime/webinterface.js
author Andrey Skvortsov <andrej.skvortzov@gmail.com>
Mon, 05 Sep 2016 16:47:34 +0300
changeset 1521 e44950d4c218
parent 719 db54ccc96309
permissions -rw-r--r--
fix highlighting input/outputs in function call in ST, if comment section is placed
inside call.

For example:

PackOutputs(
W4 := OUT1,
W5 := OUT2,
W6 := OUT3,
W7 := OUT4,
W8 := OUT5 (* comment inside call *),
W9 := OUT6,
W10 := OUT7,
W11 := OUT8);
// import Nevow.Athena

function init() {
  Nevow.Athena.Widget.fromAthenaID(1).callRemote('HMIexec', 'HMIinitialisation');
}

WebInterface.PLC = Nevow.Athena.Widget.subclass('WebInterface.PLC');
WebInterface.PLC.method(
	 'updateHMI',
	 function (self, data) {
	   d = self.callRemote('getPLCElement');
	   d.addCallback(
			 function liveElementReceived(le) {
				d2 = self.addChildWidgetFromWidgetInfo(le);
				d2.addCallback(
						function childAdded(widget) {
						var node = self.nodeById('content');
						node.replaceChild(widget.node, node.getElementsByTagName('div')[0]);
						init();
						});
				});
	   });

Divmod.Base.addLoadEvent(init);