ch1 / ch2 add to pic
This commit is contained in:
@ -1,7 +1,7 @@
|
|||||||
"""Shared constants for sweep parsing and visualization."""
|
"""Shared constants for sweep parsing and visualization."""
|
||||||
|
|
||||||
WF_WIDTH = 1000
|
WF_WIDTH = 1000
|
||||||
FFT_LEN = 1024
|
FFT_LEN = 2048
|
||||||
BACKGROUND_MEDIAN_SWEEPS = 64
|
BACKGROUND_MEDIAN_SWEEPS = 64
|
||||||
|
|
||||||
SWEEP_FREQ_MIN_GHZ = 3.3
|
SWEEP_FREQ_MIN_GHZ = 3.3
|
||||||
|
|||||||
@ -613,16 +613,57 @@ def run_pyqtgraph(args) -> None:
|
|||||||
p_line = win.addPlot(row=0, col=0, title="Сырые данные")
|
p_line = win.addPlot(row=0, col=0, title="Сырые данные")
|
||||||
p_line.showGrid(x=True, y=True, alpha=0.3)
|
p_line.showGrid(x=True, y=True, alpha=0.3)
|
||||||
curve = p_line.plot(pen=pg.mkPen((80, 120, 255), width=1))
|
curve = p_line.plot(pen=pg.mkPen((80, 120, 255), width=1))
|
||||||
curve_aux_1 = p_line.plot(pen=pg.mkPen((255, 170, 40), width=1))
|
p_line_aux_vb = None
|
||||||
curve_aux_2 = p_line.plot(pen=pg.mkPen((170, 70, 255), width=1))
|
if bin_iq_power_mode:
|
||||||
|
p_line_aux_vb = pg.ViewBox()
|
||||||
|
try:
|
||||||
|
p_line.showAxis("right")
|
||||||
|
p_line.getAxis("right").setLabel("CH1/CH2")
|
||||||
|
p_line.scene().addItem(p_line_aux_vb)
|
||||||
|
p_line.getAxis("right").linkToView(p_line_aux_vb)
|
||||||
|
p_line_aux_vb.setXLink(p_line)
|
||||||
|
except Exception:
|
||||||
|
p_line_aux_vb = None
|
||||||
|
curve_aux_1 = pg.PlotDataItem(pen=pg.mkPen((255, 170, 40), width=1))
|
||||||
|
curve_aux_2 = pg.PlotDataItem(pen=pg.mkPen((170, 70, 255), width=1))
|
||||||
|
if p_line_aux_vb is not None:
|
||||||
|
p_line_aux_vb.addItem(curve_aux_1)
|
||||||
|
p_line_aux_vb.addItem(curve_aux_2)
|
||||||
|
else:
|
||||||
|
p_line.addItem(curve_aux_1)
|
||||||
|
p_line.addItem(curve_aux_2)
|
||||||
|
else:
|
||||||
|
curve_aux_1 = p_line.plot(pen=pg.mkPen((255, 170, 40), width=1))
|
||||||
|
curve_aux_2 = p_line.plot(pen=pg.mkPen((170, 70, 255), width=1))
|
||||||
curve_calib = p_line.plot(pen=pg.mkPen((220, 60, 60), width=1))
|
curve_calib = p_line.plot(pen=pg.mkPen((220, 60, 60), width=1))
|
||||||
curve_norm = p_line.plot(pen=pg.mkPen((60, 180, 90), width=1))
|
curve_norm = p_line.plot(pen=pg.mkPen((60, 180, 90), width=1))
|
||||||
p_line.setLabel("bottom", "ГГц")
|
p_line.setLabel("bottom", "ГГц")
|
||||||
p_line.setLabel("left", "Y")
|
p_line.setLabel("left", "Y")
|
||||||
|
if bin_iq_power_mode:
|
||||||
|
try:
|
||||||
|
p_line.setLabel("left", "CH1^2 + CH2^2")
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
ch_text = pg.TextItem("", anchor=(1, 1))
|
ch_text = pg.TextItem("", anchor=(1, 1))
|
||||||
ch_text.setZValue(10)
|
ch_text.setZValue(10)
|
||||||
p_line.addItem(ch_text)
|
p_line.addItem(ch_text)
|
||||||
|
|
||||||
|
def sync_line_aux_view() -> None:
|
||||||
|
if p_line_aux_vb is None:
|
||||||
|
return
|
||||||
|
try:
|
||||||
|
p_line_aux_vb.setGeometry(p_line.vb.sceneBoundingRect())
|
||||||
|
p_line_aux_vb.linkedViewChanged(p_line.vb, p_line_aux_vb.XAxis)
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
|
if p_line_aux_vb is not None:
|
||||||
|
try:
|
||||||
|
p_line.vb.sigResized.connect(sync_line_aux_view)
|
||||||
|
sync_line_aux_view()
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
p_img = win.addPlot(row=0, col=1, title="Сырые данные водопад")
|
p_img = win.addPlot(row=0, col=1, title="Сырые данные водопад")
|
||||||
p_img.invertY(False)
|
p_img.invertY(False)
|
||||||
p_img.showGrid(x=False, y=False)
|
p_img.showGrid(x=False, y=False)
|
||||||
@ -1717,16 +1758,30 @@ def run_pyqtgraph(args) -> None:
|
|||||||
curve_norm.setData([], [])
|
curve_norm.setData([], [])
|
||||||
|
|
||||||
if fixed_ylim is None:
|
if fixed_ylim is None:
|
||||||
y_series = [
|
if bin_iq_power_mode:
|
||||||
runtime.current_sweep_raw,
|
y_series = [
|
||||||
displayed_aux[0] if displayed_aux is not None else None,
|
runtime.current_sweep_raw,
|
||||||
displayed_aux[1] if displayed_aux is not None else None,
|
displayed_calib,
|
||||||
displayed_calib,
|
(runtime.current_sweep_norm * norm_display_scale) if runtime.current_sweep_norm is not None else None,
|
||||||
(runtime.current_sweep_norm * norm_display_scale) if runtime.current_sweep_norm is not None else None,
|
]
|
||||||
]
|
else:
|
||||||
|
y_series = [
|
||||||
|
runtime.current_sweep_raw,
|
||||||
|
displayed_aux[0] if displayed_aux is not None else None,
|
||||||
|
displayed_aux[1] if displayed_aux is not None else None,
|
||||||
|
displayed_calib,
|
||||||
|
(runtime.current_sweep_norm * norm_display_scale) if runtime.current_sweep_norm is not None else None,
|
||||||
|
]
|
||||||
y_limits = compute_auto_ylim(*y_series)
|
y_limits = compute_auto_ylim(*y_series)
|
||||||
if y_limits is not None:
|
if y_limits is not None:
|
||||||
p_line.setYRange(y_limits[0], y_limits[1], padding=0)
|
p_line.setYRange(y_limits[0], y_limits[1], padding=0)
|
||||||
|
if p_line_aux_vb is not None:
|
||||||
|
aux_limits = compute_auto_ylim(
|
||||||
|
displayed_aux[0] if displayed_aux is not None else None,
|
||||||
|
displayed_aux[1] if displayed_aux is not None else None,
|
||||||
|
)
|
||||||
|
if aux_limits is not None:
|
||||||
|
p_line_aux_vb.setYRange(aux_limits[0], aux_limits[1], padding=0)
|
||||||
|
|
||||||
line_x_bounds = resolve_axis_bounds(xs)
|
line_x_bounds = resolve_axis_bounds(xs)
|
||||||
if line_x_bounds is not None:
|
if line_x_bounds is not None:
|
||||||
|
|||||||
Reference in New Issue
Block a user