From 5421c95d2614bb3ce4e54df397133a44c38b1d94 Mon Sep 17 00:00:00 2001 From: x01dc Date: Thu, 16 Jul 2026 15:40:14 +0200 Subject: [PATCH] fix(flomni): unpack sample owner on the status webpage FlomniWebpageGenerator._collect_setup_data() read the raw flomni_samples.sample_names.sample0 DESC signal directly, so once 7e8e807 started packing "name | owner" into that same field (there's no separate PV for owner), the status page showed the raw delimiter-joined string as the sample name instead of unpacking it -- same gap FlomniSampleStorage.get_sample_name_and_owner()/show_all() already handle correctly. Now unpacks via sample_desc_codec.unpack_desc() and appends "(owner: ...)" when set, mirroring show_all()'s own format. Lamni has no equivalent gap: it has no automatic sample changer or storage, so its sample_name global var was never given an owner field. Co-Authored-By: Claude Sonnet 5 --- .../plugins/flomni/flomni_webpage_generator.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/csaxs_bec/bec_ipython_client/plugins/flomni/flomni_webpage_generator.py b/csaxs_bec/bec_ipython_client/plugins/flomni/flomni_webpage_generator.py index 0fe6885..9b66ba4 100644 --- a/csaxs_bec/bec_ipython_client/plugins/flomni/flomni_webpage_generator.py +++ b/csaxs_bec/bec_ipython_client/plugins/flomni/flomni_webpage_generator.py @@ -43,6 +43,7 @@ from csaxs_bec.bec_ipython_client.plugins.OMNY_shared.webpage_generator_base imp _safe_get, _safe_float, ) +from csaxs_bec.devices.omny.sample_desc_codec import unpack_desc class FlomniWebpageGenerator(WebpageGeneratorBase): @@ -94,7 +95,21 @@ class FlomniWebpageGenerator(WebpageGeneratorBase): dm = self._bec.device_manager # ── Sample name ─────────────────────────────────────────────── - sample_name = _safe_get(dm, "flomni_samples.sample_names.sample0") or "N/A" + # slot 0 of flomni_samples is the flOMNI measurement stage itself + # (see FlomniSampleStorage.show_all()'s own "flOMNI stage:" label + # for slot 0 -- not an arbitrary tray position). The raw DESC value + # is packed as "name | owner" (sample_desc_codec.pack_desc, added + # 7e8e807) -- unpack it here too, the same way + # FlomniSampleStorage.get_sample_name_and_owner() and show_all() + # already do, so the page doesn't show the raw delimiter-joined + # string as the "sample name". Owner is appended in parentheses, + # mirroring show_all()'s own "(owner: ...)" formatting. + raw_sample = _safe_get(dm, "flomni_samples.sample_names.sample0") + if raw_sample is None: + sample_name = "N/A" + else: + name, owner = unpack_desc(raw_sample) + sample_name = f"{name} (owner: {owner})" if owner else name # ── Temperatures ────────────────────────────────────────────── temperatures = {