added generator mode
This commit is contained in:
@@ -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."""
|
||||
|
||||
Reference in New Issue
Block a user