update to match calibration data handling

This commit is contained in:
ykcheungab
2026-09-10 21:50:36 +08:00
parent a4766abee8
commit 705eaabcca
9 changed files with 284 additions and 142 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 MiB

After

Width:  |  Height:  |  Size: 2.2 MiB

@@ -128,6 +128,7 @@ class CustomerMainWindow(QMainWindow):
self.setStatusBar(QStatusBar())
self.cal_panel.status_message.connect(self.statusBar().showMessage)
self.cal_panel.calibration_exported.connect(self._on_calibration_exported)
self._build_menus()
self._wire_toolbar()
self._wire_sensor_picker()
@@ -434,6 +435,13 @@ class CustomerMainWindow(QMainWindow):
self._apply_panel_visibility()
self._persist_prefs()
def _on_calibration_exported(self, path: str) -> None:
"""Apply newly written force_calibration.json to the running Sensor."""
self._ensure_workers()
for worker in (self._box_worker, self._finger_worker):
if worker is not None and hasattr(worker, "set_pending_calibration"):
worker.set_pending_calibration(path)
def _on_finger_3d_toggled(self, visible: bool) -> None:
if self.sensor_picker.sensor_type() != "finger":
return
@@ -38,6 +38,7 @@ from orisys_app_shared.paths import calibration_export_dir, sensors_dir
class CalPanel(QFrame):
status_message = pyqtSignal(str)
calibration_exported = pyqtSignal(str) # path applied to running sensor
def __init__(self, parent=None) -> None:
super().__init__(parent)
@@ -335,4 +336,7 @@ class CalPanel(QFrame):
if warnings:
msg += "\n" + t("cal.export_warnings", detail="; ".join(warnings))
self.status_message.emit(msg)
# Prefer the bundle file for live apply so the next Sensor() also sees it.
apply_path = local_path if local_path is not None else primary
self.calibration_exported.emit(str(apply_path))
QMessageBox.information(self, t("panels.cal"), msg)
@@ -9,6 +9,7 @@ from PyQt5.QtWidgets import QFrame, QHBoxLayout, QLabel, QVBoxLayout
from orisys_app_shared.acquisition.constants import FORCE_SAMPLE_RATE_HZ, LOWPASS_CUTOFF_HZ
from orisys_app_shared.force import MetricHistory
from orisys_app_shared.force.history import DEFAULT_MAX_FPS
from orisys_app_shared.i18n import t
from orisys_app_shared.theme import color
@@ -40,6 +41,7 @@ class ForcePlotsPanel(QFrame):
sample_rate_hz=FORCE_SAMPLE_RATE_HZ,
lowpass_cutoff_hz=LOWPASS_CUTOFF_HZ,
y_axis_min_span=0.5,
max_fps=DEFAULT_MAX_FPS,
)
root = QVBoxLayout(self)