From 676d34842a73eeca9402b683592bedec26aac317 Mon Sep 17 00:00:00 2001 From: Joe Knapper Date: Wed, 11 Feb 2026 10:19:19 +0000 Subject: [PATCH] Apply suggestions from code review of branch flash-led-sim Co-authored-by: Julian Stirling --- .../things/camera/simulation.py | 2 +- .../things/illumination.py | 8 ++++---- .../things/stage/sangaboard.py | 1 - .../aboutComponents/statusPane.vue | 12 +++++++++++- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/openflexure_microscope_server/things/camera/simulation.py b/src/openflexure_microscope_server/things/camera/simulation.py index 730a6539..916a6067 100644 --- a/src/openflexure_microscope_server/things/camera/simulation.py +++ b/src/openflexure_microscope_server/things/camera/simulation.py @@ -340,7 +340,7 @@ class SimulatedCamera(BaseCamera): pl_img = Image.fromarray(np_img.astype("uint8")) return pl_img.resize((self.shape[1], self.shape[0]), Image.Resampling.BILINEAR) - @lt.action + def set_led(self, led_on: bool = True) -> None: def set_led(self, led_on: bool = True, led_channel: str = None) -> None: # noqa: ARG002 """Set the simulated LED to on or off.""" if led_on: diff --git a/src/openflexure_microscope_server/things/illumination.py b/src/openflexure_microscope_server/things/illumination.py index d1d5e193..d9d0d2c6 100644 --- a/src/openflexure_microscope_server/things/illumination.py +++ b/src/openflexure_microscope_server/things/illumination.py @@ -5,8 +5,8 @@ from typing import Literal import labthings_fastapi as lt -from .camera import BaseCamera -from .stage import BaseStage +from .camera import SimulatedCamera +from .stage import SangaboardThing class Illumination(lt.Thing): @@ -27,7 +27,7 @@ class Illumination(lt.Thing): class SangaIllumination(Illumination): """Illumination driven by a Sangaboard.""" - _stage: BaseStage = lt.thing_slot() + _stage: SangaboardThing = lt.thing_slot() @lt.action def flash( @@ -51,7 +51,7 @@ class SangaIllumination(Illumination): class SimulatorIllumination(Illumination): """Illumination control in the simulator.""" - _cam: BaseCamera = lt.thing_slot() + _cam: SimulatedCamera = lt.thing_slot() @lt.action def flash( diff --git a/src/openflexure_microscope_server/things/stage/sangaboard.py b/src/openflexure_microscope_server/things/stage/sangaboard.py index 9a9b7fe5..7429aea3 100644 --- a/src/openflexure_microscope_server/things/stage/sangaboard.py +++ b/src/openflexure_microscope_server/things/stage/sangaboard.py @@ -173,7 +173,6 @@ class SangaboardThing(BaseStage): sb.zero_position() self.update_position() - @lt.action def set_led( self, led_on: bool = True, diff --git a/webapp/src/components/tabContentComponents/aboutComponents/statusPane.vue b/webapp/src/components/tabContentComponents/aboutComponents/statusPane.vue index ce603f83..a2cd0b5d 100644 --- a/webapp/src/components/tabContentComponents/aboutComponents/statusPane.vue +++ b/webapp/src/components/tabContentComponents/aboutComponents/statusPane.vue @@ -13,7 +13,7 @@ {{ $store.state.origin }} +
+ Illumination: +
+
+ {{ illuminationType }} +
+

@@ -77,6 +84,9 @@ export default { stageType() { return this.thingAvailable("stage") ? this.thingDescription("stage").title : undefined; }, + illuminationType() { + return this.thingAvailable("illumination") ? this.thingDescription("illumination").title : undefined; + }, }, async mounted() {