ProjectController.py
changeset 1146 510d1ea1f6c1
parent 1116 300f98a8d4c6
child 1176 f4b434672204
--- a/ProjectController.py	Wed May 15 17:13:49 2013 +0900
+++ b/ProjectController.py	Wed May 15 22:14:12 2013 +0200
@@ -1182,7 +1182,10 @@
                 self.TracedIECPath = []
                 self._connector.SetTraceVariablesList([])
             self.IECdebug_lock.release()
-
+    
+    def IsPLCStarted(self):
+        return self.previous_plcstate == "Started"
+     
     def ReArmDebugRegisterTimer(self):
         if self.DebugTimer is not None:
             self.DebugTimer.cancel()
@@ -1190,7 +1193,7 @@
         # Prevent to call RegisterDebugVarToConnector when PLC is not started
         # If an output location var is forced it's leads to segmentation fault in runtime
         # Links between PLC located variables and real variables are not ready
-        if self.previous_plcstate == "Started":
+        if self.IsPLCStarted():
             # Timer to prevent rapid-fire when registering many variables
             # use wx.CallAfter use keep using same thread. TODO : use wx.Timer instead
             self.DebugTimer=Timer(0.5,wx.CallAfter,args = [self.RegisterDebugVarToConnector])