--- a/IDEFrame.py Thu May 02 14:00:05 2013 +0200
+++ b/IDEFrame.py Thu May 02 14:06:24 2013 +0200
@@ -1970,7 +1970,7 @@
elif isinstance(editor, GraphicViewer):
+ editor.RegisterVariables() elif editor.IsDebugging():
editor.RegisterVariables()
self.DebugVariablePanel.UnregisterObsoleteData()
--- a/ProjectController.py Thu May 02 14:00:05 2013 +0200
+++ b/ProjectController.py Thu May 02 14:06:24 2013 +0200
@@ -1185,12 +1185,16 @@
def ReArmDebugRegisterTimer(self):
if self.DebugTimer is not None:
- # 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])
- # Rearm anti-rapid-fire timer
- self.DebugTimer.start()
+ # 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": + # 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]) + # Rearm anti-rapid-fire timer + self.DebugTimer.start() def GetDebugIECVariableType(self, IECPath):
Idx, IEC_Type = self._IECPathToIdx.get(IECPath,(None,None))
@@ -1235,7 +1239,7 @@
def UnsubscribeAllDebugIECVariable(self):
self.IECdebug_lock.acquire()
+ self.IECdebug_datas = {} self.IECdebug_lock.release()
self.ReArmDebugRegisterTimer()
--- a/controls/DebugVariablePanel.py Thu May 02 14:00:05 2013 +0200
+++ b/controls/DebugVariablePanel.py Thu May 02 14:06:24 2013 +0200
@@ -1810,6 +1810,7 @@
def UnregisterObsoleteData(self):
+ self.RegisterVariables() if self.DataProducer is not None:
self.Ticktime = self.DataProducer.GetTicktime()
--- a/editors/Viewer.py Thu May 02 14:00:05 2013 +0200
+++ b/editors/Viewer.py Thu May 02 14:06:24 2013 +0200
@@ -1041,7 +1041,11 @@
self.RefreshRect(self.GetScrolledRect(refresh_rect), False)
DebugViewer.RefreshNewData(self)
+ def RegisterVariables(self): + DebugViewer.RegisterVariables(self) # Refresh Viewer elements
def RefreshView(self, variablepanel=True, selection=None):
EditorPanel.RefreshView(self, variablepanel)
--- a/graphics/GraphicCommons.py Thu May 02 14:00:05 2013 +0200
+++ b/graphics/GraphicCommons.py Thu May 02 14:06:24 2013 +0200
@@ -327,7 +327,7 @@
producer.SubscribeDebugIECVariable("__tick__", self)
if self.DataProducer is not None:
- self.DataProducer.UnsubscribeDebugIECVariable("__tick__", self)
+ self.DataProducer.UnsubscribeDebugIECVariable("__tick__", self) self.DataProducer = producer
@@ -353,7 +353,8 @@
self.DataProducer.UnsubscribeDebugIECVariable(iec_path, consumer)
def RegisterVariables(self):
+ if self.RegisterTick and self.Debug and self.DataProducer is not None: + self.DataProducer.SubscribeDebugIECVariable("__tick__", self) def GetDataType(self, iec_path):
if self.DataProducer is not None: