msl.equipment.connection_demo module

Simulate a connection to the equipment.

class msl.equipment.connection_demo.ConnectionDemo(record, cls)[source]

Bases: Connection

Simulate a connection to the equipment.

Establishing a connection in demo mode is useful when developing a program and the equipment is not physically connected to a computer.

A custom logging level is used for logging messages with a connection in demo mode. The logging.DEMO logging level is set to be between logging.INFO and logging.WARNING.

The returned data type is determined from the docstring of the called method. For example, if :rtype: int then an int is returned or if :rtype: int, float then an int and a float are returned. Although the expected data type is returned the value(s) of the returned object is randomly generated. The docstring must be in either the reStructuredText or NumPy format.

Do not instantiate this class directly. Use the record.connect(demo=True) method to connect to the equipment in demo mode or set DEMO_MODE to be True in the Configuration File to open all connections in demo mode.

Parameters
disconnect()[source]

Log a disconnection from the equipment.