Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add Course API (v2) path support #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 30 additions & 13 deletions conversions/navigationdata.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,38 @@

module.exports = (app, plugin) => {

const apiVersion = app.config.version ? parseInt(app.config.version.split('.')[0]) : 1
const pgn129283Keys = apiVersion > 1
? ['navigation.course.calcValues.crossTrackError']
: ['navigation.courseGreatCircle.crossTrackError']

const pgn129284Keys = apiVersion > 1
? [
'navigation.course.calcValues.distance',
'navigation.course.calcValues.bearingTrue',
'navigation.course.calcValues.bearingTrackTrue',
'navigation.course.nextPoint.position',
'navigation.course.calcValues.velocityMadeGood',
'notifications.course.arrivalCircleEntered',
'notifications.course.perpendicularPassed',
'navigation.course.activeRoute.pointIndex'
]
: [
'navigation.courseGreatCircle.nextPoint.distance',
'navigation.courseGreatCircle.bearingToDestinationTrue',
'navigation.courseGreatCircle.bearingOriginToDestinationTrue',
'navigation.courseGreatCircle.nextPoint',
'navigation.courseGreatCircle.nextPoint.velocityMadeGood',
'notifications.arrivalCircleEntered',
'notifications.perpendicularPassed',
'navigation.courseRhumbline.nextPoint.ID'
]

return [{
pgn: 129283,
title: 'Cross Track Error (129283)',
optionKey: 'xte',
keys: [
'navigation.courseRhumbline.crossTrackError'
],
keys: pgn129283Keys,
callback: (XTE) => [{
pgn: 129283,
XTE,
Expand All @@ -17,16 +43,7 @@ module.exports = (app, plugin) => {
pgn: 129284,
title: 'Navigation Data (129284)',
optionKey: 'navigationdata',
keys: [
'navigation.courseRhumbline.nextPoint.distance',
'navigation.courseRhumbline.bearingToDestinationTrue',
'navigation.courseRhumbline.bearingOriginToDestinationTrue',
'navigation.courseRhumbline.nextPoint',
'navigation.courseRhumbline.nextPoint.velocityMadeGood',
'notifications.arrivalCircleEntered',
'notifications.perpendicularPassed',
'navigation.courseRhumbline.nextPoint.ID'
],
keys: pgn129284Keys,
timeouts: [
10000, 10000, 10000, 10000, 10000, undefined, undefined, 10000
],
Expand Down