mxcubecore.HardwareObjects.abstract.AbstractSampleView#
Abstract class for a Sample View. Defines methods to handle snapshots, animation and shapes.
Classes
|
AbstractSampleView Class |
- class mxcubecore.HardwareObjects.abstract.AbstractSampleView.AbstractSampleView(name)[source]#
Bases:
HardwareObject
AbstractSampleView Class
- abstract add_shape(shape)[source]#
Add the shape <shape> to the dictionary of handled shapes. :param shape: Shape to add :type shape: Shape
- abstract add_shape_from_mpos(mpos_list, screen_cord, _type, state: Literal['HIDDEN', 'SAVED', 'TMP'] = 'SAVED', user_state: Literal['HIDDEN', 'SAVED', 'TMP'] = 'SAVED')[source]#
Add a shape of type <t>, with motor positions from mpos_list and screen position screen_coord. :param mpos_list: List of motor positions :type mpos_list: list[mpos_list] :param screen_coord: Screen cordinate for shape :type screen_coord: tuple(x, y :param _type: Type str for shape, P (Point), L (Line), G (Grid) :type _type: str :param user_state: State of the shape set by the user :type user_state: ShapeState
- property backlight#
Get Back light object. :returns: Back light hardware object. :rtype: (AbstractLight)
- property camera#
Get camera object. :returns: Camera hardware object. :rtype: (AbstractCamera)
- abstract de_select_shape(sid)[source]#
De-select the shape with id <sid>. :param sid: The id of the shape to de-select. :type sid: str
- abstract delete_shape(sid)[source]#
Remove the shape with specified id from the list of handled shapes. :param sid: The id of the shape to remove :type sid: str
- Returns:
The removed shape
- Return type:
(Shape)
- property frontlight#
Get Front light object :returns: Front light hardware object. :rtype: (AbstractLight)
- abstract get_grid()[source]#
Get the first of the selected grids, (the one that was selected first in a sequence of select operations). :returns: The first selected grid as a dictionary. :rtype: (dict)
- abstract get_grids()[source]#
Get all currently handled grids. :returns: All grids currently handled as list. :rtype: (list)
- abstract get_lines()[source]#
Get all the currently handled lines.
- Returns:
All lines currently handled as list.
- Return type:
(list)
- abstract get_points()[source]#
Get all currently handled centred points. :returns: All points currently handled as list. :rtype: (list)
- abstract get_selected_shapes()[source]#
Get all selected shapes. :returns: (list) List of the selected Shapes.
- abstract get_shape(sid)[source]#
Get Shape with id <sid>.
- Parameters:
sid (str) – id of Shape to retrieve
- Returns:
(Shape) All the shapes
- abstract get_snapshot(overlay: bool | str = True, bw=False, return_as_array=False)[source]#
Get snappshot(s) :param overlay: Display shapes and other items on the snapshot :type overlay: bool | str :param bw: return grayscale image :type bw: bool :param return_as_array: return as np array :type return_as_array: bool
- abstract inc_used_for_collection(cpos)[source]#
Increase the counter that keepts on collect made on this shape, shape with associated CentredPosition cpos. :param cpos: CentredPosition of shape :type cpos: CentredPosition
- abstract is_selected(sid)[source]#
Check if Shape with specified id is selected. :param sid: Shape id. :type sid: int
- Returns:
(Boolean) True if selected, False otherwise.
- save_scene_animation(filename, duration=1)[source]#
Take snapshots and create an animation. :param filename: The filename. :type filename: str :param duration: Duration time [s]. :type duration: int
- abstract save_snapshot(filename, overlay: bool | str = True, bw=False)[source]#
Save a snapshot to file. :param filename: The filename. :type filename: str :param overlay: Display shapes and other items on the snapshot. :type overlay: bool | str :param bw: Return grayscale image. :type bw: bool
- abstract select_shape(sid)[source]#
Select the shape <shape>. :param sid: Id of the shape to select. :type sid: str
- abstract select_shape_with_cpos(cpos)[source]#
Selects shape with the assocaitaed centred posotion <cpos> :param cpos: Centred position :type cpos: CentredPosition
- property shapes#
Get shapes dict. :returns: Shapes hardware object. :rtype: (AbstractShapes)
- property zoom#
Get zoom object. :returns: Zoom gardware object. :rtype: (AbstractZoom)