new_gui: remove focus-measure (unused in current beamline GUI)

Stop enabling/displaying the per-frame focus metric; also lightens the camera
thread's per-frame work.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
appleb_m
2026-06-24 22:53:37 +02:00
co-authored by Claude Opus 4.8
parent 53aeabd99e
commit 8a5bdf142a
4 changed files with 6 additions and 16 deletions
+5 -4
View File
@@ -61,10 +61,11 @@ Backend contract is documented in the `new-gui-backend-paths` memory.
- **Baton** chip ← `baton_status_changed`.
- **Sample list** ← `spreadsheet` → Sample Changer + Library.
- **Camera** ← `PredictionSubscriber` (live SAMCAM image, fps, target point).
ML detection overlays (boxes + convex-hull polygons, per-class colours), a
state-coloured beam-centre marker (`geom.beam_location_pxl`), and a focus
readout (`focus_measure`). Camera controls (⚙ gain/exposure → `samcam_settings`,
AF → `autofocus`, ◉ → `send_screenshot_db`) live in the tab strip.
ML detection overlays (boxes + convex-hull polygons, per-class colours) and a
state-coloured beam-centre marker (`geom.beam_location_pxl`). Inline camera
Exp/Gain (`samcam_settings`), AF (`autofocus`), and screenshot
(`send_screenshot_db`) live in the tab strip. (Focus-measure is disabled —
unused in the current beamline GUI.)
- **Gonio / Beamline tabs** ← axis IP video via `VideoThread` (`frame_ready`).
- **Staff Tools** (⚙ Tools in the top bar, staff only) — a tabbed dialog
(`widgets/staff_tools.py`): **Beam/detector** (beam centre/size/mark, ABR
+1 -1
View File
@@ -21,7 +21,7 @@ Start→`automated_scan`).
- ML detection boxes/polygons (Crystal/Loop/Pin/Ice/Needle colours) ← `prediction_subscriber.prediction`
- Beam-centre crosshair marker ← `status.geom.beam_location_pxl`
- Camera exposure/gain controls + screenshot-to-DB(+metadata) ← `samcam_settings`, `send_screenshot_db`
- Focus-measure readout`prediction_subscriber.focus_measure`
- ~~Focus-measure readout~~ — removed (unused in the current beamline GUI)
- Smargon bookmarks (Ctrl+click position markers) ← `models/bookmark.py`
- Helical start/end markers (only if helical is in scope)
-4
View File
@@ -305,10 +305,6 @@ class MainWindow(QWidget):
self.camera_thread.target_point.connect(cam.update_target_point)
if hasattr(self.camera_thread, "prediction"):
self.camera_thread.prediction.connect(cam.update_predictions)
if hasattr(self.camera_thread, "focus_measure"):
self.camera_thread.focus_measure.connect(cam.update_focus)
if hasattr(self.camera_thread, "enable_focus_measurement"):
self.camera_thread.enable_focus_measurement(True)
if hasattr(self.camera_thread, "update_daq_status"):
self.daq.update.connect(self.camera_thread.update_daq_status)
# staff-view camera mirrors the same stream
-7
View File
@@ -58,7 +58,6 @@ class CameraViewport(QWidget):
self._beam_px: QPoint | None = None # beam centre, image-pixel coords
self._beam_shutter = False
self._beam_busy = False
self._focus: float | None = None
self._detections: list = [] # raw boxes from prediction
self._det_shape = None # [h, w] of the inference image
self._show_detections = True
@@ -255,10 +254,6 @@ class CameraViewport(QWidget):
self._beam_busy = bool(busy)
self.update()
def update_focus(self, value: float) -> None:
self._focus = value
self.update()
def update_predictions(self, payload: dict) -> None:
if not isinstance(payload, dict):
return
@@ -473,8 +468,6 @@ class CameraViewport(QWidget):
painter.setFont(f)
fps = "-" if self._fps != self._fps else f"{self._fps:.0f}" # NaN-safe
text = f"SAMCAM · {fps} fps · {self._zoom:.1f}×"
if self._focus is not None and self._focus == self._focus: # NaN-safe
text += f" · focus {self._focus:.0f}"
painter.drawText(QRect(0, 8, r.width() - 14, 16),
Qt.AlignRight | Qt.AlignTop, text)