ADCS.helpers.animations.godot.client module¶
- class ADCS.helpers.animations.godot.client.VizClient(host, port, token, name='python-reference')[source]¶
Bases:
objectReference client for the visualization stream (what a viewer does).
Used by the tests and as the model for viewer implementations: connect, present the token, read
HELLO, then consumeBLOCK/ROW/ENDmessages, acknowledging rows when the session is in lockstep mode.- Parameters:
host (str) – Server host.
port (int) – Server port.
token (str) – Session token printed or passed by the launcher.
name (str) – Client name sent in
CONNECT.
- connect(timeout=10.0)[source]¶
Connect and read
HELLO.- Returns:
The
HELLOcontent (protocol,mode,manifest,scene).- Raises:
ConnectionRefusedError – If the server rejects the client.
- Parameters:
timeout (float)
- Return type:
Dict[str, Any]
- messages(timeout=None)[source]¶
Yield decoded messages until the session
END.(BLOCK, (run_id, row_start, {channel: array (n, width)}))(ROW, (run_id, {channel: array (width,)}))(END, run_id)for the end of a run
- Parameters:
timeout (float | None) – Socket timeout per message (
Nonewaits forever).- Return type:
Iterator[Tuple[MsgType, Any]]
- read_all(timeout=None)[source]¶
Collect a whole session.
- Returns:
{run_id: {channel: array (n_rows, width)}}.- Parameters:
timeout (float | None)
- Return type:
Dict[str, Dict[str, ndarray]]
- split_row(values)[source]¶
Split a concatenated row into
{channel: values}.- Parameters:
values (ndarray)
- Return type:
Dict[str, ndarray]
- assets: Dict[str, Tuple[Dict[str, Any], bytes]]¶
{name: (meta, bytes)}.- Type:
Files received as ASSET messages
- property lockstep: bool¶