signalk-vessels-to-ais 1.5.1 → 1.6.1
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/.github/dependabot.yml +11 -0
- package/README.md +2 -0
- package/index.js +13 -5
- package/package.json +2 -2
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# To get started with Dependabot version updates, you'll need to specify which
|
|
2
|
+
# package ecosystems to update and where the package manifests are located.
|
|
3
|
+
# Please see the documentation for all configuration options:
|
|
4
|
+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
|
|
5
|
+
|
|
6
|
+
version: 2
|
|
7
|
+
updates:
|
|
8
|
+
- package-ecosystem: "npm" # See documentation for possible values
|
|
9
|
+
directory: "/" # Location of package manifests
|
|
10
|
+
schedule:
|
|
11
|
+
interval: "weekly"
|
package/README.md
CHANGED
|
@@ -9,6 +9,8 @@ User can configure:
|
|
|
9
9
|
- Own data can be added to AIS sending
|
|
10
10
|
|
|
11
11
|
New:
|
|
12
|
+
- v1.6.1, fix: ggencoder ^1.0.9 is use
|
|
13
|
+
- v1.6.0, fix: enhance error handling for AIS timestamp retrieval
|
|
12
14
|
- v1.5.1, fix: fix: improve shipName type checking
|
|
13
15
|
- v1.5.0, fix: callSign reading
|
|
14
16
|
- v1.4.0, add: Event output name to user configurable
|
package/index.js
CHANGED
|
@@ -211,19 +211,27 @@ module.exports = function createPlugin(app) {
|
|
|
211
211
|
const numberAIS = Object.keys(jsonContent).length;
|
|
212
212
|
for (i = 0; i < numberAIS; i++) {
|
|
213
213
|
const jsonKey = Object.keys(jsonContent)[i];
|
|
214
|
-
|
|
215
214
|
try {
|
|
216
215
|
aisTime = jsonContent[jsonKey].sensors.ais.class.timestamp;
|
|
217
216
|
} catch (error) {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
217
|
+
try {
|
|
218
|
+
if (i === 0) {
|
|
219
|
+
aisTime = jsonContent[jsonKey].navigation.position.timestamp;
|
|
220
|
+
} else {
|
|
221
|
+
aisTime = null;
|
|
222
|
+
}
|
|
223
|
+
} catch (error) {
|
|
221
224
|
aisTime = null;
|
|
222
225
|
}
|
|
223
226
|
}
|
|
224
227
|
|
|
225
|
-
|
|
228
|
+
if (aisTime) {
|
|
229
|
+
aisDelay = (parseFloat((moment(new Date(Date.now()))
|
|
226
230
|
.diff(aisTime) / 1000).toFixed(3))) < positionUpdate;
|
|
231
|
+
} else {
|
|
232
|
+
aisDelay = false;
|
|
233
|
+
}
|
|
234
|
+
|
|
227
235
|
|
|
228
236
|
try {
|
|
229
237
|
mmsi = jsonContent[jsonKey].mmsi;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "signalk-vessels-to-ais",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"description": "SignalK server plugin to convert other vessel data to NMEA0183 AIS format and forward it out to 3rd party applications",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"haversine-distance": "^1.2.1",
|
|
17
17
|
"moment": "^2.29.1",
|
|
18
18
|
"node-fetch": "^3.1.1",
|
|
19
|
-
"ggencoder": "^1.0.
|
|
19
|
+
"ggencoder": "^1.0.9"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"eslint": "^7.17.0",
|