From f033da325dd16825bbca0d1ac71cc76420dfc8a2 Mon Sep 17 00:00:00 2001
From: Junjie <DELL@qq.com>
Date: 星期五, 09 一月 2026 11:14:36 +0800
Subject: [PATCH] #
---
src/main/webapp/components/MapCanvas.js | 17 ++++++++++++++---
1 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/src/main/webapp/components/MapCanvas.js b/src/main/webapp/components/MapCanvas.js
index 736e276..be746ba 100644
--- a/src/main/webapp/components/MapCanvas.js
+++ b/src/main/webapp/components/MapCanvas.js
@@ -185,12 +185,23 @@
//*******************FPS*******************
let g_Time = 0;
+ let fpsLastUpdateTs = 0;
+ let fpsDeltaSumMs = 0;
+ let fpsFrameCount = 0;
+ const fpsUpdateInterval = 200;
this.pixiApp.ticker.add((delta) => {
const timeNow = (new Date()).getTime();
const timeDiff = timeNow - g_Time;
g_Time = timeNow;
- const fps = 1000 / timeDiff;
- this.mapFps = parseInt(fps);
+ fpsDeltaSumMs += timeDiff;
+ fpsFrameCount += 1;
+ if (timeNow - fpsLastUpdateTs >= fpsUpdateInterval) {
+ const avgFps = fpsDeltaSumMs > 0 ? (fpsFrameCount * 1000 / fpsDeltaSumMs) : 0;
+ this.mapFps = Math.round(avgFps);
+ fpsDeltaSumMs = 0;
+ fpsFrameCount = 0;
+ fpsLastUpdateTs = timeNow;
+ }
});
//*******************FPS*******************
},
@@ -528,7 +539,7 @@
}
if (status === "site-auto") {
this.updateColor(sta, 0x78ff81);
- } else if (status === "site-auto-run" || status === "site-auto-run-id") {
+ } else if (status === "site-auto-run" || status === "site-auto-id" || status === "site-auto-run-id") {
this.updateColor(sta, 0xfa51f6);
} else if (status === "site-unauto") {
this.updateColor(sta, 0xb8b8b8);
--
Gitblit v1.9.1