Skip to content

Commit

Permalink
Fix nextPoint Path (#99)
Browse files Browse the repository at this point in the history
Fix Path to the nextPoint Lat/Lon to comply with the other nmea0183 and n2k converters of signalk
  • Loading branch information
jojoa authored Jan 1, 2025
1 parent e30f88d commit 57c2e80
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions conversions/navigationdata.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module.exports = (app, plugin) => {
'navigation.courseRhumbline.nextPoint.distance',
'navigation.courseRhumbline.bearingToDestinationTrue',
'navigation.courseRhumbline.bearingOriginToDestinationTrue',
'navigation.courseRhumbline.nextPoint',
'navigation.courseRhumbline.nextPoint.position',
'navigation.courseRhumbline.nextPoint.velocityMadeGood',
'notifications.arrivalCircleEntered',
'notifications.perpendicularPassed',
Expand All @@ -43,7 +43,7 @@ module.exports = (app, plugin) => {
timeouts: [
10000, 10000, 10000, 10000, 10000, undefined, undefined, 10000
],
callback: (distToDest, bearingToDest, bearingOriginToDest, dest, WCV, ace, pp, wpid) => {
callback: (distToDest, bearingToDest, bearingOriginToDest, destPos, WCV, ace, pp, wpid) => {
var dateObj = new Date();
var secondsToGo = Math.trunc(distToDest / WCV);
var etaDate = Math.trunc((dateObj.getTime() / 1000 + secondsToGo) / 86400);
Expand All @@ -66,8 +66,8 @@ module.exports = (app, plugin) => {
"Bearing, Position to Destination Waypoint" : bearingToDest,
"Origin Waypoint Number" : undefined,
"Destination Waypoint Number" : parseInt(wpid),
"Destination Latitude" : dest.latitude,
"Destination Longitude" : dest.longitude,
"Destination Latitude" : destPos.latitude,
"Destination Longitude" : destPos.longitude,
"Waypoint Closing Velocity" : WCV,
}]
},
Expand Down

0 comments on commit 57c2e80

Please sign in to comment.