feat(gui): 全流程面板合并 + 一键式运行 GUI 入口集成

This commit is contained in:
DXC
2026-06-09 11:30:42 +08:00
parent aefc9d5aac
commit 28394f2eda
20 changed files with 2843 additions and 2432 deletions

View File

@ -349,6 +349,12 @@ class AISettingsDialog(QDialog):
# 交互式采样点与光谱查看器
# ─────────────────────────────────────────────────────────────────────────────
import matplotlib.pyplot as _plt
# 全局字体设置(防中文乱码 + 负号显示异常)
_plt.rcParams['font.sans-serif'] = ['Microsoft YaHei', 'SimHei', 'Arial Unicode MS']
_plt.rcParams['axes.unicode_minus'] = False
class SamplingViewerDialog(QDialog):
"""交互式采样点与光谱查看器
@ -381,8 +387,8 @@ class SamplingViewerDialog(QDialog):
self._fig = Figure(figsize=(6, 5))
self._canvas = FigureCanvasQTAgg(self._fig)
self._ax_scatter = self._fig.add_subplot(111)
self._ax_scatter.set_xlabel("pixel_x")
self._ax_scatter.set_ylabel("pixel_y")
self._ax_scatter.set_xlabel("像素 X")
self._ax_scatter.set_ylabel("像素 Y")
self._ax_scatter.set_title("采样点分布(点击查看详情)")
self._ax_scatter.invert_yaxis()
self._fig.tight_layout()
@ -392,18 +398,20 @@ class SamplingViewerDialog(QDialog):
# --- 右侧:信息面板 + 光谱子图 ---
right_widget = QWidget()
right_layout = QVBoxLayout(right_widget)
right_layout.setContentsMargins(0, 0, 0, 0)
# 坐标信息面板(多行中文清晰显示)
self._info_label = QLabel("点击左侧散点图选择采样点")
self._info_label.setStyleSheet(
"QLabel { background-color: #f0f0f0; padding: 6px; "
"border: 1px solid #ccc; font-size: 13px; }"
"QLabel { background-color: #f0f0f0; padding: 8px; "
"border: 1px solid #ccc; border-radius: 4px; font-size: 13px; }"
)
right_layout.addWidget(self._info_label)
# 采样点列表迷你表格
self._point_table = QTableWidget()
self._point_table.setColumnCount(3)
self._point_table.setHorizontalHeaderLabels(["pixel_x", "pixel_y", "index"])
self._point_table.setHorizontalHeaderLabels(["像素 X", "像素 Y", "序号"])
self._point_table.setMaximumHeight(120)
self._point_table.setEditTriggers(QTableWidget.NoEditTriggers)
self._point_table.setSelectionBehavior(QTableWidget.SelectRows)
@ -413,8 +421,8 @@ class SamplingViewerDialog(QDialog):
# 光谱曲线子图
self._fig_right = Figure(figsize=(5, 3))
self._ax_spectrum = self._fig_right.add_subplot(111)
self._ax_spectrum.set_xlabel("Band Index")
self._ax_spectrum.set_ylabel("Reflectance")
self._ax_spectrum.set_xlabel("波段序号")
self._ax_spectrum.set_ylabel("反射率")
self._ax_spectrum.set_title("光谱曲线")
self._fig_right.tight_layout()
@ -440,8 +448,8 @@ class SamplingViewerDialog(QDialog):
def _draw_scatter(self):
"""绘制散点图"""
self._ax_scatter.clear()
self._ax_scatter.set_xlabel("pixel_x")
self._ax_scatter.set_ylabel("pixel_y")
self._ax_scatter.set_xlabel("像素 X")
self._ax_scatter.set_ylabel("像素 Y")
self._ax_scatter.set_title("采样点分布(点击查看详情)")
self._ax_scatter.invert_yaxis()
@ -497,14 +505,14 @@ class SamplingViewerDialog(QDialog):
self._info_label.setText(
f"<b>选中的采样点 #{nearest_idx}</b><br>"
f"pixel_x = {pixel_x} &nbsp; pixel_y = {pixel_y}<br>"
f"x_coord = {x_coord} &nbsp; y_coord = {y_coord}"
f"图像像素坐标: X = {pixel_x}, Y = {pixel_y}<br>"
f"地理真实坐标: 经度(X) = {x_coord}, 纬度(Y) = {y_coord}"
)
# 高亮散点图
self._ax_scatter.clear()
self._ax_scatter.set_xlabel("pixel_x")
self._ax_scatter.set_ylabel("pixel_y")
self._ax_scatter.set_xlabel("像素 X")
self._ax_scatter.set_ylabel("像素 Y")
self._ax_scatter.set_title(f"采样点分布(共 {len(self.df)} 个)")
self._ax_scatter.invert_yaxis()
self._ax_scatter.scatter(
@ -523,8 +531,8 @@ class SamplingViewerDialog(QDialog):
def _draw_spectrum(self, row: pd.Series):
"""从一行数据中提取纯波段数值并绘图"""
self._ax_spectrum.clear()
self._ax_spectrum.set_xlabel("Band Index")
self._ax_spectrum.set_ylabel("Reflectance")
self._ax_spectrum.set_xlabel("波段序号")
self._ax_spectrum.set_ylabel("反射率")
self._ax_spectrum.set_title("光谱曲线")
exclude_patterns = (