bscan now does not process S21 mode

This commit is contained in:
Ayzen
2025-09-30 13:59:41 +03:00
parent 65f4f9795e
commit b31568900c
2 changed files with 15 additions and 1 deletions

View File

@ -354,11 +354,21 @@ class BaseProcessor:
latest["vna_config"],
)
def _process_data(self, sweep_data: Any, calibrated_data: Any, vna_config: dict[str, Any]) -> ProcessedResult:
def _process_data(self, sweep_data: Any, calibrated_data: Any, vna_config: dict[str, Any]) -> ProcessedResult | None:
"""
Internal: compute processed data, build a Plotly config, and wrap into `ProcessedResult`.
Returns None if processing resulted in an error (indicated by {"error": ...} dict).
"""
processed = self.process_sweep(sweep_data, calibrated_data, vna_config)
# Skip result creation if processing returned an error
if isinstance(processed, dict) and "error" in processed:
logger.debug("Processing returned error; skipping result",
processor_id=self.processor_id,
error=processed.get("error"))
return None
plotly_conf = self.generate_plotly_config(processed, vna_config)
ui_params = self.get_ui_parameters()

View File

@ -165,6 +165,10 @@ class BScanProcessor(BaseProcessor):
Or: {"error": "..."} on failure.
"""
try:
# Skip B-scan processing for S21 mode - only works with S11
if vna_config and vna_config.get("mode") == "s21":
return {"error": "B-scan only available in S11 mode"}
# Choose calibrated data when provided
data_to_process = calibrated_data or sweep_data