fix x range

This commit is contained in:
awe
2026-06-08 18:36:14 +03:00
parent 6cc7a72087
commit ed89a66bf2

View File

@ -1024,6 +1024,8 @@ def run_pyqtgraph(args) -> None:
curve_sec_ch2 = None
curve_sec_amp = None
curve_sec_phase = None
_sec_xmin = float(SWEEP_FREQ_MIN_GHZ)
_sec_xmax = float(SWEEP_FREQ_MAX_GHZ)
if bin_iq_power_mode:
p_secondary_ch = win.addPlot(row=3, col=0, colspan=2, title="CH1 / CH2 (В)")
p_secondary_ch.showGrid(x=True, y=True, alpha=0.3)
@ -1033,12 +1035,9 @@ def run_pyqtgraph(args) -> None:
p_secondary_ch.setLabel("bottom", "ГГц")
p_secondary_ch.setLabel("left", "В")
p_secondary_ch.setMinimumHeight(120)
try:
p_secondary_ch.setXLink(p_line)
p_secondary_ch.setXRange(_sec_xmin, _sec_xmax, padding=0)
p_secondary_ch.enableAutoRange(axis="x", enable=False)
p_secondary_ch.setVisible(False)
except Exception:
pass
p_secondary_amp = win.addPlot(row=4, col=0, colspan=2, title="√(CH1² + CH2²) (В)")
p_secondary_amp.showGrid(x=True, y=True, alpha=0.3)
@ -1046,12 +1045,9 @@ def run_pyqtgraph(args) -> None:
p_secondary_amp.setLabel("bottom", "ГГц")
p_secondary_amp.setLabel("left", "В")
p_secondary_amp.setMinimumHeight(120)
try:
p_secondary_amp.setXLink(p_line)
p_secondary_amp.setXRange(_sec_xmin, _sec_xmax, padding=0)
p_secondary_amp.enableAutoRange(axis="x", enable=False)
p_secondary_amp.setVisible(False)
except Exception:
pass
p_secondary_phase = win.addPlot(row=5, col=0, colspan=2, title="Фаза atan2(CH2, CH1) (рад)")
p_secondary_phase.showGrid(x=True, y=True, alpha=0.3)
@ -1059,12 +1055,9 @@ def run_pyqtgraph(args) -> None:
p_secondary_phase.setLabel("bottom", "ГГц")
p_secondary_phase.setLabel("left", "рад")
p_secondary_phase.setMinimumHeight(120)
try:
p_secondary_phase.setXLink(p_line)
p_secondary_phase.setXRange(_sec_xmin, _sec_xmax, padding=0)
p_secondary_phase.enableAutoRange(axis="x", enable=False)
p_secondary_phase.setVisible(False)
except Exception:
pass
p_img = win.addPlot(row=0, col=1, title="Сырые данные водопад")
p_img.invertY(False)
@ -2261,6 +2254,12 @@ def run_pyqtgraph(args) -> None:
return
runtime.range_min_ghz = new_min
runtime.range_max_ghz = new_max
if p_secondary_ch is not None:
p_secondary_ch.setXRange(new_min, new_max, padding=0)
if p_secondary_amp is not None:
p_secondary_amp.setXRange(new_min, new_max, padding=0)
if p_secondary_phase is not None:
p_secondary_phase.setXRange(new_min, new_max, padding=0)
reset_background_state(clear_profile=True)
refresh_current_window(push_to_ring=True, reset_ring=True)
set_status_note(f"диапазон: {new_min:.6g}..{new_max:.6g} GHz")