def __init__(self, evt_callback): """ Constructor. @param evt_callback Driver process event callback. """ InstrumentDriver.__init__(self, evt_callback) # _trhph_client created in configure() self._trhph_client = None self._state = TrhphDriverState.UNCONFIGURED # TODO probably promote this convenience to super-class? self._timeout = 30 """Default timeout value for operations accepting an optional timeout
def __init__(self, evt_callback=None): InstrumentDriver.__init__(self, evt_callback) self.instrument_commands = Command self.instrument_parameters = Parameter self.instrument_channels = Channel self.instrument_errors = Error for channel in self.instrument_channels.list(): # # TODO associate some specific params per channel. Note that # there is no framework mechanism to specify this. For the # moment, just associate *all* parameters to each channel: # params_per_channel = self.instrument_parameters.list() protocol = MyProtocol(channel, params_per_channel, self.protocol_callback) protocol._fsm = Mock() protocol._fsm.get_current_state = Mock(return_value=DriverState.UNCONFIGURED) self.chan_map[channel] = protocol