class documentation

class GalleryThing(lt.Thing): (source)

View In Hierarchy

A Thing for communicating with the front end gallery.

Method __enter__ Mark this Thing as entered.
Method delete_all_data Delete all the gallery data on this microscope with the given card types.
Class Variable all_ofm_things Undocumented
Property bulk_actions All bulk actions.
Property card_type_map A mapping from thing name to card type.
Property card_types Names for the card types in the gallery.
Property gallery_providing_things All Things that can provide data to the gallery.
Property list_data List the data from all registered things.
Method _set_card_types Find the card types from each provider.
Method _set_gallery_providers Set the mapping of gallery providing things.
Class Variable _bulk_actions Undocumented
Instance Variable _card_type_map Undocumented
Instance Variable _card_types Undocumented
Instance Variable _entered Undocumented
Instance Variable _gallery_providing_things Undocumented
def __enter__(self) -> Self: (source)

Mark this Thing as entered.

Sets self._entered to True. This is used to determine if self._set_gallery_providers can be called. As the gallery providers cannot be set until all OFMThings are entered.

@lt.action
def delete_all_data(self, card_types: list[str]): (source)

Delete all the gallery data on this microscope with the given card types.

all_ofm_things: Mapping[str, OFMThing] = (source)

Undocumented

@lt.property
bulk_actions: list[ActionButton] = (source)

All bulk actions.

@property
card_type_map: dict[str, str] = (source)

A mapping from thing name to card type.

@lt.property
card_types: list[str] = (source)

Names for the card types in the gallery.

@property
gallery_providing_things: dict[str, GalleryCompatibleThing] = (source)

All Things that can provide data to the gallery.

@lt.property
list_data: list[GalleryEntryModel] = (source)

List the data from all registered things.

Currently only works with smart_scan as the UI cards are not customisable.

This will change to an action (or another type of endpoint) at a later date to enable filtering, and returning only a specific page.

def _set_card_types(self, gallery_providers: dict[str, GalleryCompatibleThing]): (source)

Find the card types from each provider.

This is not called on __enter__ as it can only be called once all OFMThings have also been entered. Instead, it is called on the first attempt to read a gallery provider.

Parameters
gallery_providers:dict[str, GalleryCompatibleThing]The dictionary of gallery providing things. If card data cannot be extracted for a Thing it will be popped from the provider dictionary.
def _set_gallery_providers(self): (source)

Set the mapping of gallery providing things.

This is called on __enter__ when the server starts.

_bulk_actions: list[ActionButton] | None = (source)

Undocumented

_card_type_map: dict[str, str] | None = (source)

Undocumented

_card_types: list[str] | None = (source)

Undocumented

_entered: bool = (source)

Undocumented

_gallery_providing_things: dict[str, GalleryCompatibleThing] | None = (source)

Undocumented