コード例 #1
0
    def __init__(self,
                 connection,
                 devices,
                 id=None,
                 units_per_step=None,
                 move_units='microsteps',
                 run_mode=CONTINUOUS,
                 action_handler=None,
                 verbose=False,
                 extra_verbose=False):

        device_base.__init__(self,
                             connection,
                             id=id,
                             run_mode=run_mode,
                             verbose=verbose)
        self.move_units = move_units
        self.action_handler = action_handler

        self.devices = {}
        self.device_lookup = {}
        for each_device in devices:
            self.device_lookup[devices[each_device]] = each_device
            print each_device
            self.devices[each_device] = zaber_device(
                connection,
                devices[each_device],
                each_device,
                units_per_step=units_per_step,
                move_units=self.move_units,
                run_mode=run_mode,
                action_handler=self.handle_action,
                verbose=extra_verbose)
            print 'done'

        self.base_commands = base_commands
        self.move_commands = move_commands
        self.meta_commands = {}
        self.user_meta_commands = {}

        self.command_queue = []
        self.mode = CONTINUOUS

        # dead_zone is a list of 2-tuples that define regions that
        # movement commands are not allowed to pass through.
        # Each 2-tuple contains a pair of n-tuples that give the
        # corner coordinates for each device
        # NOT CURRENTLY USED
        self.dead_zone = []

        # Set up the empty data case
        self.zero_data = {}
        for each_device in devices:
            self.zero_data[each_device] = 0
コード例 #2
0
    def __init__(self, 
                 connection, 
                 devices,
                 id = None,
                 units_per_step = None,
                 move_units = 'microsteps',
                 run_mode = CONTINUOUS,
                 action_handler = None,
                 verbose = False,
                 extra_verbose = False):
        
        device_base.__init__(self, connection, id = id, run_mode = run_mode, verbose=verbose)        
        self.move_units = move_units
        self.action_handler = action_handler 

        self.devices = {}
        self.device_lookup = {}
        for each_device in devices:
            self.device_lookup[devices[each_device]] = each_device
            print each_device
            self.devices[each_device] = zaber_device(connection,
                                            devices[each_device],
                                            each_device,
                                            units_per_step = units_per_step,
                                            move_units = self.move_units,
                                            run_mode = run_mode,
                                            action_handler = self.handle_action,
                                            verbose = extra_verbose)
            print 'done'
        
        self.base_commands = base_commands
        self.move_commands = move_commands
        self.meta_commands = {}
        self.user_meta_commands = {}

        self.command_queue = []
        self.mode = CONTINUOUS
        
        # dead_zone is a list of 2-tuples that define regions that
        # movement commands are not allowed to pass through.
        # Each 2-tuple contains a pair of n-tuples that give the
        # corner coordinates for each device
        # NOT CURRENTLY USED
        self.dead_zone = []

        # Set up the empty data case
        self.zero_data = {}
        for each_device in devices:
            self.zero_data[each_device] = 0
コード例 #3
0
    def __init__(self, 
                 connection, 
                 devices,
                 id = None,
                 units_per_step = None,
                 move_units = 'microsteps',
                 run_mode = CONTINUOUS,
                 action_handler = None,
                 verbose = False):
        
        device_base.__init__(self, connection, id = id, run_mode = run_mode, verbose=verbose)        
        
        self.move_units = move_units
        
        self.action_handler = action_handler 

        self.devices = {}
        self.device_lookup = {}
        for each_device in devices:
            self.device_lookup[devices[each_device]] = each_device
            self.devices[each_device] = zaber_device(connection,
                                            devices[each_device],
                                            each_device,
                                            units_per_step = units_per_step,
                                            move_units = self.move_units,
                                            run_mode = run_mode,
                                            action_handler = self.handle_action,
                                            verbose = False)
        
        self.base_commands = base_commands
        self.move_commands = move_commands
        self.meta_commands = {}
        self.user_meta_commands = {}

        self.command_queue = []
        self.mode = CONTINUOUS
        
        # Set up the empty data case
        self.zero_data = {}
        for each_device in devices:
            self.zero_data[each_device] = 0