Consolidate the BaseCamera, CameraStub, and CameraProtocol, move StreamingPiCamera2 to this repo
This commit is contained in:
parent
628fd145f3
commit
b5606984ae
11 changed files with 1617 additions and 143 deletions
|
|
@ -22,12 +22,11 @@ from scipy.ndimage import gaussian_filter
|
|||
from labthings_fastapi.utilities import get_blocking_portal
|
||||
from labthings_fastapi.decorators import thing_action, thing_property
|
||||
from labthings_fastapi.dependencies.metadata import GetThingStates
|
||||
from labthings_fastapi.outputs.mjpeg_stream import MJPEGStreamDescriptor
|
||||
from labthings_fastapi.types.numpy import NDArray
|
||||
from labthings_fastapi.server import ThingServer
|
||||
from pydantic import RootModel
|
||||
|
||||
from . import BaseCamera, JPEGBlob
|
||||
from . import BaseCamera, JPEGBlob, ArrayModel
|
||||
from ..stage import StageProtocol as Stage
|
||||
|
||||
# The ratio between "motor" steps and pixels
|
||||
|
|
@ -35,11 +34,6 @@ from ..stage import StageProtocol as Stage
|
|||
RATIO = 0.2
|
||||
|
||||
|
||||
class ArrayModel(RootModel):
|
||||
"""A model for an array"""
|
||||
|
||||
root: NDArray
|
||||
|
||||
|
||||
class SimulatedCamera(BaseCamera):
|
||||
"""A Thing representing an OpenCV camera"""
|
||||
|
|
@ -160,9 +154,6 @@ class SimulatedCamera(BaseCamera):
|
|||
return self._capture_thread.is_alive()
|
||||
return False
|
||||
|
||||
mjpeg_stream = MJPEGStreamDescriptor()
|
||||
lores_mjpeg_stream = MJPEGStreamDescriptor()
|
||||
|
||||
def _capture_frames(self):
|
||||
portal = get_blocking_portal(self)
|
||||
while self._capture_enabled:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue