MockServer

class lsst.ts.cbp.MockServer(log=None)

Bases: object

Mocks the CBP server.

Parameters:
log : logging.Logger, optional
Attributes:
host : str
port : int
timeout : int
long_timeout : int
azimuth : float
altitude : float
focus : int
mask : str
panic_status : bool
encoders : Encoders
park : bool
auto_park : bool
masks_rotation : dict of str:float
commands : tuple of re.Pattern:functools.partial
log : logging.Logger

Methods Summary

cmd_loop(reader, writer) Run the command loop.
do_aastat() Return the azimuth encoder status.
do_abstat() Return the altitude encoder status.
do_acstat() Return the focus encoder status.
do_adstat() Return the mask selection encoder status.
do_aestat() Return the mask rotation encoder status.
do_altitude() Return the altitude position.
do_autopark() Return the autopark value.
do_azimuth() 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.
do_rotation() Return the mask rotation value.
start() Start the server.
stop() Stop the server.

Methods Documentation

cmd_loop(reader, writer)

Run the command loop.

Parameters:
reader : asyncio.StreamReader
writer : asyncio.StreamWriter
do_aastat()

Return the azimuth encoder status.

Returns:
str
do_abstat()

Return the altitude encoder status.

Returns:
str
do_acstat()

Return the focus encoder status.

Returns:
str
do_adstat()

Return the mask selection encoder status.

Returns:
str
do_aestat()

Return the mask rotation encoder status.

Returns:
str
do_altitude()

Return the altitude position.

Returns:
str
do_autopark()

Return the autopark value.

Returns:
str
do_azimuth()

Return azimuth position.

Returns:
str
do_focus()

Return the focus value.

Returns:
str
do_mask()

Return the mask value.

Returns:
str
do_new_altitude(altitude)

Set the new altitude position.

Parameters:
altitude : float
Returns:
str
do_new_azimuth(azimuth)

Set the new azimuth position.

Parameters:
azimuth : float
Returns:
str
do_new_focus(focus)

Set the new focus value.

Parameters:
focus
Returns:
str
do_new_mask(mask)

Set the new mask value.

Parameters:
mask : str
Returns:
str
do_new_rotation(rotation)

Set the new mask rotation value.

Parameters:
rotation : float
Returns:
str
do_panic()

Return the panic status value.

Returns:
str
do_park(park='?')

Park or unpark the CBP.

Parameters:
park : int, optional
Returns:
str
do_rotation()

Return the mask rotation value.

Returns:
str
start()

Start the server.

stop()

Stop the server.