SFCViewer.py
changeset 45 42637f721b5b
parent 44 c6e153273ea1
child 56 7187e1c00975
equal deleted inserted replaced
44:c6e153273ea1 45:42637f721b5b
    24 
    24 
    25 from wxPython.wx import *
    25 from wxPython.wx import *
    26 import wx
    26 import wx
    27 from types import *
    27 from types import *
    28 
    28 
    29 from plcopen.structures import *
       
    30 from graphics.GraphicCommons import *
       
    31 from graphics.SFC_Objects import *
       
    32 from Viewer import *
    29 from Viewer import *
    33 from Dialogs import *
       
    34 
    30 
    35 class SFC_Viewer(Viewer):
    31 class SFC_Viewer(Viewer):
    36     
    32     
    37     def __init__(self, parent, window, controler):
    33     def __init__(self, parent, window, controler):
    38         Viewer.__init__(self, parent, window, controler)
    34         Viewer.__init__(self, parent, window, controler)
   920                 self.RemoveBlock(divergence)
   916                 self.RemoveBlock(divergence)
   921                 self.Controler.RemoveCurrentElementEditingInstance(divergence.GetId())
   917                 self.Controler.RemoveCurrentElementEditingInstance(divergence.GetId())
   922                 if next:
   918                 if next:
   923                     wire = self.ConnectConnectors(next, previous)
   919                     wire = self.ConnectConnectors(next, previous)
   924                     previous_block = previous.GetParentBlock()
   920                     previous_block = previous.GetParentBlock()
   925                     pos = previous.GetPosition(False)
   921                     previous_pos = previous.GetPosition(False)
   926                     next_pos = next.GetPosition(False)
   922                     next_pos = next.GetPosition(False)
   927                     wire_size = GetWireSize(previous_block)
   923                     wire_size = GetWireSize(previous_block)
   928                     previous_block.RefreshOutputPosition((0, previous_pos.y + wire_size - next_pos.y))
   924                     previous_block.RefreshOutputPosition((0, previous_pos.y + wire_size - next_pos.y))
   929                     wire.SetPoints([wxPoint(previous_pos.x, previous_pos.y + wire_size), 
   925                     wire.SetPoints([wxPoint(previous_pos.x, previous_pos.y + wire_size), 
   930                         wxPoint(previous_pos.x, previous_pos.y)])
   926                         wxPoint(previous_pos.x, previous_pos.y)])