Пример #1
0
    def __init__(self, parent_name, parent, length=1000):
        self._box = None
        self._parent_name = parent_name
        self._target = None
        self._source = None
        self._run_drive = False

        # data points
        self._cmd_interrupt = CommandToggle(
            parent_name + "/Cmd_Interrupt_Toggle", parent, False)
        self._length = Variant(parent_name + "/Length", parent, length,
                               ValueDataType.Int)
        self._box_position = Variant(parent_name + "/BoxPosition", parent,
                                     False, ValueDataType.Float)
        self._box_id = Variant(parent_name + "/BoxId", parent, "",
                               ValueDataType.String)
        self._occupied = Switch(parent_name + "/Occupied", parent, False, True)
        self._transport_allowed = Switch(parent_name + "/TransportAllowed",
                                         parent, False, False)
        self._ready_handover = Switch(parent_name + "/ReadyHandover", parent,
                                      False, False)
        self._ready_takeover = Switch(parent_name + "/ReadyTakeover", parent,
                                      True, False)
        self._source_name = Variant(parent_name + "/SourceName", parent, "",
                                    ValueDataType.String)
        self._target_name = Variant(parent_name + "/TargetName", parent, "",
                                    ValueDataType.String)
Пример #2
0
    def __init__(self, name, reference_designation, area=None, height=5000):
        self._name = name

        self._area = area
        self._error_handler = ErrorHandler(area, name)
        self._error_handler.link_to_parent(area.error_handler)
        self._reference_designation = Variant(name + "/ReferenceDesignation",
                                              area, reference_designation,
                                              ValueDataType.String)

        self._switch_on = CommandToggle(name + "/Cmd_Enable_Toggle", area,
                                        True)
        self._abort = CommandTap(name + "/Cmd_AbortStack_Tap", area, False,
                                 lambda v: self.abort_request())
        self._manual = False
        self._manual_up = CommandToggle(name + "/Cmd_ManualUp_Toggle",
                                        area,
                                        False,
                                        condition=lambda: self._manual)
        self._manual_down = CommandToggle(name + "/Cmd_ManualDown_Toggle",
                                          area,
                                          False,
                                          condition=lambda: self._manual)
        self._clamps = CommandToggle(name + "/Cmd_ManualClamps_Toggle", area,
                                     False)

        self._infeed_conveyor = Conveyor(name + "/InfeedConv",
                                         reference_designation, area, 1000,
                                         200)
        self._lift_table_conveyor = Conveyor(name + "/LiftTableConv",
                                             reference_designation, area, 1000,
                                             200)

        self._op_hours = Variant(name + "/OpHours", area, 1654,
                                 ValueDataType.Float)
        self._box_counter = Variant(name + "/BoxCounter", area, 0,
                                    ValueDataType.Int)
        self._lift_table_top = Switch(name + "/LiftTableTop", area, False,
                                      False)
        self._lift_table_bottom = Switch(name + "/LiftTableBottom", area, True,
                                         False)
        self._lift_table_occ = Switch(name + "/LiftTableOccupied", area, False,
                                      False)
        self._stapler_prev = None
        self._stapler_next = None
        self._outfeed = False

        self._abort = False

        self._lift_counter = 0

        self._store_up = False
        self._store_down = True
        self._infeed_conveyor.set_adjacent(None, self._lift_table_conveyor)
        self._lift_table_conveyor.set_adjacent(self._infeed_conveyor, None)
Пример #3
0
    def __init__(self, name, reference_designation, parent=None):
        super().__init__(name, parent)

        self._error_handler = ErrorHandler(self)
        self._reference_designation = Variant("ReferenceDesignation", self,
                                              reference_designation,
                                              ValueDataType.String)
        self._type = Variant("Type", self, "System", ValueDataType.String)

        self._on = CommandTap("Cmd_SystemOn_Tap", self, False,
                              lambda v: self._switch_on_request(v))
        self._off = CommandTap("Cmd_SystemOff_Tap", self, False,
                               lambda v: self._switch_off_request(v))
        self._areas = []
Пример #4
0
    def __init__(self, name, reference_designation, parent=None):
        super().__init__(name, parent)

        self._error_handler = ErrorHandler(self)
        self._reference_designation = Variant("ReferenceDesignation", self,
                                              reference_designation,
                                              ValueDataType.String)
        self._type = Variant("Type", self, "Area", ValueDataType.String)

        self._conv_list = []

        self._area_on = CommandToggle("Cmd_AreaOn_Toggle", self, False,
                                      lambda v: self._area_state_changed(v))
        self._auto = CommandToggle("Cmd_ModeAuto_Toggle", self, True,
                                   lambda v: self._area_state_changed(v))
Пример #5
0
    def __init__(self,
                 name,
                 reference_designation,
                 area=None,
                 length=1000,
                 speed=200):

        self._name = name
        self._area = area
        self._length = length
        self._speed = speed
        self._source = None
        self._target = None

        self._error_handler = ErrorHandler(area, name)
        self._error_handler.link_to_parent(area.error_handler)
        self._reference_designation = Variant(name + "/ReferenceDesignation",
                                              area, reference_designation,
                                              ValueDataType.String)
        self._type = Variant(name + "/Type", area, "Conveyor",
                             ValueDataType.String)

        self._transport_handler = TransportHandler(name, area, length)
        self._transport_handler.on_request_source = self._on_request_source
        self._transport_handler.on_request_target = self._on_request_target

        # data points
        self._reset_error = CommandTap(name + "/Cmd_ResetError_Tap", area,
                                       False,
                                       lambda v: self._reset_error_request())
        self._photoeye = Switch(name + "/Photoeye", area, False, False)

        self._drive = Drive(name, "Drive", reference_designation[0:-3] + "D01",
                            speed, area)
        self._drive.error_handler.link_to_parent(self.error_handler)

        self._auto_clear = CommandToggle(name + "/Sim/AutoClear_Toggle", area,
                                         False)
        self._counter = 0

        CommandTap(name + "/Sim/AddBox_Tap", area, False,
                   lambda v: self.transport_handler.insert_new_box())
        CommandTap(name + "/Sim/DriveErrorTap", area, False,
                   lambda v: self._drive.sim_error())
        CommandTap(name + "/Sim/JamErrorTap", area, False,
                   lambda v: self.sim_jam_error())
Пример #6
0
    def __init__(self, parent, prefix=None):
        self._prefix = ""
        if prefix:
            self._prefix = prefix + "/"

        self._error_list = []
        self._error_src = Variant(self._prefix + "ErrorSource", parent, "",
                                  ValueDataType.String)
        self._error_active = Variant(self._prefix + "ErrorActive", parent,
                                     False, ValueDataType.Boolean)
        self._error_msg = Variant(self._prefix + "ErrorMessage", parent, "",
                                  ValueDataType.String)
        self._child_error_active = Variant(self._prefix + "ChildErrorActive",
                                           parent, False,
                                           ValueDataType.Boolean)
        self._child_errors = VariantDataMap(
            self._prefix + "ChildErrors", parent,
            [("Reference Designation", ValueDataType.String),
             ("Error MSG", ValueDataType.String)])
        self._parent_error_handler = None
Пример #7
0
    def __init__(self, name, reference_designation, area=None, height=5000):
        self._name = name
        self._speed_fast = 1000
        self._speed_slow = 500
        self._area = area

        self._error_handler = ErrorHandler(area, name)
        self._error_handler.link_to_parent(area.error_handler)
        self._reference_designation = Variant(name + "/ReferenceDesignation",
                                              area, reference_designation,
                                              ValueDataType.String)

        self._move_fast = CommandToggle(name + "/Cmd_MoveFast_Toggle", area,
                                        True,
                                        lambda v: self._change_speed_request())
        self._reset_error = CommandTap(name + "/Cmd_ResetError_Tap", area,
                                       False,
                                       lambda v: self._reset_error_request())
        self._lift_position = Variant(name + "/LiftPosition", area, height / 2,
                                      ValueDataType.Float)

        self._conveyor = Conveyor(name + "/Conv", reference_designation, area,
                                  1000, 200)
        self._conveyor.transport_handler.on_request_source = self._on_request_source
        self._conveyor.transport_handler.on_request_target = self._on_request_target

        self._drive = DrivePos(name, "LiftDrive",
                               reference_designation[0:-3] + "D02",
                               self._speed_fast, area)
        self._drive.error_handler.link_to_parent(self.error_handler)
        self._drive.encoder = height / 2

        Switch(name + "/GapCheck_1", area, False, False)
        Switch(name + "/GapCheck_2", area, False, False)
        self._in_motion = Switch(name + "/InPosition", area, False, False)
        self._in_position = Switch(name + "/InMotion", area, False, False)

        self._next_source = None
        self._next_target = None
        self._lift_source = None
        self._lift_target = None
Пример #8
0
    def __init__(self,
                 parent_name,
                 name,
                 reference_designation,
                 speed=100,
                 parent=None):

        self._manual_on = CommandToggle(parent_name + "/" + name +
                                        "/Cmd_ManualOn_Toggle",
                                        parent,
                                        False,
                                        None,
                                        condition=lambda: self.manual_mode)

        self._manual_mode = Switch(parent_name + "/" + name + "/ManualMode",
                                   parent, False, False)
        self._drive_on = Switch(parent_name + "/" + name + "/DriveOn", parent,
                                False, False)
        self._drive_speed = Variant(parent_name + "/" + name + "/CurrentSpeed",
                                    parent, 0, ValueDataType.Int)
        self._drive_speed_setpoint = Variant(
            parent_name + "/" + name + "/SetpointSpeed", parent, speed,
            ValueDataType.Int)
        self._drive_current = Variant(parent_name + "/" + name + "/Current",
                                      parent, 0.0, ValueDataType.Float)
        self._drive_encoder = Variant(parent_name + "/" + name + "/Encoder",
                                      parent, 0.0, ValueDataType.Float)

        self._error_handler = ErrorHandler(parent, parent_name + "/" + name)
        self._reference_designation = Variant(
            parent_name + "/" + name + "/ReferenceDesignation", parent,
            reference_designation, ValueDataType.String)
        self._type = Variant(parent_name + "/" + name + "/Type", parent,
                             "Drive", ValueDataType.String)
Пример #9
0
    def __init__(self,
                 parent_name,
                 name,
                 reference_designation,
                 speed=1000,
                 parent=None):
        super().__init__(parent_name, name, reference_designation, speed,
                         parent)

        self._busy = Switch(parent_name + "/" + name + "/Busy", parent, False,
                            False)
        self._target = Variant(parent_name + "/" + name + "/Target", parent, 0,
                               ValueDataType.Int)