runtime/webinterface.js
author Edouard Tisserant
Thu, 19 Apr 2018 12:22:40 +0200
changeset 1994 1fdc32be71b8
parent 719 db54ccc96309
permissions -rw-r--r--
Rework of runtime non-real-time threading, and shared object dynamic loading :
- All exposed operations on PLCObject are now serialized through main thread
(@RunInMain). Only one exception : python trace thread calling _GetDebugData
- Re-loading of same shared object is prevented. dlclose/delte/rewrite/dlopen
don't happen in that case. This is a workaround for some xenomai copperplate
bug triggering segfault, inbetween delete and rewrite.
- Trace thread now waits for data, dies if no data, and dies instead of
suspending as before when no data consumed after 3 seconds.
- Disabled threading in Pyro client
- Enforced auxiliary threads starting sequence : Pyro -> [UI] ->
PLCWorker.RunLoop
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);