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 <noreply@anthropic.com>
This commit was merged in pull request #262.
This commit is contained in:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user