Viewer.py
changeset 697 25296cfc3663
parent 696 8865c406f616
child 699 649399ffdaf0
equal deleted inserted replaced
696:8865c406f616 697:25296cfc3663
   831                 connection = self.GetConnectorByName(block.GetName())
   831                 connection = self.GetConnectorByName(block.GetName())
   832                 if connection is not None:
   832                 if connection is not None:
   833                     connector = connection.GetConnector()
   833                     connector = connection.GetConnector()
   834                     if len(connector.Wires) == 1:
   834                     if len(connector.Wires) == 1:
   835                         iec_path = self.GetElementIECPath(connector.Wires[0][0])
   835                         iec_path = self.GetElementIECPath(connector.Wires[0][0])
   836         elif isinstance(element, (LD_Contact, FBD_Block)):
   836         elif isinstance(element, LD_Contact):
   837             iec_path = "%s.%s"%(self.InstancePath, element.GetName())
   837             iec_path = "%s.%s"%(self.InstancePath, element.GetName())
   838         elif isinstance(element, SFC_Step):
   838         elif isinstance(element, SFC_Step):
   839             iec_path = "%s.%s.X"%(self.InstancePath, element.GetName())
   839             iec_path = "%s.%s.X"%(self.InstancePath, element.GetName())
   840         elif isinstance(element, SFC_Transition):
   840         elif isinstance(element, SFC_Transition):
   841             connectors = element.GetConnectors()
   841             connectors = element.GetConnectors()
  1027                     wire.SetValue("undefined")
  1027                     wire.SetValue("undefined")
  1028 
  1028 
  1029         if self.Debug:
  1029         if self.Debug:
  1030             for block in self.Blocks.itervalues():
  1030             for block in self.Blocks.itervalues():
  1031                 block.SpreadCurrent()
  1031                 block.SpreadCurrent()
  1032                 if not isinstance(block, FBD_Block):
  1032                 iec_path = self.GetElementIECPath(block)
  1033                     iec_path = self.GetElementIECPath(block)
  1033                 if iec_path is not None:
  1034                     if iec_path is not None:
  1034                     self.AddDataConsumer(iec_path.upper(), block)
  1035                         self.AddDataConsumer(iec_path.upper(), block)
       
  1036 
  1035 
  1037         self.Inhibit(False)
  1036         self.Inhibit(False)
  1038         self.RefreshVisibleElements()
  1037         self.RefreshVisibleElements()
  1039         self.ShowHighlights()
  1038         self.ShowHighlights()
  1040         self.Refresh(False)
  1039         self.Refresh(False)
  1721                         "program": ITEM_PROGRAM,
  1720                         "program": ITEM_PROGRAM,
  1722                         "functionBlock": ITEM_FUNCTIONBLOCK,
  1721                         "functionBlock": ITEM_FUNCTIONBLOCK,
  1723                     }.get(self.Controler.GetPouType(instance_type))
  1722                     }.get(self.Controler.GetPouType(instance_type))
  1724                     if pou_type is not None and instance_type in self.Controler.GetProjectPouNames(self.Debug):
  1723                     if pou_type is not None and instance_type in self.Controler.GetProjectPouNames(self.Debug):
  1725                         self.ParentWindow.OpenDebugViewer(pou_type, 
  1724                         self.ParentWindow.OpenDebugViewer(pou_type, 
  1726                             self.GetElementIECPath(self.SelectedElement),
  1725                             "%s.%s"%(self.InstancePath, self.SelectedElement.GetName()),
  1727                             self.Controler.ComputePouName(instance_type))
  1726                             self.Controler.ComputePouName(instance_type))
  1728                 else:
  1727                 else:
  1729                     iec_path = self.GetElementIECPath(self.SelectedElement)
  1728                     iec_path = self.GetElementIECPath(self.SelectedElement)
  1730                     if iec_path is not None:
  1729                     if iec_path is not None:
  1731                         if isinstance(self.SelectedElement, Wire):
  1730                         if isinstance(self.SelectedElement, Wire):