Add object calibration

This commit is contained in:
Ayzen
2026-10-05 17:39:40 +03:00
parent 8f097dfa2e
commit 552cdc688a
33 changed files with 3141 additions and 517 deletions
@@ -41,6 +41,9 @@ class AppWindowSnapshotMixin:
def _save_snapshot(self) -> None:
"""Save up to 1000 recent runtime measurements as a numpy snapshot."""
if getattr(self, "_object_capture_job", None) is not None:
self._show_error("Wait for object-calibration capture to finish")
return
self._drain_runtime_rings_for_snapshot()
if getattr(self, "_closing", False):
return
@@ -100,7 +103,7 @@ class AppWindowSnapshotMixin:
)
config_profile_path = self._snapshot_config_profile_path(snapshot_dir)
try:
self._write_gui_profile_to_path(config_profile_path, allow_overwrite=False)
self._write_gui_profile_to_path(config_profile_path, allow_overwrite=False, dataset=True)
except Exception as exc: # noqa: BLE001
self._show_error(
"Snapshot data was saved, but the adjacent config profile could not be written",
@@ -130,6 +133,9 @@ class AppWindowSnapshotMixin:
def _save_vna_history_json(self) -> None:
"""Save one VNA-history JSON per available combo in runtime history."""
if getattr(self, "_object_capture_job", None) is not None:
self._show_error("Wait for object-calibration capture to finish")
return
self._drain_runtime_rings_for_snapshot()
if getattr(self, "_closing", False):
return
@@ -164,7 +170,7 @@ class AppWindowSnapshotMixin:
try:
# Snapshot and VNA JSON exports intentionally share the same output directory stem.
# Refresh the companion GUI profile in place so a prior dataset save does not block JSON export.
self._write_gui_profile_to_path(config_profile_path, allow_overwrite=True)
self._write_gui_profile_to_path(config_profile_path, allow_overwrite=True, dataset=True)
except Exception as exc: # noqa: BLE001
exported_preview = "\n".join(str(path) for path in output_paths[:8])
if len(output_paths) > 8:
@@ -212,6 +218,9 @@ class AppWindowSnapshotMixin:
def _apply_runtime_history_deletion(self, *, remove_last_only: bool) -> None:
"""Apply destructive runtime-history deletion across readers, caches, and processor replay state."""
if getattr(self, "_object_capture_job", None) is not None:
self._show_error("Wait for object-calibration capture to finish")
return
if self._capture_session is not None:
self._show_error(
"Cannot modify runtime history during active capture sequence",