Fixing opening block debug view directly from parent debug view
authorLaurent Bessard
Thu, 24 May 2012 18:45:16 +0200
changeset 697 25296cfc3663
parent 696 8865c406f616
child 698 314af37f7db2
Fixing opening block debug view directly from parent debug view
Viewer.py
--- a/Viewer.py	Wed May 23 11:45:54 2012 +0200
+++ b/Viewer.py	Thu May 24 18:45:16 2012 +0200
@@ -833,7 +833,7 @@
                     connector = connection.GetConnector()
                     if len(connector.Wires) == 1:
                         iec_path = self.GetElementIECPath(connector.Wires[0][0])
-        elif isinstance(element, (LD_Contact, FBD_Block)):
+        elif isinstance(element, LD_Contact):
             iec_path = "%s.%s"%(self.InstancePath, element.GetName())
         elif isinstance(element, SFC_Step):
             iec_path = "%s.%s.X"%(self.InstancePath, element.GetName())
@@ -1029,10 +1029,9 @@
         if self.Debug:
             for block in self.Blocks.itervalues():
                 block.SpreadCurrent()
-                if not isinstance(block, FBD_Block):
-                    iec_path = self.GetElementIECPath(block)
-                    if iec_path is not None:
-                        self.AddDataConsumer(iec_path.upper(), block)
+                iec_path = self.GetElementIECPath(block)
+                if iec_path is not None:
+                    self.AddDataConsumer(iec_path.upper(), block)
 
         self.Inhibit(False)
         self.RefreshVisibleElements()
@@ -1723,7 +1722,7 @@
                     }.get(self.Controler.GetPouType(instance_type))
                     if pou_type is not None and instance_type in self.Controler.GetProjectPouNames(self.Debug):
                         self.ParentWindow.OpenDebugViewer(pou_type, 
-                            self.GetElementIECPath(self.SelectedElement),
+                            "%s.%s"%(self.InstancePath, self.SelectedElement.GetName()),
                             self.Controler.ComputePouName(instance_type))
                 else:
                     iec_path = self.GetElementIECPath(self.SelectedElement)