SimpleMockController#

class lsst.ts.hexrotcomm.SimpleMockController(log, port=6210, host='127.0.0.1', initial_state=ControllerState.STANDBY)#

Bases: BaseMockController

Simple mock controller for unit testing BaseMockController.

The MOVE command sets cmd_position and curr_position, then the controller slowly increments curr_position.

Parameters:
  • log (logging.Logger) – Logger.

  • port (int) – Port for the TCP/IP server. Specify 0 to choose random values for both ports; this is recommended for unit tests, to avoid collision with other tests.

  • initial_state (lsst.ts.xml.enums.MTHexapod.ControllerState (optional)) – Initial state of mock controller.

  • host (str or None, optional) – IP address for the TCP/IP server. Typically “127.0.0.1” (the default) for an IPV4 server and “::” for an IPV6 server. If None then bind to all network interfaces and run both IPV4 and IPV6 servers. Do not specify None with port=0 (see lsst.ts.tcpip.OneClientServer for details).

Notes

The MOVE command is rejected if the new position is not within the configured limits.

Methods Summary

do_position_set(command)

end_run_command(command, cmd_method)

Called when run_command is done.

update_telemetry(curr_tai)

Update self.client.telemetry.

write_config()

Write the current configuration.

Methods Documentation

async do_position_set(command)#
Parameters:

command (Command)

Return type:

None

async end_run_command(command, cmd_method)#

Called when run_command is done.

Can be used to clear the set position.

Parameters:
Return type:

None

async update_telemetry(curr_tai)#

Update self.client.telemetry.

Parameters:

curr_tai (float) – Time at which to compute telemetry (TAI, unix seconds). This is the time in the header, which is (approximately) the current time.

Return type:

None

async write_config()#

Write the current configuration.

Raises:

RuntimeError – If not connected.

Return type:

None