feat(web): 桌面原生桥 + 配置落盘 + 无设备静默态;排除调试脚本
变更点: 1. esp32_server.py - /api/motor/ui-state、/api/lab/ui-state:配置原子落盘 data/*.json(WebView2 清存储仍在) - _GuiApi.ecat_api/bridge_info:桌面壳经 GUI 进程裸 socket 直连 ecat_native,不经浏览器 HTTP 2. js/common/desktop-bridge.js(新) - 探测 pywebview.api(含 iframe top/parent),transport-ecat 优先走原生桥 3. connection.js + responsive.css + components.css - setQuietMode:离线且无传输时 html[data-dcu-calm=1] 掐常驻动画 - 进度条斜纹仅 .live 挂载,空闲不再按刷新率空转重绘 4. device-link.js - 先查 native/health,已健康跳过 motor/start,避免 loop_stop 重进 OP 假超时 - 周期强制 0.25ms + DC SYNC0 对齐;轮询自愈被配错的 DC/周期 5. motor/main.js + transport-ecat.js - 配置双写 localStorage + 磁盘 ui-state;pagehide/sendBeacon 刷盘;导入导出 - 探测代际 probeGen;ECAT 失败阈值 12;跟踪 bootActive/slaveAl/slaveOp 6. lab/spi_test.html、ota/boot_ecat.js、can_monitor 等跟随桥/静默态 7. .gitignore - 排除 scripts/_* 与 anal/collect/measure/trace 等调试脚本、lab 产物、data/ 运行态
This commit is contained in:
+7
-1
@@ -2,7 +2,7 @@
|
||||
* can_monitor.js - CAN 接收监控(独立页 can_monitor.html 与 can.html 右侧抽屉共用)
|
||||
*/
|
||||
import { showToast } from './common/toast.js';
|
||||
import { escapeHtml } from './common/utils.js';
|
||||
import { escapeHtml, flashBusyNow } from './common/utils.js';
|
||||
import { getBaseUrl as hubBaseUrl } from './common/base-url.js';
|
||||
import { deviceLink } from './common/device-link.js';
|
||||
|
||||
@@ -66,6 +66,9 @@ function getBaseUrl() {
|
||||
}
|
||||
|
||||
function setConnState(ok, text) {
|
||||
/* 无设备静默态:离线时掐掉常驻动画,规则见 css/responsive.css 的
|
||||
html[data-dcu-calm="1"] 段(160Hz 屏上每帧重算+重绘 ≈ 白烧一核)。 */
|
||||
document.documentElement.dataset.dcuCalm = ok ? '0' : '1';
|
||||
/* 嵌入 can.html 时顶栏已有 canConnPill,不再用 monConn 重复占位 */
|
||||
if (el.monConnPill) el.monConnPill.className = 'pill ' + (ok ? 'online' : 'offline');
|
||||
if (el.monConnTxt) el.monConnTxt.textContent = text;
|
||||
@@ -82,6 +85,9 @@ function setConnState(ok, text) {
|
||||
async function pollFeedback() {
|
||||
// 防重入:上一次 fetch 未完成则跳过本次 tick,避免并发请求叠加
|
||||
if (state.fbInFlight) return;
|
||||
/* 刷写/OTA 窗口内跳过:GD32 正在复位或停在 BOOT,0xC1 必被链路层拒
|
||||
* (ESP32 侧一帧一条拒绝日志),问了也是白问。标记随刷写收尾自撤。 */
|
||||
if (flashBusyNow()) return;
|
||||
state.fbInFlight = true;
|
||||
var ac = new AbortController();
|
||||
var timer = setTimeout(function () { ac.abort(); }, 3000);
|
||||
|
||||
Reference in New Issue
Block a user