Rework radar system
This commit is contained in:
@@ -8,7 +8,8 @@ from typing import Protocol
|
||||
from python_app.hardware_full.kamil_adc import KamilAdcService
|
||||
from python_app.hardware_full.librevna_driver.models import SweepResult
|
||||
from python_app.hardware_full.librevna_service import LibreVnaService
|
||||
from python_app.models.run_config_model import RadarSweepModel, RunConfigModel
|
||||
from python_app.models.dataset_model import ComboKey
|
||||
from python_app.models.run_config_schema import RadarSweepModel, RunConfigModel
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -29,6 +30,9 @@ class SingleRadarService(Protocol):
|
||||
"""Read device capability limits."""
|
||||
...
|
||||
|
||||
def prepare_combo(self, combo: ComboKey) -> None:
|
||||
"""Select the simulated path or discard buffered data after switching."""
|
||||
|
||||
def acquire(self) -> SweepResult:
|
||||
"""Acquire one sweep."""
|
||||
...
|
||||
@@ -36,7 +40,7 @@ class SingleRadarService(Protocol):
|
||||
|
||||
def create_single_radar_service(config: RunConfigModel) -> SingleRadarService:
|
||||
"""Create the Python service for a non-matrix-radar config."""
|
||||
if config.is_matrix_radar:
|
||||
if config.is_multi_device:
|
||||
raise RuntimeError(
|
||||
"single-radar service factory does not support matrix radars; "
|
||||
"use create_matrix_radar_service instead"
|
||||
@@ -49,7 +53,7 @@ def create_single_radar_service(config: RunConfigModel) -> SingleRadarService:
|
||||
from python_app.hardware_full.point_target_mock_service import PointTargetMockService
|
||||
|
||||
return PointTargetMockService(config)
|
||||
return LibreVnaService(serial=config.radar.serial or None, backend_mode=config.radar.driver_mode)
|
||||
return LibreVnaService(serial=config.radar.serial or None)
|
||||
|
||||
if model == RunConfigModel.KAMIL_ADC_MODEL:
|
||||
if config.radar.driver_mode != "native":
|
||||
|
||||
Reference in New Issue
Block a user