@sailingrotevista/rotevista-dash 6.0.7 → 6.0.9
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/icons/dash.png +0 -0
- package/index.html +16 -9
- package/index.js +12 -7
- package/manifest.json +2 -2
- 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/icons/dash.png
ADDED
|
Binary file
|
package/index.html
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html lang="it">
|
|
3
|
-
<head>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
|
6
|
+
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
7
|
+
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
|
8
|
+
<link rel="manifest" href="manifest.json">
|
|
9
|
+
|
|
10
|
+
<!-- Icona standard per la scheda del browser (Favicon) -->
|
|
11
|
+
<link rel="icon" type="image/png" href="icons/dash.png">
|
|
12
|
+
|
|
13
|
+
<!-- Icona per Bookmark e schermata Home su Apple iPad, iPhone e Mac -->
|
|
14
|
+
<link rel="apple-touch-icon" href="icons/dash.png">
|
|
15
|
+
|
|
16
|
+
<title>Sailing Dashboard Pro</title>
|
|
17
|
+
<link rel="stylesheet" href="style.css">
|
|
18
|
+
</head>
|
|
12
19
|
<body>
|
|
13
20
|
|
|
14
21
|
<div class="main-container">
|
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.
|
package/manifest.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "Signal K Wind Dashboard",
|
|
4
4
|
"icons": [
|
|
5
5
|
{
|
|
6
|
-
"src": "
|
|
6
|
+
"src": "./icons/dash.png",
|
|
7
7
|
"type": "image/png",
|
|
8
8
|
"sizes": "512x512"
|
|
9
9
|
}
|
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
"scope": "./",
|
|
15
15
|
"theme_color": "#000000",
|
|
16
16
|
"orientation": "landscape"
|
|
17
|
-
}
|
|
17
|
+
}
|