exopy.instruments.plugin module¶
Instrument manager plugin.
-
exopy.instruments.plugin.
validate_user
(user)[source]¶ Validate that the user does declare a validate method if its policy is releasable.
-
exopy.instruments.plugin.
validate_starter
(starter)[source]¶ Validate a starter declaration by checking for members and provided starter.
-
class
exopy.instruments.plugin.
InstrumentManagerPlugin
[source]¶ Bases:
exopy.utils.plugin_tools.HasPreferencesPlugin
The instrument plugin manages the instrument drivers and their use.
-
profiles
¶ List of the known instrument profile ids.
-
instruments
¶ List of instruments for which at least one driver is declared.
-
users
¶ List of registered intrument users. Only registered users can be granted the use of an instrument.
-
starters
¶ List of registered instrument starters.
-
connections
¶ List of registered connection types.
-
settings
¶ List of registered settings.
-
used_profiles
¶ Currently used profiles. This dict should be edited by user code.
-
create_connection
(connection_id, infos, read_only=False)[source]¶ Create a connection and initialize it.
-
get_profiles
(user_id, profiles, try_release=True, partial=False)[source]¶ Query profiles for use by a declared user.
- Parameters
user_id (
unicode
) – Id of the user which request the authorization to use the instrument.profiles (
list
) – Ids of the instrument profiles which are requested.try_release (
bool
, optional) – Should we attempt to release currently used profiles.partial (
bool
, optional) – Should only a subset of the requested profiles be returned if some profiles are not available.
- Returns
-
release_profiles
(user_id, profiles)[source]¶ Release some previously acquired profiles.
The user should not maintain any communication with the instruments whose profiles have been released after calling this method.
- Parameters
user_id (
unicode
) – Id of the user releasing the profiles.profiles (
iterable
) – Profiles (ids) which are no longer needed by the user.
-