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.
@@ -1,7 +1,7 @@
1
1
  {
2
- "version": "2.1.9",
3
- "timestamp": "20260610-0302",
2
+ "version": "2.1.10",
3
+ "timestamp": "20260611-0008",
4
4
  "gitHash": null,
5
5
  "gitDirty": true,
6
- "builtAt": "2026-06-10T01:02:10.645Z"
6
+ "builtAt": "2026-06-10T22:08:49.472Z"
7
7
  }
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 = "Rev326";
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 = "v75";
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"](${minLat.toFixed(5)},${minLng.toFixed(5)},${maxLat.toFixed(5)},${maxLng.toFixed(5)});` +
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.9",
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",
@@ -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;