MockLabJackInterface

class lsst.ts.atwhitelight.MockLabJackInterface(identifier, log, device_type='T4', connection_type='TCP', simulate=False)

Bases: LabJackInterface

Mock version of LabJackInterface.

This mock monitors what data is written to the LabJack and adjusts what data is read to be what we expect from the real lamp controller.

Parameters:
identifierstr

LabJack indentifier:

  • An IP address if connection_type=TCP

  • A serial number if connection_type = USB

  • For testing in an environment with only one LabJack you may use ANY.

device_typestr

LabJack model

connection_typestr

Connection type

simulateint, optional

Use a simulated LabJack?

Notes

This mock LabJack starts up in the following state:

  • Lamp is off and fully cooled down

  • Lamp controller is reporting an error

  • The shutter is closed and disabled

Attributes Summary

connected

Methods Summary

blinking_error_loop()

connect()

Connect to the LabJack and check we can read the specified channels.

disconnect()

Disconnect from the LabJack.

move_shutter()

read()

Read all channels specified in LabjackChannels.read.

set_error(controller_error)

write(**kwargs)

Write to one or more labelled channels.

Attributes Documentation

connected

Methods Documentation

async blinking_error_loop()
async connect()

Connect to the LabJack and check we can read the specified channels.

Disconnect first, if connected.

async disconnect()

Disconnect from the LabJack. A no-op if disconnected.

async move_shutter()
async read()

Read all channels specified in LabjackChannels.read.

Returns:
datatypes.SimpleNamespace

Struct of label=value, where label is a key in LabjackChannels.read

set_error(controller_error)
async write(**kwargs)

Write to one or more labelled channels.

Parameters:
kwargsdict

Dict of label: value, where label is a key in LabJackChannels.write