improved logging
This commit is contained in:
@@ -462,7 +462,12 @@ class PreprocessDialog(QDialog):
|
||||
)
|
||||
|
||||
def _ensure_preview_plots(self) -> bool:
|
||||
"""Create the amplitude+phase plot pair lazily on first successful capture."""
|
||||
"""Lazily create the amplitude+phase plot pair and report whether it exists.
|
||||
|
||||
Returns True once both plots are available. If construction fails (e.g. an
|
||||
incompatible PyQtGraph/PyQt6 build), marks the preview permanently
|
||||
unavailable so later captures fall back to the placeholder without retrying.
|
||||
"""
|
||||
if self._amplitude_plot is not None and self._phase_plot is not None:
|
||||
return True
|
||||
if self._preview_plot_unavailable:
|
||||
@@ -474,6 +479,8 @@ class PreprocessDialog(QDialog):
|
||||
amplitude_plot = self._build_preview_axis("Magnitude", "dB")
|
||||
phase_plot = self._build_preview_axis("Phase", "deg")
|
||||
except Exception:
|
||||
# Some PyQtGraph/PyQt6 combinations cannot build a PlotWidget here;
|
||||
# latch the failure so we show the text placeholder instead of retrying.
|
||||
self._preview_plot_unavailable = True
|
||||
return False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user