tendril.testing.instrumentbase module

This file is part of tendril See the COPYING, README, and INSTALL files for more information

class tendril.testing.instrumentbase.InstrumentChannelBase(parent)[source]

Bases: object

is_enabled
class tendril.testing.instrumentbase.InstrumentInputChannelBase(parent)[source]

Bases: tendril.testing.instrumentbase.InstrumentChannelBase

get()[source]
class tendril.testing.instrumentbase.InstrumentOutputChannelBase(parent)[source]

Bases: tendril.testing.instrumentbase.InstrumentChannelBase

set(signal)[source]
class tendril.testing.instrumentbase.SignalWaveInputChannel(parent, interface, chidx)[source]

Bases: tendril.testing.instrumentbase.InstrumentInputChannelBase

This class provides the bulk of the accessors to the instrument channels providing vanilla SignalWave types. More complex implementations should provide their own channel classes.

Parameters:
  • parent – The instrument of which this channel is a part of.
  • interface – The interface to the instrument.
  • chidx – The channel index.
get(unitclass=None, flush=True)[source]

Gets the latest data point in the channel’s point buffer. By default, it also flushes any older points from the buffer. This behavior can be suppressed by passing flush=False.

Parameters:
  • unitclass – Unit class of which the data point is expected, or None if you don’t care.
  • flush – Whether or not older points should be flushed. Default True.
Returns:

Latest datapoint.

Return type:

tendril.utils.types.signalbase.SignalPoint

get_next_chunk(unitclass=None, maxlen=None)[source]

Gets the next chunk of data from the instrument channel. Note that the chunk returned has already been removed from the channel’s point buffer.

Parameters:unitclass – Unit class of which the data point is expected, or None if you don’t care.
Returns:Wave containing all but the latest data point in the channel’s point buffer.
Return type:tendril.utils.types.signalbase.SignalWave
reset_wave()[source]

Resets the point / wave buffer in the channel

data_available
class tendril.testing.instrumentbase.InstrumentBase(channels=None)[source]

Bases: object

consumer_register(consumer)[source]
consumer_done(consumer)[source]
connected
connect()[source]
disconnect()[source]
_detect()[source]
configure(configuration)[source]
configurations
channels
ident