signalk-vessels-to-ais 1.2.2 → 1.4.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 +4 -2
- package/index.js +23 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,8 +9,10 @@ User can configure:
|
|
|
9
9
|
- Own data can be added to AIS sending
|
|
10
10
|
|
|
11
11
|
New:
|
|
12
|
-
- v1.
|
|
13
|
-
- v1.
|
|
12
|
+
- v1.4.0, add: Event output name to user configurable
|
|
13
|
+
- v1.3.0, add: Navigational Status variations
|
|
14
|
+
- v1.2.2, fix: if own position is not available
|
|
15
|
+
- v1.2.1, fix: own vessel sending
|
|
14
16
|
- v1.2.0, updated fetch method, no need for NODE_TLS_REJECT_UNAUTHORIZED=0 anymore
|
|
15
17
|
- v1.1.5, updated vessels within selected timeframe are sent out, radius filtering around own vessel and tag-block option added
|
|
16
18
|
- v1.1.4, small fix
|
package/index.js
CHANGED
|
@@ -43,6 +43,7 @@ module.exports = function createPlugin(app) {
|
|
|
43
43
|
const setStatus = app.setPluginStatus || app.setProviderStatus;
|
|
44
44
|
|
|
45
45
|
let useTag;
|
|
46
|
+
let eventName
|
|
46
47
|
|
|
47
48
|
const httpsAgent = new https.Agent({
|
|
48
49
|
rejectUnauthorized: false,
|
|
@@ -52,6 +53,7 @@ module.exports = function createPlugin(app) {
|
|
|
52
53
|
|
|
53
54
|
plugin.start = function (options) {
|
|
54
55
|
useTag = options.useTag;
|
|
56
|
+
eventName = options.eventName;
|
|
55
57
|
|
|
56
58
|
positionUpdate = options.position_update * 60;
|
|
57
59
|
distance = options.distance;
|
|
@@ -95,18 +97,32 @@ module.exports = function createPlugin(app) {
|
|
|
95
97
|
|
|
96
98
|
const stateMapping = {
|
|
97
99
|
motoring: 0,
|
|
100
|
+
'UnderWayUsingEngine': 0,
|
|
101
|
+
'under way using engine': 0,
|
|
102
|
+
'underway using engine': 0,
|
|
98
103
|
anchored: 1,
|
|
104
|
+
'AtAnchor': 1,
|
|
105
|
+
'at anchor': 1,
|
|
99
106
|
'not under command': 2,
|
|
100
107
|
'restricted manouverability': 3,
|
|
101
108
|
'constrained by draft': 4,
|
|
109
|
+
'constrained by her draught': 4,
|
|
102
110
|
moored: 5,
|
|
111
|
+
'Moored': 5,
|
|
103
112
|
aground: 6,
|
|
104
113
|
fishing: 7,
|
|
114
|
+
'engaged in fishing': 7,
|
|
105
115
|
sailing: 8,
|
|
116
|
+
'UnderWaySailing': 8,
|
|
117
|
+
'under way sailing': 8,
|
|
118
|
+
'underway sailing': 8,
|
|
106
119
|
'hazardous material high speed': 9,
|
|
107
120
|
'hazardous material wing in ground': 10,
|
|
121
|
+
'reserved for future use': 13,
|
|
108
122
|
'ais-sart': 14,
|
|
109
123
|
default: 15,
|
|
124
|
+
'UnDefined': 15,
|
|
125
|
+
'undefined': 15,
|
|
110
126
|
};
|
|
111
127
|
|
|
112
128
|
//----------------------------------------------------------------------------
|
|
@@ -135,7 +151,7 @@ module.exports = function createPlugin(app) {
|
|
|
135
151
|
}
|
|
136
152
|
if (sentence && sentence.length > 0) {
|
|
137
153
|
app.debug(taggString + sentence);
|
|
138
|
-
app.emit(
|
|
154
|
+
app.emit(eventName, taggString + sentence);
|
|
139
155
|
}
|
|
140
156
|
}
|
|
141
157
|
|
|
@@ -384,7 +400,7 @@ module.exports = function createPlugin(app) {
|
|
|
384
400
|
}
|
|
385
401
|
const dateobj = new Date(Date.now());
|
|
386
402
|
const date = dateobj.toISOString();
|
|
387
|
-
setStatus(`AIS NMEA message
|
|
403
|
+
setStatus(`AIS NMEA message sent: ${date}`);
|
|
388
404
|
})
|
|
389
405
|
.catch((err) => console.error(err));
|
|
390
406
|
}
|
|
@@ -430,6 +446,11 @@ module.exports = function createPlugin(app) {
|
|
|
430
446
|
default: 100,
|
|
431
447
|
title: 'AIS target within range [km]',
|
|
432
448
|
},
|
|
449
|
+
eventName: {
|
|
450
|
+
type: 'string',
|
|
451
|
+
default: 'nmea0183out',
|
|
452
|
+
title: 'Output event name',
|
|
453
|
+
},
|
|
433
454
|
},
|
|
434
455
|
};
|
|
435
456
|
|
package/package.json
CHANGED