From 1c582f2aa867fd3e1fe8c138a5a05d393aea5c56 Mon Sep 17 00:00:00 2001 From: "marcinlei@outlook.com" <1750818448@qq.com> Date: Sun, 24 Aug 2025 17:10:46 +0800 Subject: [PATCH] =?UTF-8?q?perf(=E6=B8=A9=E5=BA=A6=E6=98=BE=E7=A4=BA)=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=B8=A9=E5=BA=A6=E6=98=BE=E7=A4=BA=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ZiJin_parse_sensorhistory.py | 8 ++++++++ src/main_window.py | 6 +++++- src/view_renderer.py | 12 +++++++++++- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/ZiJin_parse_sensorhistory.py b/src/ZiJin_parse_sensorhistory.py index e46e58a..a44b821 100644 --- a/src/ZiJin_parse_sensorhistory.py +++ b/src/ZiJin_parse_sensorhistory.py @@ -217,6 +217,14 @@ def get_sensor_all_image_path(type): file_path = os.path.join(default_chart_dir, "VR_CPU_temperature.png") case "vr_fpga": file_path = os.path.join(default_chart_dir, "VR_FPGA_temperature.png") + case "opt0": + file_path = os.path.join(default_chart_dir, "OPT0_temperature.png") + case "opt1": + file_path = os.path.join(default_chart_dir, "OPT1_temperature.png") + case "opt2": + file_path = os.path.join(default_chart_dir, "OPT2_temperature.png") + case "opt3": + file_path = os.path.join(default_chart_dir, "OPT3_temperature.png") case _: file_path = os.path.join(default_chart_dir, "temperature_distribution.png") return file_path diff --git a/src/main_window.py b/src/main_window.py index 4de41a8..3efeb8a 100644 --- a/src/main_window.py +++ b/src/main_window.py @@ -44,5 +44,9 @@ class MainWindow(QMainWindow, Ui_MainWindow): "Outlet_CPU_Temp": "outlet_cpu", "Outlet_FPGA_Temp": "outlet_fpga", "VR_CPU_Temp": "vr_cpu", - "VR_FPGA_Temp": "vr_fpga" + "VR_FPGA_Temp": "vr_fpga", + "OPT0_Temp": "opt1", + "OPT1_Temp": "opt1", + "OPT2_Temp": "opt2", + "OPT3_Temp": "opt3", } \ No newline at end of file diff --git a/src/view_renderer.py b/src/view_renderer.py index dc4e37c..94add41 100644 --- a/src/view_renderer.py +++ b/src/view_renderer.py @@ -2,6 +2,8 @@ from PyQt5.QtWidgets import QGraphicsPixmapItem from PyQt5.QtGui import QPixmap, QStandardItem from PyQt5.QtCore import Qt from utils import show_critical_message # 导入工具类的错误弹窗函数 +from utils import show_info_message +import os class ViewRenderer: """视图渲染模块:负责图片显示、表格数据填充等UI渲染逻辑""" @@ -13,7 +15,15 @@ class ViewRenderer: """ 在 QGraphicsView 中显示图片(支持抗锯齿、居中适配) :param image_path: 图片文件的绝对路径 - """ + """ + if not os.path.exists(image_path): + show_info_message( + parent=self.main_window, + title="图片无法显示", + message="目标日志文件中无温度数据, 可能是BMC版本不支持\n" + ) + return + try: # 1. 清空场景中已有的图片(避免叠加显示) self.main_window.scene.clear()