Esempio n. 1
0
    def __init__(self, prompts, newline, driver_event):
        """
        Protocol constructor.
        @param prompts A BaseEnum class containing instrument prompts.
        @param newline The newline.
        @param driver_event Driver process event callback.
        """
        log.debug("IN WorkhorseProtocol.__init__")
        # Construct protocol superclass.
        TeledyneProtocol.__init__(self, prompts, newline, driver_event)

        self._protocol_fsm.add_handler(WorkhorseProtocolState.COMMAND,
                                       WorkhorseProtocolEvent.POWER_DOWN,
                                       self._handler_command_power_down)
        self._protocol_fsm.add_handler(
            WorkhorseProtocolState.COMMAND,
            WorkhorseProtocolEvent.RESTORE_FACTORY_PARAMS,
            self._handler_command_restore_factory_params)

        self._add_build_handler(WorkhorseInstrumentCmds.RESTORE_FACTORY_PARAMS,
                                self._build_simple_command)
        self._add_response_handler(
            WorkhorseInstrumentCmds.RESTORE_FACTORY_PARAMS,
            self._parse_restore_factory_params_response)

        self._chunker = StringChunker(WorkhorseProtocol.sieve_function)
Esempio n. 2
0
    def __init__(self, prompts, newline, driver_event):
        """
        Protocol constructor.
        @param prompts A BaseEnum class containing instrument prompts.
        @param newline The newline.
        @param driver_event Driver process event callback.
        """
        log.debug("IN WorkhorseProtocol.__init__")
        # Construct protocol superclass.
        TeledyneProtocol.__init__(self, prompts, newline, driver_event)

        self._protocol_fsm.add_handler(
            WorkhorseProtocolState.COMMAND, WorkhorseProtocolEvent.POWER_DOWN, self._handler_command_power_down
        )
        self._protocol_fsm.add_handler(
            WorkhorseProtocolState.COMMAND,
            WorkhorseProtocolEvent.RESTORE_FACTORY_PARAMS,
            self._handler_command_restore_factory_params,
        )

        self._add_build_handler(WorkhorseInstrumentCmds.RESTORE_FACTORY_PARAMS, self._build_simple_command)
        self._add_response_handler(
            WorkhorseInstrumentCmds.RESTORE_FACTORY_PARAMS, self._parse_restore_factory_params_response
        )

        self._add_build_handler(WorkhorseInstrumentCmds.POWER_DOWN, self._build_simple_command)
        self._add_response_handler(WorkhorseInstrumentCmds.POWER_DOWN, self._parse_restore_factory_params_response)

        self._chunker = StringChunker(WorkhorseProtocol.sieve_function)
Esempio n. 3
0
    def __init__(self, prompts, newline, driver_event):
        """
        Protocol constructor.
        @param prompts A BaseEnum class containing instrument prompts.
        @param newline The newline.
        @param driver_event Driver process event callback.
        """

        # Construct protocol superclass.
        TeledyneProtocol.__init__(self, prompts, newline, driver_event)

        self._chunker = StringChunker(WorkhorseProtocol.sieve_function)
Esempio n. 4
0
    def __init__(self, prompts, newline, driver_event):
        """
        Protocol constructor.
        @param prompts A BaseEnum class containing instrument prompts.
        @param newline The newline.
        @param driver_event Driver process event callback.
        """

        # Construct protocol superclass.
        TeledyneProtocol.__init__(self, prompts, newline, driver_event)

        self._chunker = StringChunker(WorkhorseProtocol.sieve_function)
Esempio n. 5
0
    def __init__(self, prompts, newline, driver_event):
        """
        Protocol constructor.
        @param prompts A BaseEnum class containing instrument prompts.
        @param newline The newline.
        @param driver_event Driver process event callback.
        """

        log.debug("IN WorkhorseProtocol.__init__")
        # Construct protocol superclass.
        TeledyneProtocol.__init__(self, prompts, newline, driver_event)
        self._protocol_fsm.add_handler(ProtocolState.COMMAND,
                                       ProtocolEvent.POWER_DOWN,
                                       self._handler_command_power_down)
        self._chunker = StringChunker(WorkhorseProtocol.sieve_function)
Esempio n. 6
0
    def __init__(self, prompts, newline, driver_event):
        """
        Protocol constructor.
        @param prompts A BaseEnum class containing instrument prompts.
        @param newline The newline.
        @param driver_event Driver process event callback.
        """
        log.trace("IN WorkhorseProtocol.__init__")
        # Construct protocol superclass.
        TeledyneProtocol.__init__(self, prompts, newline, driver_event)

        self._protocol_fsm.add_handler(WorkhorseProtocolState.COMMAND,
                                       WorkhorseProtocolEvent.POWER_DOWN,
                                       self._handler_command_power_down)

        self._chunker = StringChunker(WorkhorseProtocol.sieve_function)