This commit is contained in:
Ayzen
2026-05-06 16:08:24 +03:00
parent cb4ba861d9
commit cf3f3cbd67
24 changed files with 670 additions and 247 deletions
@@ -11,6 +11,11 @@ from python_app.orchestration.live_processing_config import ProcessingLiveConfig
class AppWindowLiveProcessingMixin:
"""Handle live processing updates, redraws, and locator republishing."""
@staticmethod
def _is_gpr_processing_mode(mode: str) -> bool:
"""Return whether a mode uses GPR result payloads and plot surface."""
return mode in {"gpr", "legacy_gpr"}
def _validate_processing_mode_selection(self, mode: str) -> None:
"""Validate requested processing mode against current stable/live GUI state."""
validate_processing_mode_constraints(
@@ -23,10 +28,30 @@ class AppWindowLiveProcessingMixin:
"""Build live processing config from current processing widgets."""
self._sync_bscan_frequency_limits_with_radar()
self._sync_gpr_frequency_limits_with_radar()
mode = self._processing_mode.currentText()
if mode == "legacy_gpr":
gpr_input_positions_text = self._legacy_gpr_input_positions_input.text()
gpr_output_positions_text = self._legacy_gpr_output_positions_input.text()
gpr_min_depth_m = float(self._legacy_gpr_min_depth_m.value())
gpr_max_depth_m = float(self._legacy_gpr_max_depth_m.value())
gpr_start_freq_mhz = float(self._legacy_gpr_start_freq_mhz.value())
gpr_stop_freq_mhz = float(self._legacy_gpr_stop_freq_mhz.value())
gpr_background_enabled = bool(self._legacy_gpr_background_subtract_enabled.isChecked())
gpr_background_mean_count = int(self._legacy_gpr_background_mean_count.value())
else:
gpr_input_positions_text = self._gpr_input_positions_input.text()
gpr_output_positions_text = self._gpr_output_positions_input.text()
gpr_min_depth_m = float(self._gpr_min_depth_m.value())
gpr_max_depth_m = float(self._gpr_max_depth_m.value())
gpr_start_freq_mhz = float(self._gpr_start_freq_mhz.value())
gpr_stop_freq_mhz = float(self._gpr_stop_freq_mhz.value())
gpr_background_enabled = bool(self._gpr_background_subtract_enabled.isChecked())
gpr_background_mean_count = int(self._gpr_background_mean_count.value())
y_min_db = float(self._pass_through_y_min_db.value())
y_max_db = float(self._pass_through_y_max_db.value())
return ProcessingLiveConfig(
processor_mode=self._processing_mode.currentText(),
processor_mode=mode,
pass_through_channel="s21",
pass_through_fixed_y_enabled=bool(self._pass_through_fixed_y_enabled.isChecked()),
pass_through_y_min_db=min(y_min_db, y_max_db),
@@ -38,22 +63,22 @@ class AppWindowLiveProcessingMixin:
bscan_gain=float(self._bscan_gain.value()),
bscan_start_freq_mhz=float(self._bscan_start_freq_mhz.value()),
bscan_stop_freq_mhz=float(self._bscan_stop_freq_mhz.value()),
gpr_algorithm=self._gpr_algorithm.currentText(),
gpr_input_positions=self._parse_csv_int_list(self._gpr_input_positions_input.text()),
gpr_output_positions=self._parse_csv_int_list(self._gpr_output_positions_input.text()),
gpr_min_depth_m=float(self._gpr_min_depth_m.value()),
gpr_max_depth_m=float(self._gpr_max_depth_m.value()),
legacy_gpr_mode=self._legacy_gpr_config_mode.currentText(),
gpr_input_positions=self._parse_csv_int_list(gpr_input_positions_text),
gpr_output_positions=self._parse_csv_int_list(gpr_output_positions_text),
gpr_min_depth_m=gpr_min_depth_m,
gpr_max_depth_m=gpr_max_depth_m,
gpr_range_comp_power=float(self._gpr_range_comp_power.value()),
gpr_angle_comp_power=float(self._gpr_angle_comp_power.value()),
gpr_comp_power=float(self._gpr_comp_power.value()),
gpr_speed_m_s=float(self._gpr_speed_m_s.value()),
gpr_look_angle_deg=float(self._gpr_look_angle_deg.value()),
gpr_snr_thresh=float(self._gpr_snr_thresh.value()),
gpr_snr_comp_max=float(self._gpr_snr_comp_max.value()),
gpr_start_freq_mhz=float(self._gpr_start_freq_mhz.value()),
gpr_stop_freq_mhz=float(self._gpr_stop_freq_mhz.value()),
gpr_background_subtract_enabled=bool(self._gpr_background_subtract_enabled.isChecked()),
gpr_background_mean_count=int(self._gpr_background_mean_count.value()),
gpr_comp_power=float(self._legacy_gpr_comp_power.value()),
gpr_speed_m_s=float(self._legacy_gpr_speed_m_s.value()),
gpr_look_angle_deg=float(self._legacy_gpr_look_angle_deg.value()),
gpr_snr_thresh=float(self._legacy_gpr_snr_thresh.value()),
gpr_snr_comp_max=float(self._legacy_gpr_snr_comp_max.value()),
gpr_start_freq_mhz=gpr_start_freq_mhz,
gpr_stop_freq_mhz=gpr_stop_freq_mhz,
gpr_background_subtract_enabled=gpr_background_enabled,
gpr_background_mean_count=gpr_background_mean_count,
gpr_remove_sidelobe_objects_enabled=bool(self._gpr_remove_sidelobe_objects_enabled.isChecked()),
history_command_seq=int(self._history_command_seq),
history_command=str(history_command),
@@ -69,7 +94,7 @@ class AppWindowLiveProcessingMixin:
"""Handle live-processing setting changes and trigger redraw when needed."""
try:
current_mode = self._processing_mode.currentText()
if current_mode == "gpr":
if self._is_gpr_processing_mode(current_mode):
self._drain_results_until_quiet(timeout_s=0.05, poll_s=0.005)
self._write_live_processing_config()
@@ -77,7 +102,7 @@ class AppWindowLiveProcessingMixin:
self._drain_results_until_quiet(timeout_s=0.25, poll_s=0.01)
self._sync_bscan_history_from_results()
self._draw_bscan_heatmap_from_history()
elif current_mode == "gpr":
elif self._is_gpr_processing_mode(current_mode):
latest = self._drain_results_until_quiet(timeout_s=0.8, poll_s=0.02)
collection = latest
if collection is None and self._result_history:
@@ -96,7 +121,7 @@ class AppWindowLiveProcessingMixin:
def _on_gpr_visual_settings_changed(self, *_args) -> None:
"""Redraw current GPR result using updated GUI-only render settings."""
if self._processing_mode.currentText() != "gpr":
if not self._is_gpr_processing_mode(self._processing_mode.currentText()):
return
try:
if self._result_history and self._draw_results(self._result_history[-1]):
@@ -108,7 +133,7 @@ class AppWindowLiveProcessingMixin:
def _on_gpr_locator_threshold_changed(self, *_args) -> None:
"""Redraw GPR view and republish locator snapshot after threshold changes."""
self._on_gpr_visual_settings_changed()
if self._processing_mode.currentText() != "gpr":
if not self._is_gpr_processing_mode(self._processing_mode.currentText()):
return
try:
self._publish_locator_snapshot_from_latest_result()
@@ -118,7 +143,7 @@ class AppWindowLiveProcessingMixin:
def _on_gpr_locator_window_changed(self, *_args) -> None:
"""Redraw GPR view and republish locator snapshot after visible X/Z changes."""
self._on_gpr_visual_settings_changed()
if self._processing_mode.currentText() != "gpr":
if not self._is_gpr_processing_mode(self._processing_mode.currentText()):
return
try:
self._publish_locator_snapshot_from_latest_result()
@@ -131,8 +156,10 @@ class AppWindowLiveProcessingMixin:
"pass_through": 0,
"bscan": 1,
"gpr": 2,
"legacy_gpr": 3,
}
self._processing_mode_pages.setCurrentIndex(mode_to_page.get(mode, 0))
self._gpr_common_page.setVisible(self._is_gpr_processing_mode(mode))
current_page = self._processing_mode_pages.currentWidget()
if current_page is not None:
self._processing_mode_pages.setFixedHeight(current_page.sizeHint().height())
@@ -157,9 +184,9 @@ class AppWindowLiveProcessingMixin:
self._set_plot_mode(mode)
self._set_processing_mode_page(mode)
self._on_processing_live_settings_changed()
if mode == "gpr":
if self._is_gpr_processing_mode(mode):
self._publish_locator_snapshot_from_latest_result()
elif previous_mode == "gpr" and self._locator_service is not None:
elif self._is_gpr_processing_mode(previous_mode) and self._locator_service is not None:
self._locator_service.publish_empty()
if mode == "pass_through":
self._log(
@@ -182,21 +209,36 @@ class AppWindowLiveProcessingMixin:
elif mode == "gpr":
self._log(
"Processing mode selected: gpr "
f"(algorithm={self._gpr_algorithm.currentText()}, "
f"inputs={self._gpr_input_positions_input.text().strip() or '<all>'}, "
f"(inputs={self._gpr_input_positions_input.text().strip() or '<all>'}, "
f"outputs={self._gpr_output_positions_input.text().strip() or '<all>'}, "
f"depth={self._gpr_min_depth_m.value():g}..{self._gpr_max_depth_m.value():g} m, "
f"freq={self._gpr_start_freq_mhz.value():g}..{self._gpr_stop_freq_mhz.value():g} MHz, "
f"range_comp={self._gpr_range_comp_power.value():g}, "
f"angle_comp={self._gpr_angle_comp_power.value():g}, "
f"comp={self._gpr_comp_power.value():g}, "
f"snr={self._gpr_snr_thresh.value():g}, "
f"background_subtract={self._gpr_background_subtract_enabled.isChecked()}, "
f"mean_count={self._gpr_background_mean_count.value()}, "
f"remove_sidelobes={self._gpr_remove_sidelobe_objects_enabled.isChecked()}, "
f"render_mode={self._gpr_render_mode.currentText()}, "
f"min_score={self._gpr_min_visible_score.value():g})"
)
elif mode == "legacy_gpr":
self._log(
"Processing mode selected: legacy_gpr "
f"(mode={self._legacy_gpr_config_mode.currentText()}, "
f"inputs={self._legacy_gpr_input_positions_input.text().strip() or '<all>'}, "
f"outputs={self._legacy_gpr_output_positions_input.text().strip() or '<all>'}, "
f"depth={self._legacy_gpr_min_depth_m.value():g}..{self._legacy_gpr_max_depth_m.value():g} m, "
f"freq={self._legacy_gpr_start_freq_mhz.value():g}..{self._legacy_gpr_stop_freq_mhz.value():g} MHz, "
f"comp={self._legacy_gpr_comp_power.value():g}, "
f"snr={self._legacy_gpr_snr_thresh.value():g}, "
f"snr_comp_max={self._legacy_gpr_snr_comp_max.value():g}, "
f"speed={self._legacy_gpr_speed_m_s.value():g} m/s, "
f"look_angle={self._legacy_gpr_look_angle_deg.value():g} deg, "
f"background_subtract={self._legacy_gpr_background_subtract_enabled.isChecked()}, "
f"mean_count={self._legacy_gpr_background_mean_count.value()}, "
f"render_mode={self._legacy_gpr_render_mode.currentText()}, "
f"min_pairs={self._legacy_gpr_min_visible_pair_count.value()})"
)
def _clear_history_mode_caches(self) -> None:
"""Drop cached render state for pass-through, B-scan, and GPR views."""
@@ -218,7 +260,7 @@ class AppWindowLiveProcessingMixin:
self._bscan_plot.clear()
self._configure_bscan_plot_axes()
return
if self._processing_mode.currentText() == "gpr":
if self._is_gpr_processing_mode(self._processing_mode.currentText()):
if self._result_history and self._draw_results(self._result_history[-1]):
return
self._clear_gpr_plot()
@@ -70,25 +70,6 @@ class AppWindowConfigProfileIOMixin:
self._pass_through_y_min_db.setEnabled(enabled)
self._pass_through_y_max_db.setEnabled(enabled)
def _sync_gpr_algorithm_controls(self) -> None:
"""Enable only controls that affect the selected GPR algorithm."""
backprojection_enabled = self._gpr_algorithm.currentText() == "backprojection"
for widget in (
self._gpr_range_comp_power,
self._gpr_angle_comp_power,
self._gpr_remove_sidelobe_objects_enabled,
):
widget.setEnabled(backprojection_enabled)
for widget in (
self._gpr_comp_power,
self._gpr_speed_m_s,
self._gpr_look_angle_deg,
self._gpr_snr_thresh,
self._gpr_snr_comp_max,
):
widget.setEnabled(not backprojection_enabled)
def _apply_history_limit_from_config(self, config) -> None:
"""Resize in-memory history buffers to match the loaded config."""
history_limit = self._history_limit_for_config(config)
@@ -213,7 +194,6 @@ class AppWindowConfigProfileIOMixin:
self._bscan_start_freq_mhz,
self._bscan_stop_freq_mhz,
self._bscan_subtract_mean_ascan,
self._gpr_algorithm,
self._gpr_relative_permittivity,
self._gpr_tx_geometry_input,
self._gpr_rx_geometry_input,
@@ -223,11 +203,6 @@ class AppWindowConfigProfileIOMixin:
self._gpr_max_depth_m,
self._gpr_range_comp_power,
self._gpr_angle_comp_power,
self._gpr_comp_power,
self._gpr_speed_m_s,
self._gpr_look_angle_deg,
self._gpr_snr_thresh,
self._gpr_snr_comp_max,
self._gpr_start_freq_mhz,
self._gpr_stop_freq_mhz,
self._gpr_background_subtract_enabled,
@@ -239,6 +214,26 @@ class AppWindowConfigProfileIOMixin:
self._gpr_visible_x_max_m,
self._gpr_visible_z_min_m,
self._gpr_visible_z_max_m,
self._legacy_gpr_config_mode,
self._legacy_gpr_input_positions_input,
self._legacy_gpr_output_positions_input,
self._legacy_gpr_min_depth_m,
self._legacy_gpr_max_depth_m,
self._legacy_gpr_comp_power,
self._legacy_gpr_snr_thresh,
self._legacy_gpr_snr_comp_max,
self._legacy_gpr_start_freq_mhz,
self._legacy_gpr_stop_freq_mhz,
self._legacy_gpr_speed_m_s,
self._legacy_gpr_look_angle_deg,
self._legacy_gpr_background_subtract_enabled,
self._legacy_gpr_background_mean_count,
self._legacy_gpr_render_mode,
self._legacy_gpr_min_visible_pair_count,
self._legacy_gpr_visible_x_min_m,
self._legacy_gpr_visible_x_max_m,
self._legacy_gpr_visible_z_min_m,
self._legacy_gpr_visible_z_max_m,
self._save_count,
self._save_path_input,
self._save_name_input,
@@ -290,16 +285,10 @@ class AppWindowConfigProfileIOMixin:
)
self._gpr_input_positions_input.setText(str(gui_state.processing.gpr.input_positions))
self._gpr_output_positions_input.setText(str(gui_state.processing.gpr.output_positions))
self._set_combo_current_text(self._gpr_algorithm, gui_state.processing.gpr.algorithm)
self._gpr_min_depth_m.setValue(float(gui_state.processing.gpr.min_depth_m))
self._gpr_max_depth_m.setValue(float(gui_state.processing.gpr.max_depth_m))
self._gpr_range_comp_power.setValue(float(gui_state.processing.gpr.range_comp_power))
self._gpr_angle_comp_power.setValue(float(gui_state.processing.gpr.angle_comp_power))
self._gpr_comp_power.setValue(float(gui_state.processing.gpr.comp_power))
self._gpr_speed_m_s.setValue(float(gui_state.processing.gpr.speed_m_s))
self._gpr_look_angle_deg.setValue(float(gui_state.processing.gpr.look_angle_deg))
self._gpr_snr_thresh.setValue(float(gui_state.processing.gpr.snr_thresh))
self._gpr_snr_comp_max.setValue(float(gui_state.processing.gpr.snr_comp_max))
self._gpr_start_freq_mhz.setValue(float(gui_state.processing.gpr.start_freq_mhz))
self._gpr_stop_freq_mhz.setValue(float(gui_state.processing.gpr.stop_freq_mhz))
self._gpr_background_subtract_enabled.setChecked(
@@ -316,6 +305,29 @@ class AppWindowConfigProfileIOMixin:
self._gpr_visible_z_min_m.setValue(float(gui_state.processing.gpr.visible_z_min_m))
self._gpr_visible_z_max_m.setValue(float(gui_state.processing.gpr.visible_z_max_m))
self._set_combo_current_text(self._legacy_gpr_config_mode, gui_state.processing.legacy_gpr.mode)
self._legacy_gpr_input_positions_input.setText(str(gui_state.processing.legacy_gpr.input_positions))
self._legacy_gpr_output_positions_input.setText(str(gui_state.processing.legacy_gpr.output_positions))
self._legacy_gpr_min_depth_m.setValue(float(gui_state.processing.legacy_gpr.min_depth_m))
self._legacy_gpr_max_depth_m.setValue(float(gui_state.processing.legacy_gpr.max_depth_m))
self._legacy_gpr_comp_power.setValue(float(gui_state.processing.legacy_gpr.comp_power))
self._legacy_gpr_snr_thresh.setValue(float(gui_state.processing.legacy_gpr.snr_thresh))
self._legacy_gpr_snr_comp_max.setValue(float(gui_state.processing.legacy_gpr.snr_comp_max))
self._legacy_gpr_start_freq_mhz.setValue(float(gui_state.processing.legacy_gpr.start_freq_mhz))
self._legacy_gpr_stop_freq_mhz.setValue(float(gui_state.processing.legacy_gpr.stop_freq_mhz))
self._legacy_gpr_speed_m_s.setValue(float(gui_state.processing.legacy_gpr.speed_m_s))
self._legacy_gpr_look_angle_deg.setValue(float(gui_state.processing.legacy_gpr.look_angle_deg))
self._legacy_gpr_background_subtract_enabled.setChecked(
bool(gui_state.processing.legacy_gpr.background_subtract_enabled)
)
self._legacy_gpr_background_mean_count.setValue(int(gui_state.processing.legacy_gpr.background_mean_count))
self._set_combo_current_text(self._legacy_gpr_render_mode, gui_state.processing.legacy_gpr.render_mode)
self._legacy_gpr_min_visible_pair_count.setValue(int(gui_state.processing.legacy_gpr.min_visible_pair_count))
self._legacy_gpr_visible_x_min_m.setValue(float(gui_state.processing.legacy_gpr.visible_x_min_m))
self._legacy_gpr_visible_x_max_m.setValue(float(gui_state.processing.legacy_gpr.visible_x_max_m))
self._legacy_gpr_visible_z_min_m.setValue(float(gui_state.processing.legacy_gpr.visible_z_min_m))
self._legacy_gpr_visible_z_max_m.setValue(float(gui_state.processing.legacy_gpr.visible_z_max_m))
self._save_count.setValue(int(gui_state.data_actions.save_count))
self._save_path_input.setText(str(gui_state.data_actions.save_path))
self._save_name_input.setText(str(gui_state.data_actions.save_name))
@@ -330,7 +342,7 @@ class AppWindowConfigProfileIOMixin:
self._gpr_geometry_signature = None
self._gpr_selected_geometry = None
self._sync_pass_through_y_controls()
self._sync_gpr_algorithm_controls()
self._set_processing_mode_page(gui_state.processing.selected_mode)
self._refresh_preprocess_summary_labels()
if self._preprocess_dialog is not None:
@@ -175,6 +175,8 @@ class AppWindowRadarLimitsMixin:
"_bscan_stop_freq_mhz": "B-scan Stop MHz",
"_gpr_start_freq_mhz": "GPR Start MHz",
"_gpr_stop_freq_mhz": "GPR Stop MHz",
"_legacy_gpr_start_freq_mhz": "Legacy GPR Start MHz",
"_legacy_gpr_stop_freq_mhz": "Legacy GPR Stop MHz",
}
widgets = [getattr(self, widget_name) for widget_name in widget_names]
previous_values = {widget_name: getattr(self, widget_name).value() for widget_name in widget_names}
@@ -223,5 +225,7 @@ class AppWindowRadarLimitsMixin:
(
"_gpr_start_freq_mhz",
"_gpr_stop_freq_mhz",
"_legacy_gpr_start_freq_mhz",
"_legacy_gpr_stop_freq_mhz",
)
)
@@ -6,6 +6,7 @@ from python_app.models.gui_profile_model import (
GuiBscanStateModel,
GuiDataActionsStateModel,
GuiGprStateModel,
GuiLegacyGprStateModel,
GuiPassThroughStateModel,
GuiPreprocessDialogStateModel,
GuiProcessingStateModel,
@@ -183,6 +184,27 @@ class AppWindowConfigStateBuildersMixin:
visible_z_min_m=0.0,
visible_z_max_m=14.0,
),
legacy_gpr=GuiLegacyGprStateModel(
input_positions=self._default_gpr_input_positions_from_config(config),
output_positions=self._default_gpr_output_positions_from_config(config),
min_depth_m=2.0,
max_depth_m=14.0,
comp_power=0.2,
start_freq_mhz=3000.0,
stop_freq_mhz=6000.0,
speed_m_s=0.0,
look_angle_deg=0.0,
snr_thresh=4.5,
snr_comp_max=25.0,
background_subtract_enabled=True,
background_mean_count=10,
render_mode="heatmap",
min_visible_pair_count=1,
visible_x_min_m=default_gpr_x_min_m,
visible_x_max_m=default_gpr_x_max_m,
visible_z_min_m=0.0,
visible_z_max_m=14.0,
),
),
data_actions=GuiDataActionsStateModel(
save_count=10,
@@ -252,18 +274,12 @@ class AppWindowConfigStateBuildersMixin:
subtract_mean_ascan=bool(self._bscan_subtract_mean_ascan.isChecked()),
),
gpr=GuiGprStateModel(
algorithm=self._gpr_algorithm.currentText(),
input_positions=self._gpr_input_positions_input.text().strip(),
output_positions=self._gpr_output_positions_input.text().strip(),
min_depth_m=float(self._gpr_min_depth_m.value()),
max_depth_m=float(self._gpr_max_depth_m.value()),
range_comp_power=float(self._gpr_range_comp_power.value()),
angle_comp_power=float(self._gpr_angle_comp_power.value()),
comp_power=float(self._gpr_comp_power.value()),
speed_m_s=float(self._gpr_speed_m_s.value()),
look_angle_deg=float(self._gpr_look_angle_deg.value()),
snr_thresh=float(self._gpr_snr_thresh.value()),
snr_comp_max=float(self._gpr_snr_comp_max.value()),
start_freq_mhz=float(self._gpr_start_freq_mhz.value()),
stop_freq_mhz=float(self._gpr_stop_freq_mhz.value()),
background_subtract_enabled=bool(self._gpr_background_subtract_enabled.isChecked()),
@@ -276,6 +292,28 @@ class AppWindowConfigStateBuildersMixin:
visible_z_min_m=float(self._gpr_visible_z_min_m.value()),
visible_z_max_m=float(self._gpr_visible_z_max_m.value()),
),
legacy_gpr=GuiLegacyGprStateModel(
mode=self._legacy_gpr_config_mode.currentText(),
input_positions=self._legacy_gpr_input_positions_input.text().strip(),
output_positions=self._legacy_gpr_output_positions_input.text().strip(),
min_depth_m=float(self._legacy_gpr_min_depth_m.value()),
max_depth_m=float(self._legacy_gpr_max_depth_m.value()),
comp_power=float(self._legacy_gpr_comp_power.value()),
start_freq_mhz=float(self._legacy_gpr_start_freq_mhz.value()),
stop_freq_mhz=float(self._legacy_gpr_stop_freq_mhz.value()),
speed_m_s=float(self._legacy_gpr_speed_m_s.value()),
look_angle_deg=float(self._legacy_gpr_look_angle_deg.value()),
snr_thresh=float(self._legacy_gpr_snr_thresh.value()),
snr_comp_max=float(self._legacy_gpr_snr_comp_max.value()),
background_subtract_enabled=bool(self._legacy_gpr_background_subtract_enabled.isChecked()),
background_mean_count=int(self._legacy_gpr_background_mean_count.value()),
render_mode=self._legacy_gpr_render_mode.currentText(),
min_visible_pair_count=int(self._legacy_gpr_min_visible_pair_count.value()),
visible_x_min_m=float(self._legacy_gpr_visible_x_min_m.value()),
visible_x_max_m=float(self._legacy_gpr_visible_x_max_m.value()),
visible_z_min_m=float(self._legacy_gpr_visible_z_min_m.value()),
visible_z_max_m=float(self._legacy_gpr_visible_z_max_m.value()),
),
),
data_actions=GuiDataActionsStateModel(
save_count=int(self._save_count.value()),
@@ -325,7 +363,7 @@ class AppWindowConfigStateBuildersMixin:
combo_text = self._combos_text.text()
config.combos = parse_combos_from_text(combo_text)
config.ensure_combos()
if self._processing_mode.currentText() != "gpr" and self._switches_are_effectively_static(config):
if self._processing_mode.currentText() not in {"gpr", "legacy_gpr"} and self._switches_are_effectively_static(config):
config.combos = [ComboModel(input=0, output=0)]
for key in PREPROCESS_ASSET_KEYS:
@@ -363,7 +363,7 @@ class AppWindowPipelineMixin:
if record_result_history(self._result_history, collection):
latest = collection
if (
self._processing_mode.currentText() == "gpr"
self._is_gpr_processing_mode(self._processing_mode.currentText())
and collection_has_gpr_payloads(collection)
):
self._publish_locator_snapshot_from_collection(collection)
@@ -478,11 +478,13 @@ class AppWindowPipelineMixin:
speed_m_s = self._locator_service.drain_speed_updates()
if speed_m_s is None:
return
if self._processing_mode.currentText() != "legacy_gpr":
return
previous_speed_m_s = float(self._gpr_speed_m_s.value())
with QSignalBlocker(self._gpr_speed_m_s):
self._gpr_speed_m_s.setValue(float(speed_m_s))
current_speed_m_s = float(self._gpr_speed_m_s.value())
previous_speed_m_s = float(self._legacy_gpr_speed_m_s.value())
with QSignalBlocker(self._legacy_gpr_speed_m_s):
self._legacy_gpr_speed_m_s.setValue(float(speed_m_s))
current_speed_m_s = float(self._legacy_gpr_speed_m_s.value())
if current_speed_m_s == previous_speed_m_s:
return
@@ -494,7 +496,7 @@ class AppWindowPipelineMixin:
return
self._locator_service.publish_collection(
collection,
float(self._gpr_min_visible_score.value()),
self._gpr_locator_threshold(),
visible_bounds=self._gpr_visible_object_bounds(),
)
@@ -502,7 +504,7 @@ class AppWindowPipelineMixin:
"""Publish current locator-visible snapshot from latest cached GPR result."""
if self._locator_service is None:
return
if self._processing_mode.currentText() != "gpr":
if not self._is_gpr_processing_mode(self._processing_mode.currentText()):
self._locator_service.publish_empty()
return
@@ -17,6 +17,14 @@ from python_app.orchestration.gpr_locator import (
class AppWindowGprPlotMixin:
"""Renders GPR accumulator heatmaps and detected object overlays."""
def _gpr_plot_title(self, *, objects_only: bool = False) -> str:
"""Return title for the active GPR-like processing mode."""
if self._processing_mode.currentText() == "legacy_gpr":
title = f"Legacy GPR {self._legacy_gpr_config_mode.currentText()}"
else:
title = "GPR coherent BP"
return f"{title} Objects Only" if objects_only else title
def _clear_gpr_plot(self) -> None:
"""Clear latest GPR plot surface."""
if not hasattr(self, "_gpr_plot"):
@@ -39,7 +47,7 @@ class AppWindowGprPlotMixin:
if self._gpr_region_centers_item is not None:
self._gpr_region_centers_item.setData(x=[], y=[])
self._gpr_region_centers_item.hide()
self._gpr_plot.setTitle("GPR coherent BP")
self._gpr_plot.setTitle(self._gpr_plot_title())
def _configure_gpr_plot_axes(self) -> None:
"""Apply persistent GPR plot axis labels and base view settings."""
@@ -162,8 +170,14 @@ class AppWindowGprPlotMixin:
def _selected_gpr_geometry(self) -> tuple[np.ndarray, np.ndarray]:
"""Resolve selected Tx/Rx geometry arrays for current GPR selection."""
requested_inputs = tuple(self._parse_csv_int_list(self._gpr_input_positions_input.text()))
requested_outputs = tuple(self._parse_csv_int_list(self._gpr_output_positions_input.text()))
if self._processing_mode.currentText() == "legacy_gpr":
input_positions_text = self._legacy_gpr_input_positions_input.text()
output_positions_text = self._legacy_gpr_output_positions_input.text()
else:
input_positions_text = self._gpr_input_positions_input.text()
output_positions_text = self._gpr_output_positions_input.text()
requested_inputs = tuple(self._parse_csv_int_list(input_positions_text))
requested_outputs = tuple(self._parse_csv_int_list(output_positions_text))
signature = (
self._gpr_tx_geometry_input.toPlainText(),
self._gpr_rx_geometry_input.toPlainText(),
@@ -193,7 +207,7 @@ class AppWindowGprPlotMixin:
def _draw_gpr_map(self, collection: ResultCollection) -> bool:
"""Draw latest collection-level GPR plot according to current render mode."""
if self._gpr_render_mode.currentText() == "objects_only":
if self._gpr_render_mode_text() == "objects_only":
return self._draw_gpr_objects_only(collection)
return self._draw_gpr_heatmap(collection)
@@ -251,7 +265,8 @@ class AppWindowGprPlotMixin:
)
self._gpr_points_item.show()
for x_value, y_value, score in points:
label = pg.TextItem(text=f"{float(score):.2f}", color="#ffffff", anchor=(0.0, 1.0))
label_text = f"{float(score):.0f}" if self._processing_mode.currentText() == "legacy_gpr" else f"{float(score):.2f}"
label = pg.TextItem(text=label_text, color="#ffffff", anchor=(0.0, 1.0))
label.setZValue(40)
label.setPos(float(x_value), float(y_value))
plot.addItem(label)
@@ -297,7 +312,7 @@ class AppWindowGprPlotMixin:
self._gpr_region_mask_items.append(mask_image)
self._gpr_region_contours.append(contour)
plot.setTitle("GPR coherent BP")
plot.setTitle(self._gpr_plot_title())
finally:
plot.setUpdatesEnabled(True)
return True
@@ -315,14 +330,24 @@ class AppWindowGprPlotMixin:
def _gpr_visible_bounds(self) -> tuple[float, float, float, float]:
"""Return normalized GPR visible X/Z bounds from GUI controls."""
if self._processing_mode.currentText() == "legacy_gpr":
x_min_widget = self._legacy_gpr_visible_x_min_m
x_max_widget = self._legacy_gpr_visible_x_max_m
z_min_widget = self._legacy_gpr_visible_z_min_m
z_max_widget = self._legacy_gpr_visible_z_max_m
else:
x_min_widget = self._gpr_visible_x_min_m
x_max_widget = self._gpr_visible_x_max_m
z_min_widget = self._gpr_visible_z_min_m
z_max_widget = self._gpr_visible_z_max_m
x_min, x_max = self._normalized_display_range(
float(self._gpr_visible_x_min_m.value()),
float(self._gpr_visible_x_max_m.value()),
float(x_min_widget.value()),
float(x_max_widget.value()),
minimum_span=0.1,
)
z_min, z_max = self._normalized_display_range(
float(self._gpr_visible_z_min_m.value()),
float(self._gpr_visible_z_max_m.value()),
float(z_min_widget.value()),
float(z_max_widget.value()),
minimum_span=0.1,
)
return x_min, x_max, z_min, z_max
@@ -331,6 +356,18 @@ class AppWindowGprPlotMixin:
"""Return normalized object/locator visible X/Z bounds from GUI controls."""
return self._gpr_visible_bounds()
def _gpr_render_mode_text(self) -> str:
"""Return render mode for the active GPR-like processing mode."""
if self._processing_mode.currentText() == "legacy_gpr":
return self._legacy_gpr_render_mode.currentText()
return self._gpr_render_mode.currentText()
def _gpr_locator_threshold(self) -> float:
"""Return object threshold using the active GPR mode's score semantics."""
if self._processing_mode.currentText() == "legacy_gpr":
return float(self._legacy_gpr_min_visible_pair_count.value())
return float(self._gpr_min_visible_score.value())
@staticmethod
def _gpr_display_y_min(z_min: float, z_max: float) -> float:
"""Return lower display bound, preserving surface markers only when surface is visible."""
@@ -372,9 +409,10 @@ class AppWindowGprPlotMixin:
self._gpr_rx_item.setData(x=[], y=[])
self._gpr_rx_item.hide()
@staticmethod
def _format_gpr_object_label(x_m: float, z_m: float, score: float) -> str:
def _format_gpr_object_label(self, x_m: float, z_m: float, score: float) -> str:
"""Format object-only annotation text with normalized BP score and coordinates."""
if self._processing_mode.currentText() == "legacy_gpr":
return f"{int(round(score))} | x={x_m:.1f} | z={z_m:.1f}"
return f"{score:.2f} | x={x_m:.1f} | z={z_m:.1f}"
@staticmethod
@@ -451,7 +489,7 @@ class AppWindowGprPlotMixin:
return rows
x_min, x_max, z_min, z_max = self._gpr_visible_object_bounds()
min_score = float(self._gpr_min_visible_score.value())
min_score = self._gpr_locator_threshold()
finite_mask = np.all(np.isfinite(rows[:, :3]), axis=1)
visible_mask = (
finite_mask
@@ -527,7 +565,7 @@ class AppWindowGprPlotMixin:
plot.setXRange(x_min, x_max, padding=0.0)
plot.setYRange(self._gpr_display_y_min(z_min, z_max), z_max, padding=0.0)
plot.setTitle("GPR coherent BP Objects Only")
plot.setTitle(self._gpr_plot_title(objects_only=True))
finally:
plot.setUpdatesEnabled(True)
return True
@@ -37,7 +37,7 @@ class AppWindowTracePlotMixin:
def _on_trace_visibility_changed(self, *_args) -> None:
"""Redraw pass-through traces when magnitude/phase toggles changed."""
if self._processing_mode.currentText() in {"bscan", "gpr"}:
if self._processing_mode.currentText() in {"bscan", "gpr", "legacy_gpr"}:
return
if self._result_history:
self._draw_results(self._result_history[-1])
@@ -31,7 +31,7 @@ class AppWindowPlotMixin(
"""Draw collection based on currently selected processing mode."""
if self._processing_mode.currentText() == "bscan":
return self._draw_bscan_heatmap(collection)
if self._processing_mode.currentText() == "gpr":
if self._processing_mode.currentText() in {"gpr", "legacy_gpr"}:
return self._draw_gpr_map(collection)
return self._draw_trace_lines(collection)
@@ -265,13 +265,13 @@ class AppWindowUiMixin:
"""Switch visible plot page according to processing mode.
`bscan` -> show `self._bscan_plot`
`gpr` -> show `self._gpr_plot`
`gpr` and `legacy_gpr` -> show `self._gpr_plot`
otherwise -> show `self._trace_plots_container`
"""
if mode == "bscan":
self._plot_stack.setCurrentWidget(self._bscan_plot)
return
if mode == "gpr":
if mode in {"gpr", "legacy_gpr"}:
self._plot_stack.setCurrentWidget(self._gpr_plot)
return
self._plot_stack.setCurrentWidget(self._trace_plots_container)
@@ -56,9 +56,10 @@ def build_processing_group(owner) -> QGroupBox:
pass_defaults = processing_defaults.pass_through
bscan_defaults = processing_defaults.bscan
gpr_live_defaults = processing_defaults.gpr
legacy_gpr_defaults = processing_defaults.legacy_gpr
owner._processing_mode = QComboBox()
owner._processing_mode.addItems(["pass_through", "bscan", "gpr"])
owner._processing_mode.addItems(["pass_through", "bscan", "gpr", "legacy_gpr"])
owner._set_combo_current_text(owner._processing_mode, processing_defaults.selected_mode)
owner._processing_mode_pages = QStackedWidget(group)
@@ -154,10 +155,6 @@ def build_processing_group(owner) -> QGroupBox:
gpr_defaults = owner._defaults_config.gpr
owner._gpr_algorithm = QComboBox()
owner._gpr_algorithm.addItems(["backprojection", "legacy_point", "legacy_extended"])
owner._set_combo_current_text(owner._gpr_algorithm, gpr_live_defaults.algorithm)
owner._gpr_relative_permittivity = QDoubleSpinBox()
owner._gpr_relative_permittivity.setDecimals(4)
owner._gpr_relative_permittivity.setRange(0.0001, 1000.0)
@@ -172,6 +169,16 @@ def build_processing_group(owner) -> QGroupBox:
owner._gpr_rx_geometry_input.setPlaceholderText("input_pos x_m")
owner._gpr_rx_geometry_input.setFixedHeight(78)
owner._gpr_common_page = _build_processing_mode_page(
group,
[
("Relative permittivity", owner._gpr_relative_permittivity),
("Tx geometry", owner._gpr_tx_geometry_input),
("Rx geometry", owner._gpr_rx_geometry_input),
],
split_index=1,
)
owner._gpr_input_positions_input = QLineEdit(str(gpr_live_defaults.input_positions))
owner._gpr_input_positions_input.setPlaceholderText("0,1,2")
@@ -202,36 +209,6 @@ def build_processing_group(owner) -> QGroupBox:
owner._gpr_angle_comp_power.setSingleStep(0.01)
owner._gpr_angle_comp_power.setValue(float(gpr_live_defaults.angle_comp_power))
owner._gpr_comp_power = QDoubleSpinBox()
owner._gpr_comp_power.setDecimals(3)
owner._gpr_comp_power.setRange(0.0, 5.0)
owner._gpr_comp_power.setSingleStep(0.05)
owner._gpr_comp_power.setValue(float(gpr_live_defaults.comp_power))
owner._gpr_speed_m_s = QDoubleSpinBox()
owner._gpr_speed_m_s.setDecimals(3)
owner._gpr_speed_m_s.setRange(-100.0, 100.0)
owner._gpr_speed_m_s.setSingleStep(0.01)
owner._gpr_speed_m_s.setValue(float(gpr_live_defaults.speed_m_s))
owner._gpr_look_angle_deg = QDoubleSpinBox()
owner._gpr_look_angle_deg.setDecimals(2)
owner._gpr_look_angle_deg.setRange(-90.0, 90.0)
owner._gpr_look_angle_deg.setSingleStep(0.1)
owner._gpr_look_angle_deg.setValue(float(gpr_live_defaults.look_angle_deg))
owner._gpr_snr_thresh = QDoubleSpinBox()
owner._gpr_snr_thresh.setDecimals(2)
owner._gpr_snr_thresh.setRange(0.0, 1_000.0)
owner._gpr_snr_thresh.setSingleStep(0.1)
owner._gpr_snr_thresh.setValue(float(gpr_live_defaults.snr_thresh))
owner._gpr_snr_comp_max = QDoubleSpinBox()
owner._gpr_snr_comp_max.setDecimals(2)
owner._gpr_snr_comp_max.setRange(0.0, 1_000.0)
owner._gpr_snr_comp_max.setSingleStep(0.5)
owner._gpr_snr_comp_max.setValue(float(gpr_live_defaults.snr_comp_max))
owner._gpr_start_freq_mhz = QDoubleSpinBox()
owner._gpr_start_freq_mhz.setDecimals(1)
owner._gpr_start_freq_mhz.setRange(100.0, 8800.0)
@@ -254,8 +231,6 @@ def build_processing_group(owner) -> QGroupBox:
owner._gpr_remove_sidelobe_objects_enabled = QCheckBox("Remove sidelobe objects")
owner._gpr_remove_sidelobe_objects_enabled.setChecked(bool(gpr_live_defaults.remove_sidelobe_objects_enabled))
owner._sync_gpr_algorithm_controls()
owner._gpr_render_mode = QComboBox()
owner._gpr_render_mode.addItems(["heatmap", "objects_only"])
owner._set_combo_current_text(owner._gpr_render_mode, gpr_live_defaults.render_mode)
@@ -293,25 +268,16 @@ def build_processing_group(owner) -> QGroupBox:
gpr_page = _build_processing_mode_page(
owner._processing_mode_pages,
[
("Algorithm", owner._gpr_algorithm),
("Relative permittivity", owner._gpr_relative_permittivity),
("Input positions", owner._gpr_input_positions_input),
("Output positions", owner._gpr_output_positions_input),
("Min depth m", owner._gpr_min_depth_m),
("Max depth m", owner._gpr_max_depth_m),
("Range comp power", owner._gpr_range_comp_power),
("Angle comp power", owner._gpr_angle_comp_power),
("Comp power", owner._gpr_comp_power),
("SNR thresh", owner._gpr_snr_thresh),
("SNR comp max", owner._gpr_snr_comp_max),
("Render mode", owner._gpr_render_mode),
("Min visible score", owner._gpr_min_visible_score),
("Tx geometry", owner._gpr_tx_geometry_input),
("Rx geometry", owner._gpr_rx_geometry_input),
("Start MHz", owner._gpr_start_freq_mhz),
("Stop MHz", owner._gpr_stop_freq_mhz),
("Speed m/s", owner._gpr_speed_m_s),
("Look angle deg", owner._gpr_look_angle_deg),
("Visible X min m", owner._gpr_visible_x_min_m),
("Visible X max m", owner._gpr_visible_x_max_m),
("Visible Z min m", owner._gpr_visible_z_min_m),
@@ -320,10 +286,141 @@ def build_processing_group(owner) -> QGroupBox:
("Mean count", owner._gpr_background_mean_count),
owner._gpr_remove_sidelobe_objects_enabled,
],
split_index=12,
split_index=8,
)
owner._processing_mode_pages.addWidget(gpr_page)
owner._legacy_gpr_config_mode = QComboBox()
owner._legacy_gpr_config_mode.addItems(["point", "extended"])
owner._set_combo_current_text(owner._legacy_gpr_config_mode, legacy_gpr_defaults.mode)
owner._legacy_gpr_input_positions_input = QLineEdit(str(legacy_gpr_defaults.input_positions))
owner._legacy_gpr_input_positions_input.setPlaceholderText("0,1,2")
owner._legacy_gpr_output_positions_input = QLineEdit(str(legacy_gpr_defaults.output_positions))
owner._legacy_gpr_output_positions_input.setPlaceholderText("0,1")
owner._legacy_gpr_min_depth_m = QDoubleSpinBox()
owner._legacy_gpr_min_depth_m.setDecimals(2)
owner._legacy_gpr_min_depth_m.setRange(0.0, 50.0)
owner._legacy_gpr_min_depth_m.setSingleStep(0.1)
owner._legacy_gpr_min_depth_m.setValue(float(legacy_gpr_defaults.min_depth_m))
owner._legacy_gpr_max_depth_m = QDoubleSpinBox()
owner._legacy_gpr_max_depth_m.setDecimals(2)
owner._legacy_gpr_max_depth_m.setRange(0.1, 50.0)
owner._legacy_gpr_max_depth_m.setSingleStep(0.1)
owner._legacy_gpr_max_depth_m.setValue(float(legacy_gpr_defaults.max_depth_m))
owner._legacy_gpr_comp_power = QDoubleSpinBox()
owner._legacy_gpr_comp_power.setDecimals(3)
owner._legacy_gpr_comp_power.setRange(0.0, 5.0)
owner._legacy_gpr_comp_power.setSingleStep(0.05)
owner._legacy_gpr_comp_power.setValue(float(legacy_gpr_defaults.comp_power))
owner._legacy_gpr_snr_thresh = QDoubleSpinBox()
owner._legacy_gpr_snr_thresh.setDecimals(2)
owner._legacy_gpr_snr_thresh.setRange(0.0, 1_000.0)
owner._legacy_gpr_snr_thresh.setSingleStep(0.1)
owner._legacy_gpr_snr_thresh.setValue(float(legacy_gpr_defaults.snr_thresh))
owner._legacy_gpr_snr_comp_max = QDoubleSpinBox()
owner._legacy_gpr_snr_comp_max.setDecimals(2)
owner._legacy_gpr_snr_comp_max.setRange(0.0, 1_000.0)
owner._legacy_gpr_snr_comp_max.setSingleStep(0.5)
owner._legacy_gpr_snr_comp_max.setValue(float(legacy_gpr_defaults.snr_comp_max))
owner._legacy_gpr_start_freq_mhz = QDoubleSpinBox()
owner._legacy_gpr_start_freq_mhz.setDecimals(1)
owner._legacy_gpr_start_freq_mhz.setRange(100.0, 8800.0)
owner._legacy_gpr_start_freq_mhz.setSingleStep(10.0)
owner._legacy_gpr_start_freq_mhz.setValue(float(legacy_gpr_defaults.start_freq_mhz))
owner._legacy_gpr_stop_freq_mhz = QDoubleSpinBox()
owner._legacy_gpr_stop_freq_mhz.setDecimals(1)
owner._legacy_gpr_stop_freq_mhz.setRange(100.0, 8800.0)
owner._legacy_gpr_stop_freq_mhz.setSingleStep(10.0)
owner._legacy_gpr_stop_freq_mhz.setValue(float(legacy_gpr_defaults.stop_freq_mhz))
owner._legacy_gpr_speed_m_s = QDoubleSpinBox()
owner._legacy_gpr_speed_m_s.setDecimals(3)
owner._legacy_gpr_speed_m_s.setRange(-100.0, 100.0)
owner._legacy_gpr_speed_m_s.setSingleStep(0.01)
owner._legacy_gpr_speed_m_s.setValue(float(legacy_gpr_defaults.speed_m_s))
owner._legacy_gpr_look_angle_deg = QDoubleSpinBox()
owner._legacy_gpr_look_angle_deg.setDecimals(2)
owner._legacy_gpr_look_angle_deg.setRange(-90.0, 90.0)
owner._legacy_gpr_look_angle_deg.setSingleStep(0.1)
owner._legacy_gpr_look_angle_deg.setValue(float(legacy_gpr_defaults.look_angle_deg))
owner._legacy_gpr_background_subtract_enabled = QCheckBox("Subtract mean of previous collections")
owner._legacy_gpr_background_subtract_enabled.setChecked(bool(legacy_gpr_defaults.background_subtract_enabled))
owner._legacy_gpr_background_mean_count = QSpinBox()
owner._legacy_gpr_background_mean_count.setRange(0, 10_000)
owner._legacy_gpr_background_mean_count.setValue(int(legacy_gpr_defaults.background_mean_count))
owner._legacy_gpr_render_mode = QComboBox()
owner._legacy_gpr_render_mode.addItems(["heatmap", "objects_only"])
owner._set_combo_current_text(owner._legacy_gpr_render_mode, legacy_gpr_defaults.render_mode)
owner._legacy_gpr_min_visible_pair_count = QSpinBox()
owner._legacy_gpr_min_visible_pair_count.setRange(1, 10_000)
owner._legacy_gpr_min_visible_pair_count.setValue(int(legacy_gpr_defaults.min_visible_pair_count))
owner._legacy_gpr_visible_x_min_m = QDoubleSpinBox()
owner._legacy_gpr_visible_x_min_m.setDecimals(2)
owner._legacy_gpr_visible_x_min_m.setRange(-100.0, 100.0)
owner._legacy_gpr_visible_x_min_m.setSingleStep(0.1)
owner._legacy_gpr_visible_x_min_m.setValue(float(legacy_gpr_defaults.visible_x_min_m))
owner._legacy_gpr_visible_x_max_m = QDoubleSpinBox()
owner._legacy_gpr_visible_x_max_m.setDecimals(2)
owner._legacy_gpr_visible_x_max_m.setRange(-100.0, 100.0)
owner._legacy_gpr_visible_x_max_m.setSingleStep(0.1)
owner._legacy_gpr_visible_x_max_m.setValue(float(legacy_gpr_defaults.visible_x_max_m))
owner._legacy_gpr_visible_z_min_m = QDoubleSpinBox()
owner._legacy_gpr_visible_z_min_m.setDecimals(2)
owner._legacy_gpr_visible_z_min_m.setRange(0.0, 100.0)
owner._legacy_gpr_visible_z_min_m.setSingleStep(0.1)
owner._legacy_gpr_visible_z_min_m.setValue(float(legacy_gpr_defaults.visible_z_min_m))
owner._legacy_gpr_visible_z_max_m = QDoubleSpinBox()
owner._legacy_gpr_visible_z_max_m.setDecimals(2)
owner._legacy_gpr_visible_z_max_m.setRange(0.0, 100.0)
owner._legacy_gpr_visible_z_max_m.setSingleStep(0.1)
owner._legacy_gpr_visible_z_max_m.setValue(float(legacy_gpr_defaults.visible_z_max_m))
legacy_gpr_page = _build_processing_mode_page(
owner._processing_mode_pages,
[
("Config mode", owner._legacy_gpr_config_mode),
("Input positions", owner._legacy_gpr_input_positions_input),
("Output positions", owner._legacy_gpr_output_positions_input),
("Min depth m", owner._legacy_gpr_min_depth_m),
("Max depth m", owner._legacy_gpr_max_depth_m),
("Comp power", owner._legacy_gpr_comp_power),
("SNR thresh", owner._legacy_gpr_snr_thresh),
("SNR comp max", owner._legacy_gpr_snr_comp_max),
("Speed m/s", owner._legacy_gpr_speed_m_s),
("Render mode", owner._legacy_gpr_render_mode),
("Min visible pairs", owner._legacy_gpr_min_visible_pair_count),
("Start MHz", owner._legacy_gpr_start_freq_mhz),
("Stop MHz", owner._legacy_gpr_stop_freq_mhz),
("Look angle deg", owner._legacy_gpr_look_angle_deg),
("Visible X min m", owner._legacy_gpr_visible_x_min_m),
("Visible X max m", owner._legacy_gpr_visible_x_max_m),
("Visible Z min m", owner._legacy_gpr_visible_z_min_m),
("Visible Z max m", owner._legacy_gpr_visible_z_max_m),
owner._legacy_gpr_background_subtract_enabled,
("Mean count", owner._legacy_gpr_background_mean_count),
],
split_index=10,
)
owner._processing_mode_pages.addWidget(legacy_gpr_page)
owner._processing_mode.currentTextChanged.connect(owner._on_processing_mode_changed)
owner._show_magnitude_checkbox.toggled.connect(owner._on_trace_visibility_changed)
owner._show_phase_checkbox.toggled.connect(owner._on_trace_visibility_changed)
@@ -333,6 +430,7 @@ def build_processing_group(owner) -> QGroupBox:
owner._pass_through_y_max_db.valueChanged.connect(owner._on_processing_live_settings_changed)
form.addRow("Mode", owner._processing_mode)
form.addRow(owner._processing_mode_pages)
form.addRow(owner._gpr_common_page)
owner._bscan_axis.currentTextChanged.connect(owner._on_processing_live_settings_changed)
owner._bscan_cut_m.valueChanged.connect(owner._on_processing_live_settings_changed)
@@ -341,19 +439,12 @@ def build_processing_group(owner) -> QGroupBox:
owner._bscan_start_freq_mhz.valueChanged.connect(owner._on_processing_live_settings_changed)
owner._bscan_stop_freq_mhz.valueChanged.connect(owner._on_processing_live_settings_changed)
owner._bscan_subtract_mean_ascan.toggled.connect(owner._on_processing_live_settings_changed)
owner._gpr_algorithm.currentTextChanged.connect(owner._sync_gpr_algorithm_controls)
owner._gpr_algorithm.currentTextChanged.connect(owner._on_processing_live_settings_changed)
owner._gpr_input_positions_input.editingFinished.connect(owner._on_processing_live_settings_changed)
owner._gpr_output_positions_input.editingFinished.connect(owner._on_processing_live_settings_changed)
owner._gpr_min_depth_m.valueChanged.connect(owner._on_processing_live_settings_changed)
owner._gpr_max_depth_m.valueChanged.connect(owner._on_processing_live_settings_changed)
owner._gpr_range_comp_power.valueChanged.connect(owner._on_processing_live_settings_changed)
owner._gpr_angle_comp_power.valueChanged.connect(owner._on_processing_live_settings_changed)
owner._gpr_comp_power.valueChanged.connect(owner._on_processing_live_settings_changed)
owner._gpr_speed_m_s.valueChanged.connect(owner._on_processing_live_settings_changed)
owner._gpr_look_angle_deg.valueChanged.connect(owner._on_processing_live_settings_changed)
owner._gpr_snr_thresh.valueChanged.connect(owner._on_processing_live_settings_changed)
owner._gpr_snr_comp_max.valueChanged.connect(owner._on_processing_live_settings_changed)
owner._gpr_start_freq_mhz.valueChanged.connect(owner._on_processing_live_settings_changed)
owner._gpr_stop_freq_mhz.valueChanged.connect(owner._on_processing_live_settings_changed)
owner._gpr_background_subtract_enabled.toggled.connect(owner._on_processing_live_settings_changed)
@@ -365,6 +456,26 @@ def build_processing_group(owner) -> QGroupBox:
owner._gpr_visible_x_max_m.valueChanged.connect(owner._on_gpr_locator_window_changed)
owner._gpr_visible_z_min_m.valueChanged.connect(owner._on_gpr_locator_window_changed)
owner._gpr_visible_z_max_m.valueChanged.connect(owner._on_gpr_locator_window_changed)
owner._legacy_gpr_config_mode.currentTextChanged.connect(owner._on_processing_live_settings_changed)
owner._legacy_gpr_input_positions_input.editingFinished.connect(owner._on_processing_live_settings_changed)
owner._legacy_gpr_output_positions_input.editingFinished.connect(owner._on_processing_live_settings_changed)
owner._legacy_gpr_min_depth_m.valueChanged.connect(owner._on_processing_live_settings_changed)
owner._legacy_gpr_max_depth_m.valueChanged.connect(owner._on_processing_live_settings_changed)
owner._legacy_gpr_comp_power.valueChanged.connect(owner._on_processing_live_settings_changed)
owner._legacy_gpr_snr_thresh.valueChanged.connect(owner._on_processing_live_settings_changed)
owner._legacy_gpr_snr_comp_max.valueChanged.connect(owner._on_processing_live_settings_changed)
owner._legacy_gpr_start_freq_mhz.valueChanged.connect(owner._on_processing_live_settings_changed)
owner._legacy_gpr_stop_freq_mhz.valueChanged.connect(owner._on_processing_live_settings_changed)
owner._legacy_gpr_speed_m_s.valueChanged.connect(owner._on_processing_live_settings_changed)
owner._legacy_gpr_look_angle_deg.valueChanged.connect(owner._on_processing_live_settings_changed)
owner._legacy_gpr_background_subtract_enabled.toggled.connect(owner._on_processing_live_settings_changed)
owner._legacy_gpr_background_mean_count.valueChanged.connect(owner._on_processing_live_settings_changed)
owner._legacy_gpr_render_mode.currentTextChanged.connect(owner._on_gpr_visual_settings_changed)
owner._legacy_gpr_min_visible_pair_count.valueChanged.connect(owner._on_gpr_locator_threshold_changed)
owner._legacy_gpr_visible_x_min_m.valueChanged.connect(owner._on_gpr_locator_window_changed)
owner._legacy_gpr_visible_x_max_m.valueChanged.connect(owner._on_gpr_locator_window_changed)
owner._legacy_gpr_visible_z_min_m.valueChanged.connect(owner._on_gpr_locator_window_changed)
owner._legacy_gpr_visible_z_max_m.valueChanged.connect(owner._on_gpr_locator_window_changed)
owner._set_processing_mode_page(owner._processing_mode.currentText())
return group
+1 -1
View File
@@ -24,7 +24,7 @@ def validate_processing_mode_constraints(
)
return
if processing_mode != "gpr":
if processing_mode not in {"gpr", "legacy_gpr"}:
return
configured_combos = {(int(combo.input), int(combo.output)) for combo in config.combos}