feat: rebuild Data tab compare view

This commit is contained in:
jack
2026-07-06 13:01:24 -07:00
parent 0f813b2376
commit f604308466
3 changed files with 705 additions and 565 deletions
File diff suppressed because it is too large Load Diff
@@ -357,6 +357,10 @@ class SessionController(QObject):
result = compare_runs(series_a, series_b) result = compare_runs(series_a, series_b)
# Mean temporal shif along the DTW path: positive means run B
# reaches the same profile features lather than run A.
path = result["warping_path"]
frame_offset = round(sum(j - i for i, j in path) / len(path)) if path else 0
# Max sensor deviation: walk the DTW-aligned frame pairs and take # Max sensor deviation: walk the DTW-aligned frame pairs and take
# the largest per-sensor abs difference across all sensors, not # the largest per-sensor abs difference across all sensors, not
# just the sensor[0] series used for alignment. # just the sensor[0] series used for alignment.
@@ -419,6 +423,7 @@ class SessionController(QObject):
"success": True, "success": True,
"distance": result["distance"], "distance": result["distance"],
"warping_path": result["warping_path"][:50], # limit path size "warping_path": result["warping_path"][:50], # limit path size
"frame_offset": frame_offset,
"max_sensor_deviation": max_sensor_deviation, "max_sensor_deviation": max_sensor_deviation,
"series_a": series_a, "series_a": series_a,
"series_b": series_b, "series_b": series_b,
+2 -1
View File
@@ -63,7 +63,8 @@ def test_compare_files_integration(controller):
assert "distance" in args assert "distance" in args
assert "series_a" in args assert "series_a" in args
assert "series_b" in args assert "series_b" in args
assert args["frame_offset"] == 0
def test_recording_toggle(controller, tmp_path): def test_recording_toggle(controller, tmp_path):
csv_path = str(tmp_path / "rec" / "live_test.csv") csv_path = str(tmp_path / "rec" / "live_test.csv")
controller.startRecording(csv_path, "SN123") controller.startRecording(csv_path, "SN123")