在单位回退时就近提示缺少可用标定

让实时和回放的原始单位回退原因出现在力曲线单位按钮旁。相关定向测试与 lint gate 通过。
This commit is contained in:
ykcheungab
2026-10-10 15:05:09 +08:00
parent cf86bd0702
commit 48de5b74e6
7 changed files with 42 additions and 3 deletions
@@ -111,6 +111,7 @@ class _Charts:
self.followed = 0
self.shown = 0
self.cleared = 0
self.unit_fallbacks = 0
def unit(self) -> str:
return self._unit
@@ -134,6 +135,9 @@ class _Charts:
def show_all(self) -> None:
self.shown += 1
def show_unit_fallback(self) -> None:
self.unit_fallbacks += 1
class _ImagePanel:
def __init__(self) -> None:
@@ -584,6 +588,7 @@ def test_the_charts_fall_back_to_raw_when_a_recording_has_no_newtons(qt_app):
assert engine.units[-1] == "raw"
assert host.units[-1] == "raw"
assert t("status.units_raw_fallback") in host.notes
assert parts[1].unit_fallbacks == 1
engine._reader = _Reader(newtons=[1.0, 2.0, 3.0])
controller.apply_source(True)