freeboard-sk-helper
Advanced tools
Comparing version 1.5.0 to 1.5.1
# CHANGELOG: Freeboard-SK-Helper | ||
### v1.5.1 | ||
- **new**: Add support for `nextPoint.value.href`. | ||
### v1.5.0 | ||
- **new**: Add support for `targetArrivalTime`. | ||
### v1.4.2 | ||
@@ -4,0 +12,0 @@ |
{ | ||
"name": "freeboard-sk-helper", | ||
"version": "1.5.0", | ||
"version": "1.5.1", | ||
"description": "Freeboard-SK helper plugin for SignalK Server.", | ||
@@ -5,0 +5,0 @@ "main": "plugin/index.js", |
@@ -58,2 +58,3 @@ "use strict"; | ||
nextPoint: { | ||
href: null, | ||
position: null, | ||
@@ -110,2 +111,3 @@ arrivalCircle: null | ||
server.registerPutHandler('vessels.self', 'navigation.courseGreatCircle.nextPoint.arrivalCircle', handlePutCourseData); | ||
server.registerPutHandler('vessels.self', 'navigation.courseGreatCircle.nextPoint.value.href', handlePutCourseData); | ||
server.registerPutHandler('vessels.self', 'navigation.courseGreatCircle.previousPoint.position', handlePutCourseData); | ||
@@ -157,2 +159,10 @@ // std alarms handler ** | ||
})); | ||
subscriptions.push(// ** handle nextPoint.value.href Update | ||
server.streambundle.getSelfBus('navigation.courseGreatCircle.nextPoint.value.href') | ||
.onValue((v) => { | ||
if (v['$source'] == plugin.id) { | ||
return; | ||
} | ||
setHref(v.value); | ||
})); | ||
subscriptions.push(// ** monitor nextPoint.distance updates | ||
@@ -289,2 +299,3 @@ server.streambundle.getSelfBus('navigation.courseGreatCircle.nextPoint.distance') | ||
navData.nextPoint = { | ||
href: null, | ||
position: null, | ||
@@ -294,2 +305,5 @@ arrivalCircle: null | ||
} | ||
if (!navData.nextPoint.href) { | ||
navData.nextPoint.href = null; | ||
} | ||
if (!navData.nextPoint.position) { | ||
@@ -422,2 +436,12 @@ navData.nextPoint.position = null; | ||
} | ||
if (typeof navData.nextPoint.href !== 'undefined') { | ||
val.push({ | ||
path: 'navigation.courseGreatCircle.nextPoint.value.href', | ||
value: navData.nextPoint.href | ||
}); | ||
val.push({ | ||
path: 'navigation.courseRhumbline.nextPoint.value.href', | ||
value: navData.nextPoint.href | ||
}); | ||
} | ||
if (navData.previousPoint && typeof navData.previousPoint.position !== 'undefined') { | ||
@@ -468,2 +492,5 @@ val.push({ | ||
} | ||
if (p[p.length - 1] == 'href') { | ||
ok = setHref(value); | ||
} | ||
} | ||
@@ -550,2 +577,10 @@ if (p[2] == 'previousPoint') { | ||
}; | ||
const setHref = (value) => { | ||
server.debug(`** setHref ** ${value}`); | ||
if (value !== null && typeof value !== 'string') { | ||
return false; | ||
} | ||
navData.nextPoint.href = value; | ||
return true; | ||
}; | ||
//*** persist / retrieve settings *** | ||
@@ -552,0 +587,0 @@ const getRecord = (db, key) => __awaiter(void 0, void 0, void 0, function* () { |
@@ -29,2 +29,6 @@ # Freeboard-SK-Helper: | ||
./vesels/self/navigation/courseGreatCircle/nextPoint/arrivalCircle | ||
./vesels/self/navigation/courseGreatCircle/nextPoint/value/href | ||
./vesels/self/navigation/course/targetArrivalTime | ||
``` | ||
@@ -41,2 +45,6 @@ | ||
vessels.self.navigation.courseGreatCircle.nextPoint.arrivalCircle | ||
vessels.self.navigation.courseGreatCircle.nextPoint.value.href | ||
vessels.self.navigation.course.targetArrivalTime | ||
``` | ||
@@ -53,2 +61,6 @@ | ||
navigation.courseGreatCircle.nextPoint.arrivalCircle | ||
navigation.courseGreatCircle.nextPoint.value.href | ||
navigation.course.targetArrivalTime | ||
``` | ||
@@ -55,0 +67,0 @@ |
95754
2074
118