added generator mode

This commit is contained in:
Ayzen
2026-04-01 13:00:01 +03:00
parent 43d1c226a1
commit 4abc95c372
16 changed files with 936 additions and 0 deletions
@@ -120,6 +120,23 @@ class VNASweepSettings:
raise ValueError("power sweep requires f_start_hz == f_stop_hz")
@dataclass(slots=True)
class GeneratorSettings:
"""Configuration for LibreVNA signal-generator mode."""
frequency_hz: float = 1_000_000.0
power_dbm: float = -10.0
active_port: int = 1
apply_amplitude_correction: bool = False
def __post_init__(self) -> None:
"""Validate generator settings before transmission."""
if self.frequency_hz <= 0:
raise ValueError("frequency_hz must be > 0")
if self.active_port not in {1, 2}:
raise ValueError("active_port must be 1 or 2")
@dataclass(slots=True)
class DeviceConfigVariant:
"""Family-specific device configuration fields."""