fix(flomni): always attempt tomo_id registration, accept interactive kwarg

Mirrors LamNI.tomo_scan()'s same fix: remove the outer
"bec.active_account != ''" short-circuit so an empty/test account still
goes through add_sample_database() -> TomoIDManager.register() (which
now handles test-host registration itself) instead of hard-coding
tomo_id=0. Also accept an unused interactive kwarg for signature
compatibility with LamNI.tomo_scan(), since tomo_queue_execute() (shared
between both setups) calls tomo_scan(interactive=False) uniformly.
This commit is contained in:
x01dc
2026-07-27 17:02:05 +02:00
parent 1159b018f0
commit d97692e090
@@ -2489,8 +2489,16 @@ class Flomni(
for scan_nr in range(start_scan_number, end_scan_number):
self._write_tomo_scan_number(scan_nr, angle, subtomo_number=0)
def tomo_scan(self, subtomo_start=1, start_angle=None, projection_number=None):
"""start a tomo scan"""
def tomo_scan(
self, subtomo_start=1, start_angle=None, projection_number=None, interactive: bool = True
):
"""start a tomo scan
Args:
interactive: accepted for signature compatibility with
LamNI.tomo_scan() (tomo_queue_execute() calls both the same
way) -- unused here, FlOMNI has no fine-alignment gate.
"""
if not self._check_eye_out_and_optics_in():
print(
@@ -2519,18 +2527,19 @@ class Flomni(
):
# pylint: disable=undefined-variable
if bec.active_account != "":
self.tomo_id = self.add_sample_database(
self.sample_name,
str(datetime.date.today()),
bec.active_account,
bec.queue.next_scan_number,
"flomni",
"test additional info",
"BEC",
)
else:
self.tomo_id = 0
# Always attempt registration (even for an empty/test account)
# and let add_sample_database() -> TomoIDManager.register()
# decide production vs. test-server vs. genuine-failure fallback
# -- see LamNI.tomo_scan()'s equivalent change for why.
self.tomo_id = self.add_sample_database(
self.sample_name,
str(datetime.date.today()),
bec.active_account or "",
bec.queue.next_scan_number,
"flomni",
"test additional info",
"BEC",
)
self.write_pdf_report()
self.progress["tomo_start_time"] = datetime.datetime.now().isoformat()
# reset stale estimates from any previous scan, otherwise the GUI