def __init__(self, transport_loop, axis):
     """Initialize member variables."""
     self.messaging_stack = MessagingStack(transport_loop)
     if axis == 'p':
         from lhrhost.robot.p_axis import Axis
     elif axis == 'z':
         from lhrhost.robot.z_axis import Axis
     elif axis == 'y':
         from lhrhost.robot.y_axis import Axis
     else:
         from lhrhost.robot.x_axis import Axis
     self.axis = Axis()
     if axis == 'p':
         self.axis.load_pid_json()
     self.messaging_stack.register_response_receivers(self.axis.protocol)
     self.messaging_stack.register_command_senders(self.axis.protocol)
     self.batch_execution_manager = BatchExecutionManager(
         self.messaging_stack.arbiter,
         self.messaging_stack.command_sender,
         self.test_routine,
         header=batch.OUTPUT_HEADER,
         ready_waiter=self.messaging_stack.connection_synchronizer.
         wait_connected)
     self.messaging_stack.register_execution_manager(
         self.batch_execution_manager)
Exemple #2
0
    def __init__(self, transport_loop):
        """Initialize member variables."""
        self.arbiter = arbiter(start=self._start, stopping=self._stop)

        self.image_plotter = Plotter()
        self.camera = Camera(image_receivers=[self.image_plotter])

        self.protocol = Protocol('Y-Axis', 'y')
        self.translator = BasicTranslator(message_receivers=[self.protocol])
        self.protocol.command_receivers.append(self.translator)
        self.response_receiver = ResponseReceiver(
            response_receivers=[self.translator])
        self.transport_manager = TransportManager(
            self.arbiter,
            transport_loop,
            response_receiver=self.response_receiver)
        self.translator.serialized_message_receivers.append(
            self.transport_manager.command_sender)
        self.batch_execution_manager = BatchExecutionManager(
            self.arbiter,
            self.transport_manager.command_sender,
            self.test_routine,
            header=batch.OUTPUT_HEADER,
            ready_waiter=self.transport_manager.connection_synchronizer.
            wait_connected)
        print('Showing webcam display...')
        self.image_plotter.show()
 def __init__(self, transport_loop):
     """Initialize member variables."""
     self.messaging_stack = MessagingStack(transport_loop)
     self.z_printer = Printer('Z-Axis', prefix=batch.RESPONSE_PREFIX)
     self.y_printer = Printer('Y-Axis', prefix=batch.RESPONSE_PREFIX)
     self.command_printer = MessagePrinter(prefix='  Sending: ')
     self.z = Protocol('ZAxis',
                       'z',
                       response_receivers=[self.z_printer],
                       command_receivers=[self.command_printer])
     self.y = Protocol('YAxis',
                       'y',
                       response_receivers=[self.y_printer],
                       command_receivers=[self.command_printer])
     self.response_printer = MessagePrinter(prefix=batch.RESPONSE_PREFIX)
     self.messaging_stack.register_response_receivers(self.response_printer)
     self.messaging_stack.register_response_receivers(self.z)
     self.messaging_stack.register_response_receivers(self.y)
     self.messaging_stack.register_command_senders(self.z)
     self.messaging_stack.register_command_senders(self.y)
     self.batch_execution_manager = BatchExecutionManager(
         self.messaging_stack.arbiter,
         self.messaging_stack.command_sender,
         self.test_routine,
         header=batch.OUTPUT_HEADER,
         ready_waiter=self.messaging_stack.connection_synchronizer.
         wait_connected)
     self.messaging_stack.register_execution_manager(
         self.batch_execution_manager)
 def __init__(self, transport_loop):
     """Initialize member variables."""
     self.messaging_stack = MessagingStack(transport_loop)
     self.robot = Robot()
     self.robot.register_messaging_stack(self.messaging_stack)
     self.batch_execution_manager = BatchExecutionManager(
         self.messaging_stack.arbiter, self.messaging_stack.command_sender,
         self.test_routine, header=batch.OUTPUT_HEADER,
         ready_waiter=self.messaging_stack.connection_synchronizer.wait_connected
     )
     self.messaging_stack.register_execution_manager(self.batch_execution_manager)
 def __init__(self, transport_loop, axis):
     """Initialize member variables."""
     self.messaging_stack = MessagingStack(transport_loop)
     self.protocol = Protocol('{}-Axis'.format(axis.upper()), axis)
     self.dashboard = LinearActuatorControlModel(self.protocol)
     self.messaging_stack.register_response_receivers(self.protocol)
     self.messaging_stack.register_command_senders(self.protocol)
     self.batch_execution_manager = BatchExecutionManager(
         self.messaging_stack.arbiter, self.messaging_stack.command_sender,
         self.test_routine,
         ready_waiter=self.messaging_stack.connection_synchronizer.wait_connected
     )
     self.messaging_stack.register_execution_manager(self.batch_execution_manager)
     print('Showing dashboard...')
     self.dashboard.show()
Exemple #6
0
 def __init__(self, transport_loop, axis):
     """Initialize member variables."""
     self.messaging_stack = MessagingStack(transport_loop)
     self.protocol = Protocol('{}-Axis'.format(axis.upper()), axis)
     self.protocol_plotter = Plotter(self.protocol)
     self.messaging_stack.register_response_receivers(self.protocol)
     self.messaging_stack.register_command_senders(self.protocol)
     self.batch_execution_manager = BatchExecutionManager(
         self.messaging_stack.arbiter, self.messaging_stack.command_sender,
         self.test_routine, header=batch.OUTPUT_HEADER,
         ready_waiter=self.messaging_stack.connection_synchronizer.wait_connected
     )
     self.messaging_stack.register_execution_manager(self.batch_execution_manager)
     print('Showing plot...')
     self.protocol_plotter.show()
 def __init__(self, transport_loop):
     """Initialize member variables."""
     self.arbiter = arbiter(start=self._start, stopping=self._stop)
     self.command_printer = MessagePrinter(prefix='  Sending: ')
     self.echo_response_printer = MessagePrinter(
         prefix=('\t' * batch.OUTPUT_WIDTH + '[Echo]\t')
     )
     self.reset_response_printer = MessagePrinter(
         prefix=('\t' * batch.OUTPUT_WIDTH + '[Reset]\t')
     )
     self.version_response_printer = MessagePrinter(
         prefix=('\t' * batch.OUTPUT_WIDTH + '[Version]\t')
     )
     self.builtin_led_response_printer = MessagePrinter(
         prefix=('\t' * batch.OUTPUT_WIDTH + '[BuiltinLED]\t')
     )
     self.response_dispatcher = Dispatcher(
         receivers={
             'e': [self.echo_response_printer],
             'r': [self.reset_response_printer]
         },
         prefix_receivers={
             'v': [self.version_response_printer],
             'l': [self.builtin_led_response_printer],
         }
     )
     self.translator = BasicTranslator(
         message_receivers=[self.response_dispatcher]
     )
     self.response_receiver = ResponseReceiver(
         response_receivers=[self.translator]
     )
     self.transport_manager = TransportManager(
         self.arbiter, transport_loop, response_receiver=self.response_receiver
     )
     self.translator.serialized_message_receivers.append(
         self.transport_manager.command_sender
     )
     self.batch_execution_manager = BatchExecutionManager(
         self.arbiter, self.transport_manager.command_sender, self.test_routine,
         header=batch.OUTPUT_HEADER,
         ready_waiter=self.transport_manager.connection_synchronizer.wait_connected
     )