signalk-mareas-ihm 2.1.9 → 2.1.10
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/dist/build-info.json +3 -3
- package/dist/index.js +1 -1
- package/dist/mobile.html +8 -0
- package/dist/sources/coastline.js +14 -2
- package/package.json +1 -1
- package/public/mobile.html +8 -0
package/dist/build-info.json
CHANGED
package/dist/index.js
CHANGED
|
@@ -49,7 +49,7 @@ function isPositionValue(v) {
|
|
|
49
49
|
// timestamp + git hash so we can verify exactly which build is running on the Pi
|
|
50
50
|
// without ambiguity. ("¿Qué versión tengo deployada?" → /api/paths or landing.)
|
|
51
51
|
const PLUGIN_VERSION = esmRequire("../package.json").version;
|
|
52
|
-
const PLUGIN_REVISION = "
|
|
52
|
+
const PLUGIN_REVISION = "Rev327";
|
|
53
53
|
let _buildInfo = null;
|
|
54
54
|
try {
|
|
55
55
|
_buildInfo = esmRequire("./build-info.json");
|
package/dist/mobile.html
CHANGED
|
@@ -6988,6 +6988,14 @@ function setAlarm(type,on){
|
|
|
6988
6988
|
var _alarmWeatherEnabled = (localStorage.getItem('ihm-weather-alarm')==='1');
|
|
6989
6989
|
function _checkWeatherAlarm(){
|
|
6990
6990
|
if (!_alarmWeatherEnabled) return;
|
|
6991
|
+
/* Rev327 (feedback Pablo): la alarma meteo es para FONDEO. Si no estamos
|
|
6992
|
+
fondeados, no hay nada que vigilar. Evita avisos sin sentido amarrado
|
|
6993
|
+
al pantalán o navegando. La rosa del visor y el historial IMU siguen
|
|
6994
|
+
activos para info general — solo se suprime el aviso/voz/banner. */
|
|
6995
|
+
if (typeof anch === 'undefined' || !anch) {
|
|
6996
|
+
try { setAlarmActive('weather', false); } catch(_){}
|
|
6997
|
+
return;
|
|
6998
|
+
}
|
|
6991
6999
|
try {
|
|
6992
7000
|
var asm = (typeof _shelterCache!=='undefined' && _shelterCache) ? _shelterCache.assessment : null;
|
|
6993
7001
|
if (!asm || !asm.hours || !asm.hours.length) return;
|
|
@@ -93,7 +93,7 @@ async function overpassFetch(url, query) {
|
|
|
93
93
|
const DEFAULT_SHELTER_DIST_NM = 0.3;
|
|
94
94
|
// Rev75: algorithm version embedded in cache keys so a deploy automatically
|
|
95
95
|
// invalidates results computed with previous (looser) logic.
|
|
96
|
-
const ALGORITHM_VERSION = "
|
|
96
|
+
const ALGORITHM_VERSION = "v76"; // Rev327: query incluye man_made breakwater/pier/groyne
|
|
97
97
|
export async function detectShelterFromCoastline(lat, lng, cache, app, shelterDistNm = DEFAULT_SHELTER_DIST_NM) {
|
|
98
98
|
const key = cacheKey(lat, lng, shelterDistNm);
|
|
99
99
|
// Serve from fresh cache if available.
|
|
@@ -119,11 +119,23 @@ export async function detectShelterFromCoastline(lat, lng, cache, app, shelterDi
|
|
|
119
119
|
const dpLng = nmToDegLngAtLat(PEAK_SEARCH_NM, lat);
|
|
120
120
|
const pMinLat = lat - dpLat, pMaxLat = lat + dpLat;
|
|
121
121
|
const pMinLng = lng - dpLng, pMaxLng = lng + dpLng;
|
|
122
|
+
// Rev327 (feedback Pablo en Vigo marina 42.242,-8.724):
|
|
123
|
+
// El query original SOLO buscaba `natural=coastline`. En marinas/puertos,
|
|
124
|
+
// los espigones que realmente protegen del oleaje están etiquetados como
|
|
125
|
+
// `man_made=breakwater` (escollera/dique exterior), `man_made=pier`
|
|
126
|
+
// (pantalán) o `man_made=groyne` (espigón perpendicular). Al ignorarlos
|
|
127
|
+
// el cálculo daba "F · 10% protección" para una marina con escolleras
|
|
128
|
+
// gigantes. Ahora los tratamos como obstáculos sólidos igual que la línea
|
|
129
|
+
// de costa (ray-cast contra sus segmentos).
|
|
122
130
|
// One combined Overpass query — saves a round-trip and shares the timeout.
|
|
123
131
|
// bbox order: south, west, north, east.
|
|
132
|
+
const bboxStr = `${minLat.toFixed(5)},${minLng.toFixed(5)},${maxLat.toFixed(5)},${maxLng.toFixed(5)}`;
|
|
124
133
|
const query = `[out:json][timeout:25];` +
|
|
125
134
|
`(` +
|
|
126
|
-
`way["natural"="coastline"](${
|
|
135
|
+
`way["natural"="coastline"](${bboxStr});` +
|
|
136
|
+
`way["man_made"="breakwater"](${bboxStr});` +
|
|
137
|
+
`way["man_made"="pier"](${bboxStr});` +
|
|
138
|
+
`way["man_made"="groyne"](${bboxStr});` +
|
|
127
139
|
`node["natural"="peak"]["ele"](${pMinLat.toFixed(5)},${pMinLng.toFixed(5)},${pMaxLat.toFixed(5)},${pMaxLng.toFixed(5)});` +
|
|
128
140
|
`);out geom;`;
|
|
129
141
|
// Iterate mirrors until one succeeds or all fail.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "signalk-mareas-ihm",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.10",
|
|
4
4
|
"description": "Real-time anchor alarm synced across devices, with blended nautical/bathymetric charts for your anchorage, shelter forecasts, and advanced depth/scope/tide tools.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
package/public/mobile.html
CHANGED
|
@@ -6988,6 +6988,14 @@ function setAlarm(type,on){
|
|
|
6988
6988
|
var _alarmWeatherEnabled = (localStorage.getItem('ihm-weather-alarm')==='1');
|
|
6989
6989
|
function _checkWeatherAlarm(){
|
|
6990
6990
|
if (!_alarmWeatherEnabled) return;
|
|
6991
|
+
/* Rev327 (feedback Pablo): la alarma meteo es para FONDEO. Si no estamos
|
|
6992
|
+
fondeados, no hay nada que vigilar. Evita avisos sin sentido amarrado
|
|
6993
|
+
al pantalán o navegando. La rosa del visor y el historial IMU siguen
|
|
6994
|
+
activos para info general — solo se suprime el aviso/voz/banner. */
|
|
6995
|
+
if (typeof anch === 'undefined' || !anch) {
|
|
6996
|
+
try { setAlarmActive('weather', false); } catch(_){}
|
|
6997
|
+
return;
|
|
6998
|
+
}
|
|
6991
6999
|
try {
|
|
6992
7000
|
var asm = (typeof _shelterCache!=='undefined' && _shelterCache) ? _shelterCache.assessment : null;
|
|
6993
7001
|
if (!asm || !asm.hours || !asm.hours.length) return;
|