mxcubecore.HardwareObjects.abstract.AbstractSampleChanger#
Description#
AbstractSampleChanger is a base class to help in the implementation of Hardware Objects for SampleChangers following the “SampleChanger Standard Interface”.
If this class is used as base class a standard class is then provided for its use by generic bricks or by MXCuBE itself. This class exposes the following API for bricks and MXCuBE:
SampleChanger - Standard Interface#
Sample Changer States#
SampleChangerState.Unknown SampleChangerState.Ready SampleChangerState.Loaded SampleChangerState.Loading SampleChangerState.Unloading SampleChangerState.Selecting SampleChangerState.Scanning SampleChangerState.Resetting SampleChangerState.Charging SampleChangerState.Moving SampleChangerState.ChangingMode SampleChangerState.StandBy SampleChangerState.Disabled SampleChangerState.Alarm SampleChangerState.Fault SampleChangerState.Initializing SampleChangerState.Closing
Commands#
load() unload() select() abort() change_mode()
get_state() get_status() is_ready() wait_ready() has_loaded_sample() get_loaded_sample()
Specifying sample locations#
The sample model in a sample changer is based in the model:
- SampleChanger
- Container
- [Container…]
Sample
Typically for a sample changer with Pucks and Sample there is a single level for Container. Specifying a sample location will consist in giving the puck (basket) number followed by the sample number. In the location example 3:5 the fifth sample in the third puck is specified.
For other more complex constructions (for example for a plate manipulator) each nested container will be specified until getting to the sample:
In the example for a location in a plate manipulator like 1:5:2 the location specifies first plate well, fifth drop, second crystal.
Events emitted#
SampleChanger.STATE_CHANGED_EVENT SampleChanger.STATUS_CHANGED_EVENT SampleChanger.INFO_CHANGED_EVENT SampleChanger.LOADED_SAMPLE_CHANGED_EVENT SampleChanger.SELECTION_CHANGED_EVENT SampleChanger.TASK_FINISHED_EVENT SampleChanger.PROGRESS_MESSAGE
Tools for SC Classes#
- useUpdateTimer (xml property):
This property can accept a boolean value (True/False)
If this property is set the HardwareObject will poll itself for state changes, information change and other needed values.
Include a line like <useUpdateTimer>True</useUpdateTimer in the xml file
How to implement derived SC Classes#
Classes
|
Abstract base class for sample changers |
Enumeration of sample changer operating modes |
|
Enumeration of sample changer states |
- class mxcubecore.HardwareObjects.abstract.AbstractSampleChanger.SampleChanger(type_, scannable, *args, **kwargs)[source]#
Bases:
Container
,HardwareObject
Abstract base class for sample changers
- change_mode(mode, wait=True)[source]#
Change the mode (SC specific, imply change of the State) :param mode: Modes:
Unknown = 0 Normal = 1 Charging = 2 Disabled = 3
- Parameters:
wait (boolean) – True to block until mode changed is completed, False otherwise
- Rerturns:
- (Object): Value returned by _execute_task either a Task
or result of the operation.
- get_sample_properties()[source]#
- Returns:
With sample properties defined in Sample
- Return type:
(tuple)
- get_task_error()[source]#
- Returns:
Description of the error of last executed task (or None if success)
- Return type:
(str)
- has_loaded_sample()[source]#
- Returns:
True if a sample is loaded False otherwise
- Return type:
(boolean)
- is_enabled()[source]#
- Returns:
True if sample changer is enabled otherwise False
- Return type:
(boolean)
- is_executing_task()[source]#
- Returns:
Description of the error of last executed task (or None if success).
- Return type:
(str)
- is_mounted_sample(sample_location)[source]#
Check if the sample is mounted. :param sample_location: Sample location to check.
- Returns:
True if mounted.
- Return type:
(bool)
- is_normal_state()[source]#
- Returns:
True if state is not in the ‘NOT USABLE’ states list.
- Return type:
(bool)
- is_task_finished()[source]#
- Returns:
Description of the error of last executed task (or None if success).
- Return type:
(str)
- load(sample=None, wait=True)[source]#
Load a sample.
- Parameters:
sample (tuple) – sample address on the form (component1, … ,component_N-1, component_N)
wait (boolean) – True to wait for load to complete False otherwise
- Returns
- (Object): Value returned by _execute_task either a Task or result of the
operation
- reset(wait=True)[source]#
Reset the sample changer.
wait: If True wait for reset to finish otherwise return immediately
- Returns:
- Value returned by _execute_task either a Task or result of the
operation
- Return type:
(Object)
- select(component, wait=True)[source]#
Select a component.
- Parameters:
component (Component) – Component to select
wait (boolean) – True to wait for selection to complete otherwise False
- Rerturns:
- (Object): Value returned by _execute_task either a Task or result of the
operation
- set_progress_message(message: str) None [source]#
Set progress message describing the current sample changer activity.
- Parameters:
message (str) – string describing current sample changer activity.
- Return type:
None
- unload(sample_slot=None, wait=True)[source]#
Unload sample to location sample_slot, unloads to the same slot as it was loaded from if None is passed
- Parameters:
sample_slot (tuple) – sample address on the form (component1, … ,component_N-1, component_N)
wait – If True wait for unload to finish otherwise return immediately
- Returns:
- Value returned by _execute_task either a Task or result of the
operation
- Return type:
(Object)
- update_info()[source]#
Update sample changer sample information, currently loaded sample and emits infoChanged and loadedSampleChanged when loaded sample have changed