界面不摆还没接线的开关:先撤掉“同时显示未滤波曲线” - What: plot_settings_dialog 去掉"同时显示未滤波曲线"复选框(连同 reset 里的清位、retranslate 的两行文案、filter_values() 里的读取),filter_values() 里写明 show_unfiltered 暂时固定 False 及原因;两个 locale 删掉 filter_show_unfiltered / filter_show_unfiltered_tip 两个键。FilterSettings.show_unfiltered 字段保留(session.json 的 filters 块仍在记它,等第二 buffer 接上后再把开关放回对话框)。 - Why: 上一版把这个复选框放进了对话框,但"未滤波曲线"还没有数据通路——力值卡片不画、CSV 也没有 *_unfiltered 列,等于界面上摆了一个承诺了却不做事的开关;这正是这一轮一直在清理的那类问题(文件说的/界面说的与实际做的不一致)。宁可先不给入口,也不要给一个假的。 - Verification: .repro/locale_check.py:287 个字面键全部命中、两个 locale 键集合相同(341/341);studio 全量 89 passed;ui_check 554 项检查 0 失败。 - Not in this change: CSV 的 17 列与未滤波第二 buffer 仍未接线(这是把开关放回来的前提)。

This commit is contained in:
ykcheungab
2026-09-14 11:10:28 +08:00
parent 92e0b95ca2
commit a9f75a868d
3 changed files with 6 additions and 14 deletions
@@ -196,9 +196,6 @@ class PlotSettingsDialog(QDialog):
lambda checked: self.rate_spin.setEnabled(not checked)
)
self.show_unfiltered_check = QCheckBox()
self.show_unfiltered_check.setChecked(bool(filters.show_unfiltered))
self.filter_preset_label = QLabel()
self.flow_ema_label = QLabel()
self.median_label = QLabel()
@@ -212,11 +209,9 @@ class PlotSettingsDialog(QDialog):
group_form.addRow(self.lowpass_label, self.lowpass_spin)
group_form.addRow(self.lowpass_order_label, self.lowpass_order_spin)
group_form.addRow(self.rate_auto_check, self.rate_spin)
group_form.addRow(self.show_unfiltered_check)
for widget in (self.flow_ema_spin, self.median_spin, self.lowpass_spin,
self.rate_spin, self.rate_auto_check,
self.show_unfiltered_check):
self.rate_spin, self.rate_auto_check):
widget.setToolTip("") # filled in by retranslate()
self.flow_ema_spin.valueChanged.connect(self._on_filter_value_edited)
self.median_spin.valueChanged.connect(self._on_filter_value_edited)
@@ -291,13 +286,17 @@ class PlotSettingsDialog(QDialog):
rate: float | str = "auto"
if not self.rate_auto_check.isChecked():
rate = float(self.rate_spin.value())
# ``show_unfiltered`` is deliberately not offered here yet: the second
# (unfiltered) buffer is not wired to the cards or the CSV, and a switch
# that promises a curve it does not draw is worse than no switch. The
# field is kept in the settings (and in the record) until it lands.
return FilterSettings(
flow_ema_alpha=float(self.flow_ema_spin.value()),
median_window=int(self.median_spin.value()),
lowpass_hz=float(self.lowpass_spin.value()),
lowpass_order=int(self.lowpass_order_spin.value()),
sample_rate_hz=rate,
show_unfiltered=self.show_unfiltered_check.isChecked(),
show_unfiltered=False,
preset=self.selected_preset(),
).normalised()
@@ -352,7 +351,6 @@ class PlotSettingsDialog(QDialog):
self.lowpass_spin.setValue(0.0)
self.lowpass_order_spin.setValue(2)
self.rate_auto_check.setChecked(True)
self.show_unfiltered_check.setChecked(False)
self._show_preset("off")
self._refresh_filter_note()
@@ -385,8 +383,6 @@ class PlotSettingsDialog(QDialog):
self.rate_auto_check.setToolTip(t("dialog.filter_rate_auto_tip"))
self.rate_label.setText(t("dialog.filter_rate"))
self.rate_spin.setToolTip(t("dialog.filter_rate_tip"))
self.show_unfiltered_check.setText(t("dialog.filter_show_unfiltered"))
self.show_unfiltered_check.setToolTip(t("dialog.filter_show_unfiltered_tip"))
self._refresh_filter_note()
ok_btn = self.button_box.button(QDialogButtonBox.Ok)
cancel_btn = self.button_box.button(QDialogButtonBox.Cancel)