chore: 解决 stash pop 与 device-link 合并冲突并收回本地 WIP

保留 ConnectionHub(deviceLink 导入/ECAT 自启/pmHold 幂等)与主线
WIP(断线清指标、AUTO_POLL=false、boot_ecat 等)。
This commit is contained in:
cbb
2026-09-16 12:31:39 +08:00
parent 0c772f5924
commit e98950cde2
12 changed files with 1026 additions and 248 deletions
+6 -2
View File
@@ -17,7 +17,7 @@ import { addLog } from '../common/log.js';
var ESP32_STAGE_IDS = ['es1', 'es2', 'es3', 'es4', 'es5', 'es6'];
var ESP32_DETAIL_IDS = ['esd1', 'esd2', 'esd3', 'esd4', 'esd5', 'esd6'];
// 顶部步骤 pill → phase 名映射
var STEP_MAP = { esp32Ota: 'ppEsp32', gd32Ota: 'ppGd32Ota' };
var STEP_MAP = { esp32Ota: 'ppEsp32', gd32Ota: 'ppGd32Ota', ecatOta: 'ppEcatOta' };
// 进度条 DOM 元素懒缓存(首次访问后复用,DOM 未就绪时回退到 getElementById)
var progressFillEl = null;
var progressTxtEl = null;
@@ -228,6 +228,10 @@ export function markPhaseDone(phase) {
/** @description 更新进度条百分比和文本显示。对 pct 做边界校验,过滤 NaN/undefined。 */
export function setProgress(pct, text) {
/* EtherCAT 直灌期间进度条由 boot_ecat 的 setEcatPct 独占。
* pollStatus→stages 的 GD32 OTA 中继进度(60+0.3*pct,常落在 44–45)
* 会把灌写 0–100% 冲成假值,这里一刀切掉。 */
if (window.bootEcatBusy) return;
// 数值校验:BLE ACK 高频调用路径偶尔传入 undefined/NaN,需兜底避免出现 "undefined%"
var n = Number(pct);
if (!Number.isFinite(n)) n = 0;
@@ -248,7 +252,7 @@ export function resetProgress() {
window.activePhase = null;
window.esp32OtaPhase = 0;
switchStageFlow(null);
['ppEsp32', 'ppGd32Ota'].forEach(function (id) {
['ppEsp32', 'ppGd32Ota', 'ppEcatOta'].forEach(function (id) {
var el = document.getElementById(id);
if (el) el.classList.remove('active', 'done');
});