signalk-vessels-to-ais 1.4.0 → 1.5.0
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/README.md +1 -0
- package/index.js +7 -12
- package/package.json +1 -1
package/README.md
CHANGED
package/index.js
CHANGED
|
@@ -256,11 +256,7 @@ module.exports = function createPlugin(app) {
|
|
|
256
256
|
dst = jsonContent[jsonKey].navigation.destination.commonName.value;
|
|
257
257
|
} catch (error) { dst = ''; }
|
|
258
258
|
try {
|
|
259
|
-
|
|
260
|
-
callSign = jsonContent[jsonKey].communication.callsignVhf;
|
|
261
|
-
} else {
|
|
262
|
-
callSign = jsonContent[jsonKey].communication.value.callsignVhf;
|
|
263
|
-
}
|
|
259
|
+
callSign = jsonContent[jsonKey].communication.callsignVhf.value || jsonContent[jsonKey].communication.callsignVhf;
|
|
264
260
|
} catch (error) { callSign = ''; }
|
|
265
261
|
try {
|
|
266
262
|
imo = (jsonContent[jsonKey].registrations.value.imo).substring(4, 20);
|
|
@@ -299,11 +295,6 @@ module.exports = function createPlugin(app) {
|
|
|
299
295
|
|
|
300
296
|
if (i === 0) {
|
|
301
297
|
own = true;
|
|
302
|
-
if (sendOwn) {
|
|
303
|
-
ais = 'A';
|
|
304
|
-
} else {
|
|
305
|
-
ais = '';
|
|
306
|
-
}
|
|
307
298
|
} else {
|
|
308
299
|
own = false;
|
|
309
300
|
}
|
|
@@ -380,7 +371,7 @@ module.exports = function createPlugin(app) {
|
|
|
380
371
|
dimD: beam,
|
|
381
372
|
};
|
|
382
373
|
|
|
383
|
-
if (aisDelay && (ais === 'A' || ais === 'B')) {
|
|
374
|
+
if (aisDelay && (ais === 'A' || ais === 'B' || ais === 'BASE')) {
|
|
384
375
|
// eslint-disable-next-line no-useless-concat
|
|
385
376
|
app.debug(`Distance range: ${distance}km, AIS target distance: ${dist}km` + `, Class ${ais} Vessel` + `, MMSI:${mmsi}`);
|
|
386
377
|
if (ais === 'A') {
|
|
@@ -389,11 +380,15 @@ module.exports = function createPlugin(app) {
|
|
|
389
380
|
aisOut(encMsg5, aisTime);
|
|
390
381
|
}
|
|
391
382
|
if (ais === 'B') {
|
|
392
|
-
app.debug(`class
|
|
383
|
+
app.debug(`class ${ais}, ${i}, time: ${aisTime}`);
|
|
393
384
|
aisOut(encMsg18, aisTime);
|
|
394
385
|
aisOut(encMsg240, aisTime);
|
|
395
386
|
aisOut(encMsg241, aisTime);
|
|
396
387
|
}
|
|
388
|
+
if (ais === 'BASE') {
|
|
389
|
+
app.debug(`class ${ais}, ${i}, time: ${aisTime}`);
|
|
390
|
+
aisOut(encMsg3, aisTime);
|
|
391
|
+
}
|
|
397
392
|
app.debug('--------------------------------------------------------');
|
|
398
393
|
}
|
|
399
394
|
}
|
package/package.json
CHANGED