generated from hulk/gd32f4xx_template_cmake_vscode
Heater: setpoint ramping to suppress thermal-lag overshoot
This commit is contained in:
+2
-12
@@ -26,16 +26,10 @@ WINDOW_OPTIONS = (('2 分钟', 120), ('5 分钟', 300), ('15 分钟', 900),
|
||||
DEFAULT_WINDOW_SEC = 300
|
||||
MAX_SAMPLES = 200000 # 曲线内存上限(点), 超出丢最旧; 10Hz 下约 5.5 小时
|
||||
|
||||
# 自动轮询 M1 候选(毫秒): 仅在设备未开启 M2 上报时生效
|
||||
POLL_OPTIONS = (('关闭', 0), ('500 ms', 500), ('1 s', 1000), ('2 s', 2000))
|
||||
DEFAULT_POLL_MS = 1000
|
||||
|
||||
# 串口记忆(协议固定 115200-8-N-1, 仍允许改以便调试)
|
||||
SERIAL_CFG = {'port': '', 'baud': filmforge_rs485.DEFAULT_BAUD,
|
||||
'bytesize': 8, 'parity': 'N', 'stopbits': 1}
|
||||
REPORT_MS = 500 # 上报间隔输入框默认值
|
||||
POLL_MS = DEFAULT_POLL_MS # 自动轮询 M1 周期(0=关)
|
||||
POLL_ENABLED = True
|
||||
WINDOW_SEC = DEFAULT_WINDOW_SEC
|
||||
THEME = 'System'
|
||||
|
||||
@@ -65,14 +59,12 @@ def load_settings():
|
||||
SERIAL_CFG['stopbits'] = int(ser.get('stopbits') or 1)
|
||||
except (TypeError, ValueError):
|
||||
pass
|
||||
for key, target in (('report_ms', 'REPORT_MS'), ('poll_ms', 'POLL_MS'),
|
||||
('window_sec', 'WINDOW_SEC')):
|
||||
for key, target in (('report_ms', 'REPORT_MS'), ('window_sec', 'WINDOW_SEC')):
|
||||
try:
|
||||
globals()[target] = int(data.get(key))
|
||||
except (TypeError, ValueError):
|
||||
pass
|
||||
global POLL_ENABLED, THEME
|
||||
POLL_ENABLED = bool(data.get('poll_enabled', POLL_ENABLED))
|
||||
global THEME
|
||||
theme = str(data.get('theme') or '')
|
||||
if theme in ('Dark', 'Light', 'System'):
|
||||
THEME = theme
|
||||
@@ -83,8 +75,6 @@ def save_settings():
|
||||
data = {
|
||||
'serial': dict(SERIAL_CFG),
|
||||
'report_ms': REPORT_MS,
|
||||
'poll_ms': POLL_MS,
|
||||
'poll_enabled': POLL_ENABLED,
|
||||
'window_sec': WINDOW_SEC,
|
||||
'theme': THEME,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user