System¶
- class mundo.api.system.ProbeState(value)¶
The current status of the insertion and ejection of the probe. This keeps track on whether or not the probe is fully inserted, fully ejected, or somewhere inbetween.
- EJECTED = 0¶
- EJECT_IN_PROGRESS = 1¶
- INSERT_IN_PROGRESS = 2¶
- INSERTED = 3¶
- class mundo.api.system.System(load_plugins: bool = True)¶
This class defines the interface used by the GUI. It controls the x,y,z-stages as a complete system. Thus abstracting the individual motors from the user interface.
- __init__(load_plugins: bool = True) None¶
Sets the configuration object and creates the x,y,z-stage motor objects.
- Parameters
load_plugins – If plugins should be loaded, defaults to True
- property context: mundo.api.context.ApplicationContext¶
Returns the application context.
- Returns
The application context
- property connection: mundo.api.connection.ConnectionManager¶
Return the internal connection manager instance of the
ConnectionManagerclass. This allows you to manage the connection of the underlying controllers.- Returns
The connection manager instance
- property plugins: mundo.api.plugins.PluginManager¶
The plugin manager instance.
- Returns
A reference to the plugin manager instance
- property probe_state: mundo.api.system.ProbeState¶
The current state of the insertion/ejection process.
- broadcast(event: mundo.api.events.Event, *args) None¶
Broadcasts an event to plugins and registered event listeners.
- Parameters
event – The event to broadcast
*args – Event arguments, if any
- reload_plugins() None¶
Reloads and reactivates application plugins. This will re-interpret the code exported by each available plugin, as well as re-render the plugins in the GUI.
- get_current_position() Optional[Tuple[Optional[float], Optional[float], Optional[float]]]¶
Gets the current position of the three connected motors as (X, Y, Z), defined in nanometers.
- Returns
A tuple containing the (X, Y, Z) positions for each motor in nanometers
- calibrate(positions: Tuple[Tuple[float, float, float], Tuple[float, float, float], Tuple[float, float, float]]) Tuple[bool, Optional[matplotlib.figure.Figure]]¶
Calibrates the system by setting the position for the first sample tube. This must be called before methods such as
start_session()can be called.- Parameters
positions – The three positions used as calibration points. Each position contains the position of each motor in the X, Y, and Z axes
- Returns
A tuple containing True and a matplotlib figure with the sample positions if the calibration was set successfully. A tuple containing False and None otherwise
- insert_probe() bool¶
Move the platform so that the probe is inserted into the sample. The distance that the probe is inserted into the hole is defined in the config.
- eject_probe() bool¶
Move the platform so that the probe is out off the sample. This step must be preformed before moving any other direction.
- move_step(axis: mundo.api.axis.Axis, direction: int = 1, step_size: float = 1000000.0) None¶
Move manually in a single axis for a specified distance, specified in nanometers.
- Parameters
axis – The specified axis to move manually
direction – The direction to move in. A positive value indicates that the motor should move away from the 0 position, whereas a negative value indicates that the motor should move towards the 0 position
step_size – The distance that should be moved, specified in nanometers
- move_to_position(target: Tuple[Optional[float], Optional[float], Optional[float]]) bool¶
Moves the platform to absolute position. Each motor will be ran in a separate thread in order to perform each movement in parallel.
- Parameters
target – The position to move to, in nanometers. If an axis has None as value, the platform will not move in this axis
- Returns
True if the platform moved successfully in all axes that did not contain None as value, or if all axes are None. False otherwise
- move_axis_to_position(axis: mundo.api.axis.Axis, position: float) bool¶
Moves the platform in a single axis to an absolute position.
- Parameters
axis – The axis to move in
position – The position to move to in nanometers
- Returns
True if the platform moved successfully in the selected axis. False otherwise
- stop_movement() bool¶
Stops the movement of the motors.
- Returns
True if the motors was stopped successfully, False otherwise
- pause_movement() bool¶
Pauses the movement of the motors. The motors will no longer be able to move, unless resumed. :return: True if the motors was paused successfully,
False otherwise
- resume_movement() bool¶
Resumes the movement of the motors. The motors will now be able to move. :return: True if the motors was resumed successfully,
False otherwise
- finish_current_sample() Tuple[bool, Optional[mundo.api.sample.Sample]]¶
Finishes the currently processing sample by ejecting the probe.
- process_sample(next_sample: mundo.api.sample.Sample) Tuple[bool, Optional[mundo.api.sample.Sample]]¶
Processes the next sample in the sample queue.
- stop_process() bool¶
Stop the movement of the motors as fast as possible.
- resume_process() bool¶
Resume the movement of the motors.
- reset_process() Tuple[bool, Optional[mundo.api.sample.Sample]]¶
If the motors has been stopped or the process is over, then you can move the motors position to an initial position.
- Returns
The sample that was previously being processed, or None if the reset failed, or no sample was being processed