laurent@369: // import Nevow.Athena
laurent@369: 
laurent@381: function init() {
laurent@381:   Nevow.Athena.Widget.fromAthenaID(1).callRemote('HMIexec', 'HMIinitialisation');
laurent@381: }
laurent@381: 
laurent@369: WebInterface.PLC = Nevow.Athena.Widget.subclass('WebInterface.PLC');
laurent@369: WebInterface.PLC.method(
laurent@369: 	 'updateHMI',
laurent@369: 	 function (self, data) {
laurent@369: 	   d = self.callRemote('getPLCElement');
laurent@369: 	   d.addCallback(
laurent@369: 			 function liveElementReceived(le) {
laurent@369: 				d2 = self.addChildWidgetFromWidgetInfo(le);
laurent@369: 				d2.addCallback(
laurent@369: 						function childAdded(widget) {
laurent@369: 						var node = self.nodeById('content');
laurent@369: 						node.replaceChild(widget.node, node.getElementsByTagName('div')[0]);
laurent@381: 						init();
laurent@369: 						});
laurent@369: 				});
laurent@381: 	   });
laurent@381: 
laurent@381: Divmod.Base.addLoadEvent(init);