sn9000 support

This commit is contained in:
AYZEN
2026-05-20 16:20:34 +03:00
parent ae7ea9f1f9
commit 5b480f1b55
18 changed files with 854 additions and 66 deletions
+22 -4
View File
@@ -270,6 +270,7 @@ class RunConfigModel:
LIBREVNA_MULTI_MODEL = "librevna_multi"
COMPACT_M_K209_MODEL = "compact_m_k209"
KAMIL_ADC_MODEL = "kamil_adc"
SN9000_MODEL = "sn9000"
MULTI_DEVICE_INPUT_POSITIONS = 4
MULTI_DEVICE_OUTPUT_POSITIONS = 2
@@ -290,11 +291,26 @@ class RunConfigModel:
cls.MULTI_DEVICE_OUTPUT_POSITIONS,
)
@classmethod
def build_matrix_radar_virtual_combos(cls) -> list[ComboModel]:
"""Build the canonical 2x4 virtual combo matrix shared by matrix-mode radars."""
return cls.build_multi_device_virtual_combos()
@property
def is_multi_device(self) -> bool:
"""Return whether this config targets synchronized multi-device acquisition."""
return self.radar.model == self.LIBREVNA_MULTI_MODEL
@property
def is_sn9000(self) -> bool:
"""Return whether this config targets the SN9000 multi-port analyzer."""
return self.radar.model == self.SN9000_MODEL
@property
def is_matrix_radar(self) -> bool:
"""Return whether this config acquires the full virtual switch matrix per sweep."""
return self.is_multi_device or self.is_sn9000
@property
def is_kamil_adc(self) -> bool:
"""Return whether this config targets the external Kamil ADC acquisition path."""
@@ -348,10 +364,13 @@ class RunConfigModel:
def apply_device_model_constraints(self) -> None:
"""Apply only required wire-format constraints for the selected device model."""
if not self.is_multi_device:
if not self.is_matrix_radar:
return
self._apply_matrix_virtual_switches()
self.combos = self.build_matrix_radar_virtual_combos()
self.radar.model = self.LIBREVNA_MULTI_MODEL
def _apply_matrix_virtual_switches(self) -> None:
"""Pin the canonical 2x4 virtual switch matrix used by all matrix-mode radars."""
self.output_switch.name = self.output_switch.name or "virtual_output"
self.output_switch.driver_mode = "mock"
self.output_switch.driver = self.output_switch.driver or "h7992"
@@ -365,11 +384,10 @@ class RunConfigModel:
self.input_switch.radar_port = 2
self.input_switch.positions = self.MULTI_DEVICE_INPUT_POSITIONS
self.input_switch.default_position = 0
self.combos = self.build_multi_device_virtual_combos()
def ensure_combos(self) -> None:
"""Populate combos with full matrix when no explicit run combos are set."""
if self.is_multi_device:
if self.is_matrix_radar:
self.apply_device_model_constraints()
return
if self.combos: