generated from hulk/gd32f4xx_template_cmake_vscode
Heater: segmented PID (full-power / slow-band / overtemp-cutoff) + 2s/5pct PWM
This commit is contained in:
@@ -87,4 +87,3 @@ python publish_gitea.py release/FilmForge-GUI-v<版本>-win64.zip --replace --in
|
||||
(设备单向推送),不受影响。
|
||||
- 加热(M3S1)为真实 PID 闭环:开启后模具真实升温(NTC 故障/过温 150℃ 固件自动
|
||||
断电保护,上电默认关闭);当前占空比无查询命令,从温度曲线间接观察。
|
||||
- 打包暂无应用图标(`logos/filmforge.ico` 缺位,build_exe.py 自动跳过)。
|
||||
|
||||
+23
-2
@@ -46,7 +46,7 @@ if getattr(sys, "frozen", False) and os.name == "nt":
|
||||
pass
|
||||
|
||||
from PySide6.QtCore import QPointF, QRectF, Qt, QTimer
|
||||
from PySide6.QtGui import QColor, QFont, QPainter, QPainterPath, QPen, QPalette
|
||||
from PySide6.QtGui import QColor, QFont, QIcon, QPainter, QPainterPath, QPen, QPalette
|
||||
from PySide6.QtWidgets import (
|
||||
QApplication, QHBoxLayout, QLabel, QMainWindow, QMessageBox, QPlainTextEdit,
|
||||
QScrollArea, QSplitter, QVBoxLayout, QWidget,
|
||||
@@ -60,7 +60,7 @@ import config
|
||||
import filmforge_rs485 as ff
|
||||
|
||||
APP_NAME = "FilmForge"
|
||||
APP_VERSION = "0.2.6"
|
||||
APP_VERSION = "0.2.7"
|
||||
REPO_URL = "https://gitea.hulk.wang/hulk/FilmForge"
|
||||
MONO = QFont("Consolas", 10)
|
||||
CHIP_IDLE = "#666666"
|
||||
@@ -364,6 +364,9 @@ class App(QMainWindow):
|
||||
self._system_palette = app.palette() if app else QPalette()
|
||||
self._system_style = app.styleSheet() if app else ""
|
||||
self.setWindowTitle(f"{APP_NAME} v{APP_VERSION} — 热压模具温控监视台")
|
||||
icon = _icon_path() # 标题栏图标(run_gui 另设 app 级 + 任务栏标识)
|
||||
if os.path.exists(icon):
|
||||
self.setWindowIcon(QIcon(icon))
|
||||
self.resize(1440, 920)
|
||||
self.setMinimumSize(1150, 720)
|
||||
|
||||
@@ -1326,6 +1329,15 @@ def _single_instance():
|
||||
return True
|
||||
|
||||
|
||||
def _icon_path():
|
||||
"""窗口图标路径: 打包版取 _MEIPASS(build_exe.py --add-data 内嵌), 源码版取 logos/。"""
|
||||
bundled = os.path.join(getattr(sys, "_MEIPASS", ""), "filmforge.ico")
|
||||
if os.path.exists(bundled):
|
||||
return bundled
|
||||
return os.path.join(os.path.dirname(os.path.abspath(__file__)),
|
||||
"logos", "filmforge.ico")
|
||||
|
||||
|
||||
def run_gui(auto_close=0):
|
||||
if not _single_instance():
|
||||
app = QApplication.instance() or QApplication(sys.argv)
|
||||
@@ -1333,6 +1345,15 @@ def run_gui(auto_close=0):
|
||||
return
|
||||
app = QApplication.instance() or QApplication(sys.argv)
|
||||
app.setApplicationName(APP_NAME)
|
||||
if os.name == "nt":
|
||||
try: # 任务栏独立标识: 缺省时任务栏可能沿用宿主默认图标并错误分组
|
||||
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(
|
||||
"hulk.FilmForge.GUI")
|
||||
except Exception:
|
||||
pass
|
||||
icon = _icon_path()
|
||||
if os.path.exists(icon):
|
||||
app.setWindowIcon(QIcon(icon)) # 主窗/弹窗/任务栏统一图标
|
||||
setTheme(Theme.AUTO)
|
||||
window = App(auto_close)
|
||||
window.show()
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
@@ -0,0 +1,6 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
||||
<rect width="512" height="512" fill="#000000"/>
|
||||
<rect x="38" y="64" width="436" height="186" rx="34" fill="#00C8D7"/>
|
||||
<text x="256" y="210" font-family="Arial, 'Microsoft YaHei', sans-serif" font-size="146" font-weight="900" fill="#000000" text-anchor="middle">FILM</text>
|
||||
<text x="256" y="421" font-family="Arial, 'Microsoft YaHei', sans-serif" font-size="146" font-weight="900" fill="#FFFFFF" text-anchor="middle">Forge</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 507 B |
@@ -40,6 +40,9 @@ window = app_fluent.App(0)
|
||||
window.show()
|
||||
app.processEvents()
|
||||
|
||||
# 0) 图标链路: logos/filmforge.ico 存在时窗口图标必须已加载
|
||||
check('窗口图标已设置', not window.windowIcon().isNull(), True)
|
||||
|
||||
# 1) 空数据渲染不抛异常(占位文案)
|
||||
img = QImage(window.chart.size(), QImage.Format_ARGB32)
|
||||
window.chart.render(img)
|
||||
|
||||
Reference in New Issue
Block a user