qtics.instruments.oxford.proteox package#
Proteox cryostat driver (WAMP), asynchronous and synchronous.
Submodules#
qtics.instruments.oxford.proteox.proteox module#
Define proteox instrument object.
- class qtics.instruments.oxford.proteox.proteox.AsyncProteox(url=None, realm=None, user=None, secret=None)[source]#
Bases:
objectAsynchronous high-level API for interacting with Proteox over WAMP.
Missing connection parameters are read from the environment (after loading a
.envfile, if any):WAMP_ROUTER_URL,WAMP_REALM,WAMP_USERandWAMP_USER_SECRET.- async get_sensor(uri, index=4)#
- async how_to_go_to_recognized_state(target_state=None) str[source]#
Return instructions to reach a state.
In particular: - the closest recognized state, if target_state is None - or a specific recognized state
- async set_sensor(uri, value=None)#
- class qtics.instruments.oxford.proteox.proteox.Proteox(url: str | None = None, realm: str | None = None, user: str | None = None, secret: str | None = None, name: str = 'Proteox', timeout: float = 10)[source]#
Bases:
InstrumentSynchronous Proteox driver.
Wraps
AsyncProteox, which runs on an event loop in a daemon thread. The dynamicget_<KEY>()andset_<KEY>(value)methods ofAsyncProteoxare available as blocking calls. Exceptions raised in the coroutines propagate to the caller.- how_to_go_to_recognized_state(target_state=None) str[source]#
Return instructions to reach a recognized state, see
AsyncProteox.
qtics.instruments.oxford.proteox.session module#
Manager for WAMP session.
- class qtics.instruments.oxford.proteox.session.InstrumentSession(config, instrument)[source]#
Bases:
ApplicationSessionWAMP session class.
Manages the connection to the router and ensures the instrument has control of the system if in remote mode.
- instrument#
Reference to the parent instrument instance.
- Type:
Any
- onChallenge(challenge)[source]#
Authenticate.
- Parameters:
challenge (Challenge) – The challenge object containing auth parameters.
- Returns:
Signature computed for the challenge.
- Return type:
- async onDisconnect()[source]#
Forget the session and signal the instrument’s disconnect_event if set.
- qtics.instruments.oxford.proteox.session.wamp_call_handler_get()[source]#
Create the decorator for wrapping getters WAMP RPC calls.
Handles exceptions and extracts the item at index (default the 5th, the value of most records) from the call response.
- Returns:
The wrapped function.
- Return type:
Callable
qtics.instruments.oxford.proteox.states module#
Recognized state evaluator for Proteox.
This module evaluates whether the cryostat is in one of the recognized states defined by the Proteox truth table.
- class qtics.instruments.oxford.proteox.states.Condition(key: str, label: str, evaluator: Callable[[dict[str, Any]], bool], suggestion_if_false: str, suggestion_if_true: str | None = None)[source]#
Bases:
objectA boolean condition used to identify a recognized cryostat state.
- class qtics.instruments.oxford.proteox.states.RecognizedStateManager(proteox)[source]#
Bases:
objectEvaluates whether the cryostat is in a recognized state.
- async get_closest_state() StateMatch | None[source]#
Return the closest recognized state (minimum total mismatches).
- async get_condition_report() dict[str, dict[str, Any]][source]#
Return a diagnostic condition report.
Example:
{ "PTR_IS_ON": { "label": "3CL-PTR-01 is On", "value": True, }, ... }
- async get_state_gap(target_state: str) StateMatch[source]#
Return mismatches relative to a specific target state.
- async get_transition_plan(target_state: str | None = None) dict[str, Any][source]#
Return a structured transition plan.
Useful if you later want to drive a GUI or automatic action planner.
- async how_to_go_to_recognized_state(target_state: str | None = None) str[source]#
Return a human-readable suggestion to reach.
In particular: - the closest recognized state - or a user-requested target state
- async is_in_recognized_state() bool[source]#
Return True if current conditions match at least one recognized state.
- async match_all_states() list[qtics.instruments.oxford.proteox.states.StateMatch][source]#
Evaluate all recognized states using EXCLUSIVE matching.
- class qtics.instruments.oxford.proteox.states.StateMatch(state_name: str, matched: bool, missing_true_conditions: list[str], violating_false_conditions: list[str], satisfied_true_conditions: list[str], satisfied_false_conditions: list[str], mismatch_count: int)[source]#
Bases:
objectResult for one candidate state.
- qtics.instruments.oxford.proteox.states.build_conditions() dict[str, qtics.instruments.oxford.proteox.states.Condition][source]#
Define all boolean conditions used by the Proteox recognized-state table.
You should adapt / refine these once the exact raw API signals are confirmed.
qtics.instruments.oxford.proteox.uris module#
URI and state mapping.