MockServer¶
- class lsst.ts.cbp.MockServer(log=None)¶
Bases:
lsst.ts.tcpip.one_client_server.OneClientServer
Mocks the CBP server.
- Parameters
- log
logging.Logger
, optional
- log
- Attributes
Attributes Summary
Return True if a client is connected to this server.
Methods Summary
Call self.__connect_callback.
close
()Close socket server and client socket and set the done_task done.
Close the connected client socket, if any.
cmd_loop
()Run the command loop.
connect_callback
(server)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.
set_constrained_position
(value, actuator)Set actuator to position that is silently constrained to bounds.
start
()Start the TCP/IP server.
Attributes Documentation
- connected¶
Return True if a client is connected to this server.
Methods Documentation
- call_connect_callback() None ¶
Call self.__connect_callback.
Only call if the connection state has changed since the last time this method was called.
- async close() None ¶
Close socket server and client socket and set the done_task done.
Call connect_callback if a client was connected.
Always safe to call.
- async close_client() None ¶
Close the connected client socket, if any.
Call connect_callback if a client was connected.
- async cmd_loop()¶
Run the command loop.
- Parameters
- reader
asyncio.StreamReader
- writer
asyncio.StreamWriter
- reader
- connect_callback(server)¶
- async do_aastat()¶
Return the azimuth encoder status.
- Returns
- str
- async do_abstat()¶
Return the altitude encoder status.
- Returns
- str
- async do_acstat()¶
Return the focus encoder status.
- Returns
- str
- async do_adstat()¶
Return the mask selection encoder status.
- Returns
- str
- async do_aestat()¶
Return the mask rotation encoder status.
- Returns
- str
- async do_altitude()¶
Return the altitude position.
- Returns
- str
- async do_autopark()¶
Return the autopark value.
- Returns
- str
- async do_azimuth()¶
Return azimuth position.
- Returns
- str
- async do_focus()¶
Return the focus value.
- Returns
- str
- async do_mask()¶
Return the mask value.
- Returns
- str
- async do_new_altitude(altitude)¶
Set the new altitude position.
- Parameters
- altitude
float
- altitude
- Returns
- str
- async do_new_focus(focus)¶
Set the new focus value.
- Parameters
- focus
- Returns
- str
- async do_new_rotation(rotation)¶
Set the new mask rotation value.
- Parameters
- rotation
float
- rotation
- Returns
- str
- async do_panic()¶
Return the panic status value.
- Returns
- str
- async do_rotation()¶
Return the mask rotation value.
- Returns
- str
- set_constrained_position(value, actuator)¶
Set actuator to position that is silently constrained to bounds.
- Parameters
- value
float
Desired value
- actuator
lsst.ts.simactuators.PointToPointActuator
The actuator to set.
- value