graphics/GraphicCommons.py
changeset 28 fc23e1f415d8
parent 27 dae55dd9ee14
child 42 4a8400732001
equal deleted inserted replaced
27:dae55dd9ee14 28:fc23e1f415d8
    34 """
    34 """
    35 Definition of constants for dimensions of graphic elements
    35 Definition of constants for dimensions of graphic elements
    36 """
    36 """
    37 
    37 
    38 # FBD and SFC constants
    38 # FBD and SFC constants
    39 MIN_MOVE = 5            # Minimum move before starting a element dragging
    39 MIN_MOVE = 5                            # Minimum move before starting a element dragging
    40 CONNECTOR_SIZE = 8      # Size of connectors
    40 CONNECTOR_SIZE = 8                      # Size of connectors
    41 BLOCK_LINE_SIZE = 20    # Minimum size of each line in a block
    41 BLOCK_LINE_SIZE = 20                    # Minimum size of each line in a block
    42 HANDLE_SIZE = 6         # Size of the squares for handles
    42 HANDLE_SIZE = 6                         # Size of the squares for handles
    43 ANCHOR_DISTANCE = 5     # Distance where wire is automativally attached to a connector
    43 ANCHOR_DISTANCE = 5                     # Distance where wire is automativally attached to a connector
    44 POINT_RADIUS = 2        # Radius of the point of wire ends
    44 POINT_RADIUS = 2                        # Radius of the point of wire ends
    45 MIN_SEGMENT_SIZE = 2    # Minimum size of the endling segments of a wire
    45 MIN_SEGMENT_SIZE = 2                    # Minimum size of the endling segments of a wire
    46 
    46 
    47 # LD constants
    47 # LD constants
    48 LD_LINE_SIZE = 40                   # Distance between two lines in a ladder rung
    48 LD_LINE_SIZE = 40                       # Distance between two lines in a ladder rung
    49 LD_ELEMENT_SIZE = (21, 15)          # Size (width, height) of a ladder element (contact or coil)
    49 LD_ELEMENT_SIZE = (21, 15)              # Size (width, height) of a ladder element (contact or coil)
    50 LD_WIRE_SIZE = 30                   # Size of a wire between two contact
    50 LD_WIRE_SIZE = 30                       # Size of a wire between two contact
    51 LD_WIRECOIL_SIZE = 70               # Size of a wire between a coil and a contact
    51 LD_WIRECOIL_SIZE = 70                   # Size of a wire between a coil and a contact
    52 LD_OFFSET = (10, 10)                # Distance (x, y) between each comment and rung of the ladder
    52 LD_OFFSET = (10, 10)                    # Distance (x, y) between each comment and rung of the ladder
    53 LD_COMMENT_DEFAULTSIZE = (600, 40)  # Size (width, height) of a comment box
    53 LD_COMMENT_DEFAULTSIZE = (600, 40)      # Size (width, height) of a comment box
    54 
    54 
    55 # SFC constants
    55 # SFC constants
    56 SFC_STEP_DEFAULT_SIZE = (40, 30)      # Default size of a SFC step
    56 SFC_STEP_DEFAULT_SIZE = (40, 30)        # Default size of a SFC step
    57 SFC_TRANSITION_SIZE = (20, 2)         # Size of a SFC transition
    57 SFC_TRANSITION_SIZE = (20, 2)           # Size of a SFC transition
    58 SFC_DEFAULT_SEQUENCE_INTERVAL = 40    # Default size of the interval between two divergence branches
    58 SFC_DEFAULT_SEQUENCE_INTERVAL = 40      # Default size of the interval between two divergence branches
    59 SFC_SIMULTANEOUS_SEQUENCE_EXTRA = 20  # Size of extra lines for simultaneous divergence and convergence
    59 SFC_SIMULTANEOUS_SEQUENCE_EXTRA = 20    # Size of extra lines for simultaneous divergence and convergence
    60 SFC_JUMP_SIZE = (12, 13)              # Size of a SFC jump to step
    60 SFC_JUMP_SIZE = (12, 13)                # Size of a SFC jump to step
    61 SFC_WIRE_MIN_SIZE = 25                # Size of a wire between two elements
    61 SFC_WIRE_MIN_SIZE = 25                  # Size of a wire between two elements
    62 SFC_ACTION_MIN_SIZE = (100, 30)       # Minimum size of an action block line
    62 SFC_ACTION_MIN_SIZE = (100, 30)         # Minimum size of an action block line
    63 
    63 
    64 # Type definition constants for graphic elements
    64 # Type definition constants for graphic elements
    65 [INPUT, OUTPUT, INOUT] = range(3)
    65 [INPUT, OUTPUT, INOUT] = range(3)
    66 [CONNECTOR, CONTINUATION] = range(2)
    66 [CONNECTOR, CONTINUATION] = range(2)
    67 [LEFTRAIL, RIGHTRAIL] = range(2)
    67 [LEFTRAIL, RIGHTRAIL] = range(2)