perf(温度显示) 优化温度显示逻辑
This commit is contained in:
parent
c8794b8d47
commit
1c582f2aa8
@ -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
|
||||
|
||||
@ -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",
|
||||
}
|
||||
@ -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()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user