@sailingrotevista/rotevista-dash 6.0.7 → 6.0.8
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 +8 -3
- package/index.js +12 -7
- package/package.json +1 -1
package/app.js
CHANGED
|
@@ -885,10 +885,14 @@ function manageHistory(type, value) {
|
|
|
885
885
|
const samples = Math.max(2, CONFIG.graphs.samples || 60);
|
|
886
886
|
const bucketIntervalMs = (historyMinutes * 60000) / samples;
|
|
887
887
|
|
|
888
|
-
// --- 2. INIT SICURO (
|
|
888
|
+
// --- 2. INIT SICURO (Sintonizzato all'epoca assoluta UTC) ---
|
|
889
889
|
if (!store.graphTempBuf[type]) store.graphTempBuf[type] = [];
|
|
890
890
|
if (!store.histories[type]) store.histories[type] = [];
|
|
891
|
-
|
|
891
|
+
|
|
892
|
+
// SINTONIZZAZIONE DI FASE: Agganciamo il timer iniziale al multiplo UTC più vicino
|
|
893
|
+
if (store.lastUpdates[type] === undefined || store.lastUpdates[type] === 0) {
|
|
894
|
+
store.lastUpdates[type] = Math.floor(now / bucketIntervalMs) * bucketIntervalMs;
|
|
895
|
+
}
|
|
892
896
|
|
|
893
897
|
const tempBuf = store.graphTempBuf[type];
|
|
894
898
|
|
|
@@ -956,7 +960,8 @@ function manageHistory(type, value) {
|
|
|
956
960
|
|
|
957
961
|
// Reset per il prossimo bucket
|
|
958
962
|
store.graphTempBuf[type] = [];
|
|
959
|
-
|
|
963
|
+
// Spostiamo il timer esattamente al confine del secchiello assoluto appena concluso
|
|
964
|
+
store.lastUpdates[type] = Math.floor(now / bucketIntervalMs) * bucketIntervalMs;
|
|
960
965
|
}
|
|
961
966
|
|
|
962
967
|
/**
|
package/index.js
CHANGED
|
@@ -153,11 +153,15 @@ module.exports = function (app) {
|
|
|
153
153
|
const samples = 60;
|
|
154
154
|
const bucketIntervalMs = (historyMinutes * 60000) / samples;
|
|
155
155
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
156
|
+
if (!graphTempBuf[type]) graphTempBuf[type] = [];
|
|
157
|
+
if (!histories[type]) histories[type] = [];
|
|
158
|
+
|
|
159
|
+
// SINTONIZZAZIONE DI FASE LATO SERVER (UTC Snap)
|
|
160
|
+
if (lastUpdates[type] === undefined || lastUpdates[type] === 0) {
|
|
161
|
+
lastUpdates[type] = Math.floor(now / bucketIntervalMs) * bucketIntervalMs;
|
|
162
|
+
}
|
|
159
163
|
|
|
160
|
-
|
|
164
|
+
const tempBuf = graphTempBuf[type];
|
|
161
165
|
|
|
162
166
|
// Anti-dropout dinamico sul vento forte
|
|
163
167
|
if ((type === 'tws' || type === 'aws') && value < 0.05 && tempBuf.length > 0) {
|
|
@@ -219,9 +223,10 @@ module.exports = function (app) {
|
|
|
219
223
|
histories[type].shift();
|
|
220
224
|
}
|
|
221
225
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
226
|
+
graphTempBuf[type] = [];
|
|
227
|
+
// Spostiamo il timer esattamente al confine del secchiello assoluto appena concluso
|
|
228
|
+
lastUpdates[type] = Math.floor(now / bucketIntervalMs) * bucketIntervalMs;
|
|
229
|
+
}
|
|
225
230
|
|
|
226
231
|
/**
|
|
227
232
|
* plugin.schema: Definisce l'interfaccia grafica in Signal K Admin.
|