diff --git a/pgns/129283.js b/pgns/129283.js index 7a6bd57..b40af40 100644 --- a/pgns/129283.js +++ b/pgns/129283.js @@ -4,9 +4,7 @@ module.exports = [ { node: function (n2k, state) { return ( - 'navigation.course' + - state.lastCourseCalculationType + - '.crossTrackError' + 'navigation.course.calcValues.crossTrackError' ) }, filter: function (n2k, state) { diff --git a/pgns/129284.js b/pgns/129284.js index b73b005..41c2d4b 100644 --- a/pgns/129284.js +++ b/pgns/129284.js @@ -16,9 +16,16 @@ module.exports = [ { node: function (n2k, state) { return ( - 'navigation.course' + - calculationType(n2k, state) + - '.bearingTrack' + + 'navigation.course.calcValues.calcMethod' + + calculationType(n2k, state) + ) + }, + source: 'Calculation Type' + }, + { + node: function (n2k, state) { + return ( + 'navigation.course.calcValues.bearingTrack' + n2k.fields['Course/Bearing reference'] ) }, @@ -27,9 +34,7 @@ module.exports = [ { node: function (n2k, state) { return ( - 'navigation.course' + - calculationType(n2k, state) + - '.nextPoint.distance' + 'navigation.course.calcValues.distance' ) }, source: 'Distance to Waypoint' @@ -37,9 +42,7 @@ module.exports = [ { node: function (n2k, state) { return ( - 'navigation.course' + - calculationType(n2k, state) + - '.nextPoint.velocityMadeGood' + 'navigation.course.calcValues.velocityMadeGood' ) }, source: 'Waypoint Closing Velocity' @@ -47,9 +50,7 @@ module.exports = [ { node: function (n2k, state) { return ( - 'navigation.course' + - calculationType(n2k, state) + - '.nextPoint.bearing' + + 'navigation.course.calcValues.bearing' + n2k.fields['Course/Bearing reference'] ) }, @@ -58,9 +59,7 @@ module.exports = [ { node: function (n2k, state) { return ( - 'navigation.course' + - calculationType(n2k, state) + - '.nextPoint.position' + 'navigation.course.nextPoint.position' ) }, value: function (n2k) { @@ -72,7 +71,7 @@ module.exports = [ }, { node: function (n2k) { - return 'navigation.course' + calculationType(n2k) + '.nextPoint.timeToGo' + return 'navigation.course.calcValues.timeToGo' }, filter: function (n2k) { return n2k.fields['ETA Date'] && n2k.fields['ETA Time'] diff --git a/pgns/129285.js b/pgns/129285.js index 6a0e38d..f6d4f4d 100644 --- a/pgns/129285.js +++ b/pgns/129285.js @@ -3,11 +3,11 @@ const _ = require('lodash') module.exports = [ { - node: 'navigation.currentRoute.name', + node: 'navigation.course.activeRoute.name', source: 'Route Name' }, { - node: 'navigation.currentRoute.waypoints', + node: 'navigation.course.activeRoute.waypoints', filter: n2k => { return !_.isUndefined(n2k.fields.list) }, diff --git a/test/129283_xte.js b/test/129283_xte.js index 75c14c1..6dc742e 100644 --- a/test/129283_xte.js +++ b/test/129283_xte.js @@ -23,7 +23,7 @@ describe('129283 cross track error', function () { ) tree.should.have.nested.property( - 'navigation.courseGreatCircle.crossTrackError.value', + 'navigation.course.calcValues.crossTrackError.value', -5.63 ) tree.should.be.validSignalKVesselIgnoringIdentity @@ -37,7 +37,7 @@ describe('129283 cross track error', function () { {} ) tree.should.not.have.nested.property( - 'navigation.courseGreatCircle.crossTrackError.value' + 'navigation.course.calcValues.crossTrackError.value' ) tree.should.be.validSignalKVesselIgnoringIdentity }) @@ -50,7 +50,7 @@ describe('129283 cross track error', function () { null ) tree.should.not.have.nested.property( - 'navigation.courseGreatCircle.crossTrackError.value' + 'navigation.course.calcValues.crossTrackError.value' ) tree.should.be.validSignalKVesselIgnoringIdentity }) diff --git a/test/129284_navigation_data.js b/test/129284_navigation_data.js index 56b2f31..d0253ca 100644 --- a/test/129284_navigation_data.js +++ b/test/129284_navigation_data.js @@ -12,31 +12,31 @@ describe('129284 Navigation Data', function () { ) var tree = mapper.toNested(msg) tree.should.have.nested.property( - 'navigation.courseGreatCircle.bearingTrackTrue.value', + 'navigation.course.calcValues.bearingTrackTrue.value', 2.6435 ) tree.should.have.nested.property( - 'navigation.courseGreatCircle.nextPoint.velocityMadeGood.value', + 'navigation.course.calcValues.velocityMadeGood.value', 0.06 ) tree.should.have.nested.property( - 'navigation.courseGreatCircle.nextPoint.distance.value', + 'navigation.course.calcValues.distance.value', 1910.38 ) tree.should.have.nested.property( - 'navigation.courseGreatCircle.nextPoint.bearingTrue.value', + 'navigation.course.calcValues.bearingTrue.value', 2.7651 ) tree.should.have.nested.property( - 'navigation.courseGreatCircle.nextPoint.position.value.latitude', + 'navigation.course.nextPoint.position.value.latitude', 60.1366607 ) tree.should.have.nested.property( - 'navigation.courseGreatCircle.nextPoint.position.value.longitude', + 'navigation.course.nextPoint.position.value.longitude', 24.9068518 ) tree.should.have.nested.property( - 'navigation.courseGreatCircle.nextPoint.timeToGo.value', + 'navigation.course.calcValues.timeToGo.value', 31360.412 ) tree.should.be.validSignalKVesselIgnoringIdentity