Improvements to properties and docstrings

This commit is contained in:
jaknapper 2026-05-12 13:15:23 +01:00
parent 4d9669f8ae
commit 0e1d9cca18
3 changed files with 29 additions and 10 deletions

View file

@ -179,6 +179,7 @@ class BaseCamera(OFMThing):
mjpeg_stream = lt.outputs.MJPEGStreamDescriptor()
lores_mjpeg_stream = lt.outputs.MJPEGStreamDescriptor()
_memory_buffer = CameraMemoryBuffer()
supports_focus_fom: bool = False
def __init__(self, thing_server_interface: lt.ThingServerInterface) -> None:
"""Initialise the base camera, this creates the background detectors.
@ -213,6 +214,17 @@ class BaseCamera(OFMThing):
"""Close hardware connection when the Thing context manager is closed."""
pass
@property
def focus_fom(self) -> int:
"""Return the focus figure of merit.
This returns a NotImplementedError if not supported by the camera.
To use, requires self.supports_focus_fom to be set to True.
"""
raise NotImplementedError(
"This camera does not support Figure of Merit focusing."
)
@lt.property
def calibration_required(self) -> bool:
"""Whether the camera needs calibrating.