Polish GUI design
This commit is contained in:
@@ -3,9 +3,11 @@
|
||||
import numpy as np
|
||||
import pyqtgraph as pg
|
||||
|
||||
from python_app.gui.theme import PLOT_BACKGROUND
|
||||
|
||||
|
||||
def create_plot(title: str = "") -> pg.PlotWidget:
|
||||
plot = pg.PlotWidget(background="#0f141c", enableMenu=False, title=title)
|
||||
plot = pg.PlotWidget(background=PLOT_BACKGROUND, enableMenu=False, title=title)
|
||||
plot.showGrid(x=True, y=True, alpha=0.2)
|
||||
return plot
|
||||
|
||||
@@ -20,4 +22,3 @@ def build_lut(stops: list[str], *, size: int = 256) -> np.ndarray:
|
||||
for channel in range(3):
|
||||
lut[:, channel] = np.interp(sample_positions, stop_positions, stop_colors[:, channel]).astype(np.uint8)
|
||||
return lut
|
||||
|
||||
|
||||
@@ -64,7 +64,6 @@ class GprRenderer:
|
||||
|
||||
def __init__(self) -> None:
|
||||
self.widget = create_plot("GPR coherent BP")
|
||||
self.widget.setBackground("#0f141c")
|
||||
plot = self.widget.getPlotItem()
|
||||
assert plot is not None
|
||||
self._plot = plot
|
||||
|
||||
@@ -39,7 +39,7 @@ SAR3D_VIEWS: dict[str, tuple[str, str, str, tuple[int, int] | None]] = {
|
||||
"sar3d_front": ("Front (X-Y)", "X", "Y", (0, 1)),
|
||||
"sar3d_side": ("Side (Z-Y)", "Z", "Y", (2, 1)),
|
||||
"sar3d_top": ("Top (X-Z)", "X", "Z", (0, 2)),
|
||||
"sar3d_oblique": ("3D projection", "", "", None),
|
||||
"sar3d_oblique": ("3D Projection", "", "", None),
|
||||
}
|
||||
|
||||
# Corners of the scene box indexed by bits (x, y, z); an edge joins corners one bit apart.
|
||||
@@ -209,10 +209,9 @@ class Sar3dRenderer:
|
||||
(x0, x1), _, (z0, z1) = bounds
|
||||
ground = (np.array([[x0, 0.0, z0], [x1, 0.0, z0], [x1, 0.0, z1], [x0, 0.0, z1], [x0, 0.0, z0]]) @ basis.table.T).T
|
||||
self.ground.setData(ground[0], ground[1])
|
||||
summary = f"SAR3D: ready — {status[1]}" if status else "SAR3D: ready"
|
||||
if level is not None:
|
||||
x, y, z = peak_xyz
|
||||
self.plots["sar3d_oblique"].setTitle(
|
||||
f"3D projection | max X {x:+.2f}, Y {y:+.2f}, Z {z:.2f} m | level {level:.3g}"
|
||||
)
|
||||
self.status_label.setText(f"SAR3D: ready — {status[1]}" if status else "SAR3D: ready")
|
||||
summary += f" | max X {x:+.2f}, Y {y:+.2f}, Z {z:.2f} m | level {level:.3g}"
|
||||
self.status_label.setText(summary)
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user