Beremiz_service.py
changeset 381 5c0f34a9ab00
parent 369 bd54d41a7573
child 396 d1083f580ca1
--- a/Beremiz_service.py	Thu Aug 13 11:48:55 2009 +0200
+++ b/Beremiz_service.py	Fri Aug 14 16:26:19 2009 +0200
@@ -509,16 +509,26 @@
 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 '''
 
-    
-    class DefaultPLCStartedHMI(athena.LiveElement):
+    class PLCHMI(athena.LiveElement):
+    
+        initialised = False
+    
+        def HMIinitialised(self, result):
+            self.initialised = True
+        
+        def HMIinitialisation(self):
+            self.HMIinitialised(None)
+    
+    class DefaultPLCStartedHMI(PLCHMI):
         docFactory = loaders.stan(tags.div(render=tags.directive('liveElement'))[                                    
                                              tags.h1["PLC IS NOW STARTED"],
                                              ])
-    class PLCStoppedHMI(athena.LiveElement):
+        
+    class PLCStoppedHMI(PLCHMI):
         docFactory = loaders.stan(tags.div(render=tags.directive('liveElement'))[
                                              tags.h1["PLC IS STOPPED"]
                                              ])
-    
+        
     class MainPage(athena.LiveElement):
         jsClass = u"WebInterface.PLC"
         docFactory = loaders.stan(tags.div(render=tags.directive('liveElement'))[
@@ -583,6 +593,7 @@
                                                    tags.div( render = tags.directive( "MainPage" ))
                                                    ]]]])
         MainPage = MainPage()
+        PLCHMI = PLCHMI
 
         def __init__(self, plcState=False, *a, **kw):
             super(WebInterface, self).__init__(*a, **kw)