class documentation

class OpenFlexureSystem(lt.Thing): (source)

View In Hierarchy

Describe and control the OpenFlexure system.

This Thing:

  • Exposes information about the Microscope, Server, and Thing states to the web
    API.
  • Controls the underlying OS on the Raspberry Pi allowing shutdown and restarting
    of the system.
Method get_things_state Metadata summarising the current state of all Things in the server.
Method reboot Attempt to reboot the device.
Method shutdown Attempt to shutdown the device.
Property hardware_id A unique identifier for the Microscope CPU.
Property hostname The hostname of the microscope, as reported by its operating system.
Property is_raspberrypi Return True if running on a Raspberry Pi.
Property microscope_id A unique identifier for this microscope.
Property os_version Return the OS version of the Pi. Returns None if not on a Pi.
Property thing_state Summary metadata describing the current state of the Thing.
Property version_data The version string and version source for the server.
Class Variable _class_settings Undocumented
Class Variable _hardware_id Undocumented
Class Variable _microscope_id Undocumented
Class Variable _version_data Undocumented
@lt.action
def get_things_state(self) -> Mapping: (source)

Metadata summarising the current state of all Things in the server.

@lt.action
def reboot(self) -> CommandOutput: (source)

Attempt to reboot the device.

@lt.action
def shutdown(self) -> CommandOutput: (source)

Attempt to shutdown the device.

@lt.property
hardware_id: str | None = (source)

A unique identifier for the Microscope CPU.

This may be unset on simulation or manual microscopes.

@lt.property
hostname: str = (source)

The hostname of the microscope, as reported by its operating system.

@lt.property
is_raspberrypi: bool = (source)

Return True if running on a Raspberry Pi.

@lt.property
microscope_id: UUID | None = (source)

A unique identifier for this microscope.

This is a number set on first boot of the OS. For simulation or manual microscopes running on Windows this will be None.

@lt.property
os_version: str | None = (source)

Return the OS version of the Pi. Returns None if not on a Pi.

@property
thing_state: Mapping[str, Any] = (source)

Summary metadata describing the current state of the Thing.

@lt.property
version_data: VersionData = (source)

The version string and version source for the server.

The source may be a commit hash if installed from git. "TOML" if installed from source, or "Dist" if installed from a distribution package.

If the version or its source cannot be determined an error will be Logged.

_class_settings: dict[str, bool] = (source)

Undocumented

_hardware_id: str | None = (source)

Undocumented

_microscope_id: UUID | None = (source)

Undocumented

_version_data: VersionData | None = (source)

Undocumented