Controller¶
-
class
lsst.ts.MTMount.mock.Controller(reply_port, log)¶ Bases:
objectSimulate the most basic responses from the Operation Manager.
Acknowledge all commands and mark as done. Also output a few other replies, to exercise the code.
Parameters: - reply_port :
int Port for writing replies (that the CSC reads). The command port is one greater than the reply port.
- log :
logging.Logger Logger.
Methods Summary
add_all_devices()Add all mock devices. add_device(device_class, **kwargs)Add a mock device. close()connect_callback(server)delete_command_queue()Delete the command queue, if present. disconnect()do_both_axes_move(command)do_both_axes_stop(command)do_both_axes_track(command)handle_command(command)read_loop()reply_to_command(command)set_command_queue([maxsize])Create the command queue. start()write_ack(command, timeout)Report a command as acknowledged. write_done(command)Report a command as done. write_noack(command, explanation)Report a command as failed. Methods Documentation
-
add_all_devices()¶ Add all mock devices.
The devices are added to self.device_dict.
Parameters: - device_id :
DeviceId Device identifier.
- device_id :
-
add_device(device_class, **kwargs)¶ Add a mock device.
The device is added to self.device_dict.
Parameters: - device_class :
mock.Device Mock device class.
- **kwargs :
dict Additional arguments for
device_class.
- device_class :
-
close()¶
-
connect_callback(server)¶
-
delete_command_queue()¶ Delete the command queue, if present.
This sets
self.command_queue=None.
-
disconnect()¶
-
do_both_axes_move(command)¶
-
do_both_axes_stop(command)¶
-
do_both_axes_track(command)¶
-
handle_command(command)¶
-
read_loop()¶
-
reply_to_command(command)¶
-
set_command_queue(maxsize=0)¶ Create the command queue.
This sets attribute
self.command_queueto anasyncio.Queueand uses it to record commands as they are received.Parameters: - maxsize :
int(optional) Maximum number of items on the queue. If <= 0 then no limit. If the queue gets full then the newest items are dropped.
- maxsize :
-
start()¶
-
write_ack(command, timeout)¶ Report a command as acknowledged.
Parameters:
-
write_done(command)¶ Report a command as done.
Parameters: - command :
Command Command to report as done.
- command :
- reply_port :