graphics/FBD_Objects.py
changeset 249 d8425712acef
parent 243 c5da8b706cde
child 269 34eff05909b0
equal deleted inserted replaced
248:f7df265edd54 249:d8425712acef
    62             block.SetPosition(pos.x, pos.y)
    62             block.SetPosition(pos.x, pos.y)
    63         block.Inputs = [input.Clone(block) for input in self.Inputs]
    63         block.Inputs = [input.Clone(block) for input in self.Inputs]
    64         block.Outputs = [output.Clone(block) for output in self.Outputs]
    64         block.Outputs = [output.Clone(block) for output in self.Outputs]
    65         return block
    65         return block
    66     
    66     
    67     # Destructor
    67     def Flush(self):
    68     def __del__(self):
    68         for input in self.Inputs:
       
    69             input.Flush()
    69         self.Inputs = []
    70         self.Inputs = []
       
    71         for output in self.Outputs:
       
    72             output.Flush()
    70         self.Outputs = []
    73         self.Outputs = []
    71     
    74     
    72     # Returns the RedrawRect
    75     # Returns the RedrawRect
    73     def GetRedrawRect(self, movex = 0, movey = 0):
    76     def GetRedrawRect(self, movex = 0, movey = 0):
    74         rect = Graphic_Element.GetRedrawRect(self, movex, movey)
    77         rect = Graphic_Element.GetRedrawRect(self, movex, movey)
   432             variable.Input = self.Input.Clone(variable)
   435             variable.Input = self.Input.Clone(variable)
   433         if self.Output:
   436         if self.Output:
   434             variable.Output = self.Output.Clone(variable)
   437             variable.Output = self.Output.Clone(variable)
   435         return variable
   438         return variable
   436     
   439     
   437     # Destructor
   440     def Flush(self):
   438     def __del__(self):
   441         if self.Input is not None:
   439         self.Input = None
   442             self.Input.Flush()
   440         self.Output = None
   443             self.Input = None
       
   444         if self.Output is not None:
       
   445             self.Output.Flush()
       
   446             self.Output = None
   441     
   447     
   442     # Returns the RedrawRect
   448     # Returns the RedrawRect
   443     def GetRedrawRect(self, movex = 0, movey = 0):
   449     def GetRedrawRect(self, movex = 0, movey = 0):
   444         rect = Graphic_Element.GetRedrawRect(self, movex, movey)
   450         rect = Graphic_Element.GetRedrawRect(self, movex, movey)
   445         if movex != 0 or movey != 0:
   451         if movex != 0 or movey != 0:
   670         else:
   676         else:
   671             self.Connector = Connector(self, "", "ANY", wx.Point(0, 0), EAST)
   677             self.Connector = Connector(self, "", "ANY", wx.Point(0, 0), EAST)
   672         self.RefreshConnectors()
   678         self.RefreshConnectors()
   673         self.RefreshNameSize()
   679         self.RefreshNameSize()
   674     
   680     
   675     # Destructor
   681     def Flush(self):
   676     def __del__(self):
   682         if self.Connector:
   677         self.Connector = None
   683             self.Connector.Flush()
       
   684             self.Connector = None
   678     
   685     
   679     # Returns the RedrawRect
   686     # Returns the RedrawRect
   680     def GetRedrawRect(self, movex = 0, movey = 0):
   687     def GetRedrawRect(self, movex = 0, movey = 0):
   681         rect = Graphic_Element.GetRedrawRect(self, movex, movey)
   688         rect = Graphic_Element.GetRedrawRect(self, movex, movey)
   682         if movex != 0 or movey != 0:
   689         if movex != 0 or movey != 0: