@sailingrotevista/rotevista-dash 7.0.34 → 7.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app.js +6 -5
- package/package.json +1 -1
package/app.js
CHANGED
|
@@ -373,17 +373,18 @@ function processIncomingData(path, val, source, timeMs) {
|
|
|
373
373
|
}
|
|
374
374
|
}
|
|
375
375
|
|
|
376
|
-
|
|
377
|
-
|
|
376
|
+
// Aggiorna lo stato raw e sincronizza il timestamp del watchdog sull'orologio locale (Date.now()) per evitare falsi timeout
|
|
377
|
+
const localNow = Date.now();
|
|
378
|
+
store.timestamps[path] = localNow;
|
|
378
379
|
store.raw[path] = val;
|
|
379
380
|
|
|
380
|
-
// Converte e aggiorna istantaneamente store.raw["navigation.headingTrue"] prima del rate limiter
|
|
381
|
+
// Converte e aggiorna istantaneamente store.raw["navigation.headingTrue"] per la UI prima del rate limiter
|
|
381
382
|
if (path === "navigation.headingMagnetic") {
|
|
382
|
-
const hasNativeTrueHdg = store.timestamps["navigation.headingTrueNative"] && (
|
|
383
|
+
const hasNativeTrueHdg = store.timestamps["navigation.headingTrueNative"] && (localNow - store.timestamps["navigation.headingTrueNative"] < 5000);
|
|
383
384
|
if (!hasNativeTrueHdg) {
|
|
384
385
|
const variation = store.raw["navigation.magneticVariation"] || 0;
|
|
385
386
|
store.raw["navigation.headingTrue"] = (val + variation + 2 * Math.PI) % (2 * Math.PI);
|
|
386
|
-
store.timestamps["navigation.headingTrue"] =
|
|
387
|
+
store.timestamps["navigation.headingTrue"] = localNow;
|
|
387
388
|
}
|
|
388
389
|
}
|
|
389
390
|
|