flomni: add laser_parameters CLI and laser_tweak tool

Expose the ConstEmitter runtime constants through the high-level flomni
interface, alongside the existing laser_tracker_* methods, and add an
interactive tweak tool for the two tracking target positions.

New methods on FlomniSampleTransferMixin (thin wrappers delegating to
dev.rtx.controller, same pattern as laser_tracker_show_all):
  laser_parameters_show_all()
  laser_parameters_set_targety(val)
  laser_parameters_set_targetz(val)
  laser_parameters_set_intensity_threshold_laser(val)
  laser_parameters_set_psd_intensity_threshold_tracking_low(val)

laser_tweak(): interactive 2D raw-terminal loop for the two tracking targets,
modeled on OMNYTools.tweak_cursor.
  left/right : target y -/+   (fixed 0.01 step, absolute set of current +/- step)
  up/down    : target z +/-
  s          : return both targets to their launch positions
  q          : quit (terminal state restored in finally)
On launch and after every change it prints the current y/z targets and the
fzp x interferometer signal (read_ssi_interferometer channel 1), so the signal
response can be watched while tweaking.

termios/tty/fcntl/sys are imported locally in laser_tweak to avoid touching
module-level imports. Additive change; no existing behaviour modified. Requires
the ConstEmitter emitter_* methods on RtFlomniController.
This commit is contained in:
x12sa
2026-07-12 07:28:10 +02:00
committed by holler
co-authored by holler
parent 804ffef5b0
commit 040468968f
@@ -480,7 +480,7 @@ class FlomniSampleTransferMixin:
def laser_parameters_set_psd_intensity_threshold_tracking_low(self, val: float):
dev.rtx.controller.emitter_set_psd_intensity_threshold_tracking_low(val)
def laser_tweak(self):
def laser_parameters_tweak_tracking(self):
"""Interactive tweak of the two laser tracking target positions.
Arrow keys nudge the ConstEmitter tracking targets by a fixed step of
@@ -494,15 +494,27 @@ class FlomniSampleTransferMixin:
After every change the current y/z targets and the fzp x interferometer
signal strength (channel 1) are printed, so one can watch the signal
respond while tweaking.
Requires the laser tracker to be enabled: with the tracker off nothing
moves on the hardware side, so the tweak would be a no-op.
"""
import fcntl
import sys
import termios
import tty
step = 0.01
controller = dev.rtx.controller
if not controller.laser_tracker_check_enabled():
print(
"The laser tracker is disabled. Enable it with laser_tracker_on() "
"before tweaking the tracking targets - otherwise nothing moves on "
"the hardware side."
)
return
step = 0.02
def read_targets():
values = controller.emitter_get()
return (