MockServer#
- class lsst.ts.cbp.MockServer(log=None)#
Bases:
OneClientReadLoopServerMocks the CBP server.
- Parameters:
log (
logging.Logger, optional)
- commands#
- Type:
- log#
- Type:
Methods Summary
cmd_loop()Run the command loop.
Return the azimuth encoder status.
Return the altitude encoder status.
Return the focus encoder status.
Return the mask selection encoder status.
Return the mask rotation encoder status.
Return the altitude position.
Return the autopark value.
Return azimuth position.
do_focus()Return the focus value.
do_mask()Return the mask value.
do_new_altitude(altitude)Set the new altitude position.
do_new_azimuth(azimuth)Set the new azimuth position.
do_new_focus(focus)Set the new focus value.
do_new_mask(mask)Set the new mask value.
do_new_rotation(rotation)Set the new mask rotation value.
do_panic()Return the panic status value.
do_park([park])Park or unpark the CBP.
Return the mask rotation value.
Read, parse, and dispatch one item of data.
set_circular_constrained_position(value, ...)Set actuator to position that is silently constrained to bounds.
set_constrained_position(value, actuator)Set actuator to position that is silently constrained to bounds.
Methods Documentation
- async cmd_loop()#
Run the command loop.
- Parameters:
reader (
asyncio.StreamReader)writer (
asyncio.StreamWriter)
- async do_new_altitude(altitude)#
Set the new altitude position.
- async do_new_azimuth(azimuth)#
Set the new azimuth position.
- async do_new_rotation(rotation)#
Set the new mask rotation value.
- async read_and_dispatch()#
Read, parse, and dispatch one item of data.
Subclasses need to implement this method such that it reads and parses data and then dispatches handling the data to a method suitable for the subclass. Methods that might be helpful include:
read_jsonto read json-encoded dataread_strto read terminated stringsread_intoto read binary structs
- set_circular_constrained_position(value, actuator)#
Set actuator to position that is silently constrained to bounds.
- Parameters:
value (
float) – Desired valueactuator (
lsst.ts.simactuators.CircularPointToPointActuator) – The actuator to set.
- set_constrained_position(value, actuator)#
Set actuator to position that is silently constrained to bounds.
- Parameters:
value (
float) – Desired valueactuator (
lsst.ts.simactuators.PointToPointActuator) – The actuator to set.