graphics/FBD_Objects.py
changeset 1736 7e61baa047f0
parent 1734 750eeb7230a1
child 1739 ec153828ded2
equal deleted inserted replaced
1735:c02818d7e29f 1736:7e61baa047f0
    29 
    29 
    30 #-------------------------------------------------------------------------------
    30 #-------------------------------------------------------------------------------
    31 #                         Function Block Diagram Block
    31 #                         Function Block Diagram Block
    32 #-------------------------------------------------------------------------------
    32 #-------------------------------------------------------------------------------
    33 
    33 
    34 """
       
    35 Class that implements the graphic representation of a function block
       
    36 """
       
    37 
    34 
    38 def TestConnectorName(name, block_type):
    35 def TestConnectorName(name, block_type):
    39     return name in ["OUT", "MN", "MX"] or name.startswith("IN") and (block_type, name) != ("EXPT", "IN2")
    36     return name in ["OUT", "MN", "MX"] or name.startswith("IN") and (block_type, name) != ("EXPT", "IN2")
    40 
    37 
       
    38 
    41 class FBD_Block(Graphic_Element):
    39 class FBD_Block(Graphic_Element):
       
    40     """
       
    41     Class that implements the graphic representation of a function block
       
    42     """
    42 
    43 
    43     # Create a new block
    44     # Create a new block
    44     def __init__(self, parent, type, name, id = None, extension = 0, inputs = None, connectors = {}, executionControl = False, executionOrder = 0):
    45     def __init__(self, parent, type, name, id = None, extension = 0, inputs = None, connectors = {}, executionControl = False, executionOrder = 0):
    45         Graphic_Element.__init__(self, parent)
    46         Graphic_Element.__init__(self, parent)
    46         self.Type = None
    47         self.Type = None
   496 
   497 
   497 #-------------------------------------------------------------------------------
   498 #-------------------------------------------------------------------------------
   498 #                        Function Block Diagram Variable
   499 #                        Function Block Diagram Variable
   499 #-------------------------------------------------------------------------------
   500 #-------------------------------------------------------------------------------
   500 
   501 
   501 """
       
   502 Class that implements the graphic representation of a variable
       
   503 """
       
   504 
   502 
   505 class FBD_Variable(Graphic_Element):
   503 class FBD_Variable(Graphic_Element):
       
   504     """
       
   505     Class that implements the graphic representation of a variable
       
   506     """
   506 
   507 
   507     # Create a new variable
   508     # Create a new variable
   508     def __init__(self, parent, type, name, value_type, id = None, executionOrder = 0):
   509     def __init__(self, parent, type, name, value_type, id = None, executionOrder = 0):
   509         Graphic_Element.__init__(self, parent)
   510         Graphic_Element.__init__(self, parent)
   510         self.Type = None
   511         self.Type = None
   792 
   793 
   793 #-------------------------------------------------------------------------------
   794 #-------------------------------------------------------------------------------
   794 #                        Function Block Diagram Connector
   795 #                        Function Block Diagram Connector
   795 #-------------------------------------------------------------------------------
   796 #-------------------------------------------------------------------------------
   796 
   797 
   797 """
       
   798 Class that implements the graphic representation of a connection
       
   799 """
       
   800 
   798 
   801 class FBD_Connector(Graphic_Element):
   799 class FBD_Connector(Graphic_Element):
       
   800     """
       
   801     Class that implements the graphic representation of a connection
       
   802     """
   802 
   803 
   803     # Create a new connection
   804     # Create a new connection
   804     def __init__(self, parent, type, name, id = None):
   805     def __init__(self, parent, type, name, id = None):
   805         Graphic_Element.__init__(self, parent)
   806         Graphic_Element.__init__(self, parent)
   806         self.Type = type
   807         self.Type = type