图标升级

This commit is contained in:
2026-05-16 00:44:37 +08:00
parent 837996c436
commit d80e8dd05d
2113 changed files with 14850 additions and 244328 deletions

View File

@@ -119,10 +119,11 @@ class TempGauge(QWidget):
p.drawText(44, 16, w - 44, 24, Qt.AlignmentFlag.AlignLeft | Qt.AlignmentFlag.AlignVCenter,
f"{self._actual:.0f}°")
if self._target > 0:
tgt_y = bar_y + bar_h - int((bar_h - 4) * min(self._target / 300, 1))
font2 = QFont("sans-serif", 10)
p.setFont(font2)
p.setPen(QPen(QColor("#888888")))
p.drawText(44, 34, w - 44, 20, Qt.AlignmentFlag.AlignLeft | Qt.AlignmentFlag.AlignVCenter,
p.drawText(44, tgt_y - 10, w - 44, 20, Qt.AlignmentFlag.AlignLeft | Qt.AlignmentFlag.AlignVCenter,
f"{self._target:.0f}°")
font3 = QFont("sans-serif", 10, QFont.Weight.Bold)
@@ -134,9 +135,10 @@ class TempGauge(QWidget):
# ── 状态页面 ────────────────────────────────────────────
class StatusPage(QWidget):
def __init__(self, api_client, parent=None):
def __init__(self, api_client, GcodeViewer=None, parent=None):
super().__init__(parent)
self.api_client = api_client
self.gcode_viewer = GcodeViewer
self.file_name = "None"
self.progress = 0.0
@@ -283,15 +285,24 @@ class StatusPage(QWidget):
# ── 右侧预留区域 ─────────────────────────────
right_frame = QFrame()
right_frame.setStyleSheet("background-color: #3a3a3a; border-radius: 10px;")
right_layout = QVBoxLayout(right_frame)
right_layout.setContentsMargins(6, 6, 6, 6)
self.right_layout = QVBoxLayout(right_frame)
self.right_layout.setContentsMargins(6, 6, 6, 6)
self.gcode_viewer = GCodeViewerWidget()
right_layout.addWidget(self.gcode_viewer)
# self.gcode_viewer = GCodeViewerWidget()
if self.gcode_viewer is not None:
self.right_layout.addWidget(self.gcode_viewer)
# self.gcode_viewer.setUpdatesEnabled(False)
# self.gcode_viewer.hide()
main_layout.addWidget(left_frame, 2)
main_layout.addWidget(right_frame, 3)
# QTimer.singleShot(5000, self.init_gcode_viewer)
# def init_gcode_viewer(self):
# self.gcode_viewer = GCodeViewerWidget()
# self.right_layout.addWidget(self.gcode_viewer)
def update_status(self):
self.fresh_status_valve()