Depend only on generic Camera and Stage

I've now defined parent classes for camera and stage, and depend only on those. This allows
proper typing while enabling the actual hardware
classes to be swapped.

The interfaces definitely aren't final - this is a first
draft, largely to enable me to test out the concept
of a configuration server.
This commit is contained in:
Richard Bowman 2024-08-09 02:41:39 +01:00
parent aa49cfcba3
commit 2268425bf3
8 changed files with 204 additions and 100 deletions

View file

@ -19,14 +19,14 @@ from labthings_fastapi.dependencies.thing import direct_thing_client_dependency
from labthings_fastapi.dependencies.blocking_portal import BlockingPortal
from labthings_fastapi.decorators import thing_action
from labthings_fastapi.types.numpy import NDArray
from labthings_picamera2.thing import StreamingPiCamera2
from labthings_sangaboard import SangaboardThing
from .camera import Camera as CameraThing
from .stage import Stage as StageThing
import numpy as np
from pydantic import BaseModel
Stage = direct_thing_client_dependency(SangaboardThing, "/stage/")
Camera = raw_thing_dependency(StreamingPiCamera2)
WrappedCamera = direct_thing_client_dependency(StreamingPiCamera2, "/camera/")
Stage = direct_thing_client_dependency(StageThing, "/stage/")
Camera = raw_thing_dependency(CameraThing)
WrappedCamera = direct_thing_client_dependency(CameraThing, "/camera/")
### Autofocus utilities