缩短 Studio 叠字与重复说明,色标只保留量程

去掉 depth_empty 与无用选区峰值文案,并修正「视图 → 分析视频」。已用 locale 单测与 depth_scale_text 核对;含证据录制的 wiring 用例本机跳过。
This commit is contained in:
ykcheungab
2026-10-08 15:41:30 +08:00
parent 48624dec99
commit f2bbab76a6
5 changed files with 56 additions and 69 deletions
+8 -14
View File
@@ -161,25 +161,19 @@ class FrameView:
panel.set_shared_depth_scale(span)
def depth_scale_text(self, frame: ImageFrame | None = None) -> str:
"""The colour scale, plus — when the frame's depth is exactly zero — why it is flat.
"""The colour scale for the depth now on screen.
A depth view of an all-zero map is a flat island in the ramp's low colour, which
looks the same as a broken view. The frame knows which it is: the pass stored the
channel, its non-zero count and its range, so "0 of 84,000 pixels" can be said
instead of leaving the operator to wonder. It is not the same statement as
``panels.depth_unavailable``, which is for a frame that carries no depth at all.
``frame`` is kept so callers can pass the painted frame; the label is
the latched / adaptive / fixed span. A frame with no depth channel is
handled by ``panels.depth_unavailable``.
"""
_ = frame
span = self.active_depth_span()
text = "" if span is None else t(
if span is None:
return ""
return t(
"panels.depth_scale", low=f"{span[0]:.3f}", high=f"{span[1]:.3f}"
)
if frame is None or frame.depth is None:
return text
array = np.asarray(frame.depth)
if array.size and not bool(np.any(array)):
empty = t("panels.depth_empty", pixels=int(array.size))
return f"{text} · {empty}" if text else empty
return text
def latched_domain_mask(self, frame: ImageFrame):
"""The 2D domain boundary to draw, latched for the session.