Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: SignalK/signalk-derived-data
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.28.2
Choose a base ref
...
head repository: SignalK/signalk-derived-data
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Dec 27, 2020

  1. Copy the full SHA
    11c5920 View commit details
  2. chore: replace Travis with GH Actions (#71)

    * chore: add test GH action
    
    * chore: remove Travis
    tkurki authored Dec 27, 2020
    Copy the full SHA
    3a6f56a View commit details
  3. 1.28.3

    sbender9 committed Dec 27, 2020
    Copy the full SHA
    94831c1 View commit details

Commits on Mar 25, 2021

  1. ETA to next waypoint and steer error (#77)

    * Create eta.js
    
    I would like to add 'eta' to next waypoint to derived data.  this file creates:
    'navigation.courseGreatCircle.nextPoint.eta' and delivers a date/time of arrival at the waypoint
    
    please let me know if I need to do anything else to add it?
    
    * Create steer_error.js
    
    this file adds a few phrases for Steer Error, this being the difference between the desired direction and the actual direction.  there are 3 different phrases:
    
    "navigation.courseGreatCircle.nextPoint.steerError" - this gives a value for the error with a positive or negative to suggest the direction
    "navigation.courseGreatCircle.nextPoint.leftSteerError" - this gives a value for the error in the Port direction
    "navigation.courseGreatCircle.nextPoint.rightSteerError" - this gives a value for the error in the Starboard direction
    the right and left steer error are for use to help with clear race displays to help a crew member get clear direction in the heat of a race
    Techstyleuk authored Mar 25, 2021
    Copy the full SHA
    3c82e23 View commit details
  2. feature: add dew point calcs (#78)

    This enables multiple dew points calculated, inside, outside etc.
    joabakk authored Mar 25, 2021
    1
    Copy the full SHA
    c4c65d8 View commit details
  3. feature: Compute navigation.courseGreatCircle.bearingTrackMagnetic an…

    …d navigation.courseGreatCircle.nextPoint.bearingMagnetic (#79)
    sergei authored Mar 25, 2021
    Copy the full SHA
    6700f48 View commit details
  4. fix: Assign wind.angleTrueWater and wind.angleTrueGround identically …

    …to wind.angleApparent in case wind.speedApparent is smaller than 1e-9m/s (#74)
    
    Set wind.angleTrueWater (TWA) and wind.angleTrueGround (GWA) identically to wind.angleApparent (AWA) in case wind.speedApparent (AWS) is smaller than 1e-9m/s. Background: Before for AWS=0 the plugin delivered wrong GWA and TWA since AWS=0 drove the arguments that are used for calculating the angles to zero.
    chris0348 authored Mar 25, 2021
    Copy the full SHA
    4632697 View commit details
  5. 1.29.0

    sbender9 committed Mar 25, 2021
    Copy the full SHA
    99eade3 View commit details

Commits on Apr 20, 2021

  1. Copy the full SHA
    34fe4e7 View commit details

Commits on Sep 9, 2021

  1. Copy the full SHA
    9f1d9b8 View commit details

Commits on Sep 17, 2021

  1. chore: fix test

    tkurki committed Sep 17, 2021
    Copy the full SHA
    f8cee60 View commit details
  2. Added calculation for transducer to keel (based on depth.surfaceToTra…

    …nsducer and design.draft.maximum)
    matztam authored and tkurki committed Sep 17, 2021
    Copy the full SHA
    9b71650 View commit details
  3. fix: guard against 0 revs in propslip (#93)

    Adds also minimal test for this.
    tkurki authored Sep 17, 2021
    Copy the full SHA
    dd5aeb5 View commit details
  4. COG True based on COG Magnetica and Magnetic Variation (#92)

    * Added Course Over Ground True list item
    
    * Added calculation of courseOverGroundTrue from courseOverGroundMagnetic and magneticVariation
    raffmont authored Sep 17, 2021
    Copy the full SHA
    de7fc56 View commit details

Commits on Nov 12, 2021

  1. test single value with range option

    Test using Mocha closeTo w/ delta
    davidsanner authored Nov 12, 2021
    Copy the full SHA
    7b7bf96 View commit details
  2. Handle drift in variation

    Test was failing because of change in variation value (mag north drifting). Check now using expectedRange/closeTo with delta.
    davidsanner authored Nov 12, 2021
    Copy the full SHA
    a876523 View commit details

Commits on Jan 9, 2022

  1. Merge pull request #96 from davidsanner/test-with-range

    Magnetic variation: handle MagVar drifting over time in test
    tkurki authored Jan 9, 2022
    Copy the full SHA
    417d43c View commit details

Commits on Jan 30, 2022

  1. Copy the full SHA
    e33e9b0 View commit details
  2. 1.29.1

    sbender9 committed Jan 30, 2022
    Copy the full SHA
    205de14 View commit details
  3. Copy the full SHA
    64cdf97 View commit details

Commits on Feb 23, 2022

  1. 1.29.2

    sbender9 committed Feb 23, 2022
    Copy the full SHA
    288e68b View commit details

Commits on Feb 24, 2022

  1. Copy the full SHA
    e6ae519 View commit details
  2. Copy the full SHA
    1d13240 View commit details
  3. Remove unnecessary deltas (#98)

    Beat and gybe VMGs are just positive and negative VMGs. They are not in the spec and serve no purpose?
    joabakk authored Feb 24, 2022
    Copy the full SHA
    4500706 View commit details
  4. Copy the full SHA
    28ab4f7 View commit details
  5. 1.30.0

    sbender9 committed Feb 24, 2022
    Copy the full SHA
    7c65e75 View commit details

Commits on Feb 25, 2022

  1. Copy the full SHA
    db24b65 View commit details

Commits on Mar 18, 2022

  1. Copy the full SHA
    edfb86b View commit details
  2. Copy the full SHA
    9e8dd56 View commit details
  3. chore: add publish action

    tkurki committed Mar 18, 2022
    Copy the full SHA
    5559d47 View commit details
  4. 1.31.0

    tkurki committed Mar 18, 2022
    Copy the full SHA
    1de503a View commit details

Commits on Jul 22, 2023

  1. Copy the full SHA
    9c820f4 View commit details
  2. doc: remove greenkeeper badge

    tkurki authored Jul 22, 2023
    Copy the full SHA
    ec806ac View commit details

Commits on Jan 4, 2024

  1. VMG using wind and speedThroughWater (#128)

    * VMG using wind and speedThroughWater
    * remove unused conditional statement
    davidsanner authored Jan 4, 2024
    Copy the full SHA
    90eabdb View commit details
  2. fix: pass null through true/mag conversions (#121)

    Input value null should result in null output values.
    
    Fixes #120.
    tkurki authored Jan 4, 2024
    Copy the full SHA
    1585fdc View commit details
  3. Update eta.js - Time to go added and null value corrected (#127)

    in this PR:
    
    1.  'navigation.courseGreatCircle.nextPoint.timeToGo' added
           a.  this is in Seconds per the spec.
           b.  the null value set to null vs "--"
    2.  eta null value set to null vs "--"
    Techstyleuk authored Jan 4, 2024
    Copy the full SHA
    5110d32 View commit details
  4. style: prettier

    tkurki committed Jan 4, 2024
    Copy the full SHA
    f4ae6c4 View commit details
  5. 1.32.0

    tkurki committed Jan 4, 2024
    Copy the full SHA
    99eebee View commit details
  6. Copy the full SHA
    47144c4 View commit details
  7. Copy the full SHA
    6b2ba66 View commit details
  8. 1.32.1

    tkurki committed Jan 4, 2024
    Copy the full SHA
    8a90bb9 View commit details

Commits on Mar 2, 2024

  1. Fix issue where the roll is using the wrong path (#129)

    Fix issue where calculated leeway is invalid if STW is 0
    rogerlittin authored Mar 2, 2024
    Copy the full SHA
    7c2b125 View commit details
  2. 1.32.2

    tkurki committed Mar 2, 2024
    Copy the full SHA
    89d148d View commit details

Commits on Apr 19, 2024

  1. Copy the full SHA
    9c129d3 View commit details
  2. 1.33.0

    tkurki committed Apr 19, 2024
    Copy the full SHA
    7fdb36c View commit details

Commits on Jul 12, 2024

  1. Copy the full SHA
    85762e8 View commit details
  2. estimatedTimeOfArrival, timeToGo and eta are calculated incorrectly i…

    …n eta.js - Issue #133 (#134)
    
    the calculation uses:
    distance / (velocityMadeGood * 0.514444) * 1000
    
    this assumes that VMG is in kts when it is (and should be) in m/s.
    
    The 0.514444 should be removed from the calc on line 22
    Techstyleuk authored Jul 12, 2024
    Copy the full SHA
    f49d09f View commit details
  3. Copy the full SHA
    01317ae View commit details
  4. Copy the full SHA
    680efd2 View commit details
  5. 1.34.0

    tkurki committed Jul 12, 2024
    Copy the full SHA
    dbe9cfd View commit details
16 changes: 16 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Publish to npm
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
27 changes: 27 additions & 0 deletions .github/workflows/release_on_tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: 'Release on tag'
on:
push:
tags:
- '*'

jobs:
release:
permissions:
contents: write
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Build Changelog
id: github_release
uses: mikepenz/release-changelog-builder-action@v1
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_PAT }}

- name: Create Release
uses: actions/create-release@v1
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body: ${{steps.github_release.outputs.changelog}}
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_PAT }}
13 changes: 13 additions & 0 deletions .github/workflows/require_pr_label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Pull Request Labels
on:
pull_request:
types: [opened, labeled, unlabeled, synchronize]
jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: mheap/github-action-required-labels@v1
with:
mode: exactly
count: 1
labels: "fix, feature, doc, chore, test, ignore, other, dependencies"
23 changes: 23 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: CI test

on: [push]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 16.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test
env:
CI: true
4 changes: 0 additions & 4 deletions .travis.yml

This file was deleted.

7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# signalk-derived-data

[![Greenkeeper badge](https://badges.greenkeeper.io/sbender9/signalk-derived-data.svg)](https://greenkeeper.io/)


Generates deltas for values derived from signalk values

@@ -20,16 +18,19 @@ It currently calculates:
* Tank Volume (based on currentLevel (requires calibration pairs (>2 for parallell sides, >3 for straight wedge and >4 for more complex shapes))
* Velocity Made Good to Course (based on courseGreatCircle.nextPoint.bearingTrue heading true and speedOverGround)
* Velocity Made Good to wind (based on wind.directionTrue and speedOverGround)
* Set and Drift (based on headingMagnetic, courseOverGroundTrue, speedThroughWater, speedOverGround, magneticVariation)
* Outside air wind chill (based on wind speed and temperature)
* True Wind Angle, Direction and Speed (based on speed through water, AWA and AWS)
* True Wind Direction (based on AWA and headingTrue)
* Ground Wind Angle and Speed (based on SOG, AWA and AWS)
* Magnetic Wind Direction (based on AWA and headingMagnetic)
* Magnetic Wind Direction (based on wind.directionTrue and magneticVarition)
* Magnetic Wind Direction (based on wind.directionTrue and magneticVariation)
* Wind Shift (experimental)
* Moon illumination and times (based on time and navigation.position)
* Sunlight Times: sunrise, sunriseEnd, goldenHourEnd, solarNoon, goldenHour, sunsetStart, sunset, dusk, nauticalDusk, night, nadir, nightEnd, nauticalDawn, dawn (based on time and navigation.position)
* Outside Heat Index (based on temperature and humidity)
* True Course Over Goround (based on courseOverGroundMagnetic and magneticVariation)
* Magnetic Course Over Ground (based on courseOverGroundTrue and magneticVariation)

To add new calculations, just create a new file under the `./calcs` directory.

2 changes: 1 addition & 1 deletion calcs/airDensity.js
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ module.exports = function (app, plugin) {
return {
group: 'air',
optionKey: 'Air density',
title: 'Outside air density (based on humidity, temperature and pressure)',
title: 'Outside air density',
derivedFrom: [
'environment.outside.temperature',
'environment.outside.humidity',
33 changes: 26 additions & 7 deletions calcs/courseData.js
Original file line number Diff line number Diff line change
@@ -5,21 +5,23 @@ module.exports = function (app) {
return {
group: 'course data',
optionKey: 'dtg',
title:
'Course DTG, XTE, BRG, etc (based on courseGreatCircle.nextPoint / previousPoint)',
title: 'Course DTG, XTE, BRG, etc',
derivedFrom: [
'navigation.courseGreatCircle.nextPoint.position',
'navigation.courseGreatCircle.previousPoint.position',
'navigation.position'
'navigation.position',
'navigation.magneticVariation'
],
calculator: function (
nextPointPosition,
previousPointPosition,
vesselPosition
vesselPosition,
magneticVariation
) {
let pos = vesselPosition
? new LatLon(vesselPosition.latitude, vesselPosition.longitude)
: null
let pos =
vesselPosition && vesselPosition.latitude && vesselPosition.longitude
? new LatLon(vesselPosition.latitude, vesselPosition.longitude)
: null

let pathStart = previousPointPosition
? new LatLon(
@@ -44,12 +46,21 @@ module.exports = function (app) {
? null
: pathStart.initialBearingTo(pathEnd)

// Same as above, but magnetic
let trkBearingMagnetic =
!trkBearingTrue || !magneticVariation
? null
: trkBearingTrue - magneticVariation

// ** Distance from vessel to nextPoint **
let dtg = !pos || !pathEnd ? null : pos.distanceTo(pathEnd)

// The bearing of a line between the vessel's current position and nextPoint, relative to true north
let brg = !pos || !pathEnd ? null : pos.initialBearingTo(pathEnd)

// Same as above, but magnetic
let brgMag = !brg || !magneticVariation ? null : brg - magneticVariation

// ** Distance from vessel to previousPoint **
let dtp = !pos || !pathStart ? null : pathStart.distanceTo(pos)

@@ -62,6 +73,10 @@ module.exports = function (app) {
path: 'navigation.courseGreatCircle.bearingTrackTrue',
value: trkBearingTrue
},
{
path: 'navigation.courseGreatCircle.bearingTrackMagnetic',
value: trkBearingMagnetic
},
{
path: 'navigation.courseGreatCircle.nextPoint.distance',
value: dtg
@@ -70,6 +85,10 @@ module.exports = function (app) {
path: 'navigation.courseGreatCircle.nextPoint.bearingTrue',
value: brg
},
{
path: 'navigation.courseGreatCircle.nextPoint.bearingMagnetic',
value: brgMag
},
{
path: 'navigation.courseGreatCircle.previousPoint.distance',
value: dtp
55 changes: 55 additions & 0 deletions calcs/courseOverGroundMagnetic.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
const _ = require('lodash')

module.exports = function (app, plugin) {
return {
group: 'course data',
optionKey: 'cog_magnetic',
title: 'Magnetic Course Over Ground',
derivedFrom: [
'navigation.courseOverGroundTrue',
'navigation.magneticVariation'
],
defaults: [undefined, 9999],
calculator: function (courseOverGroundTrue, magneticVariation) {
if (magneticVariation === 9999) {
magneticVariation = app.getSelfPath(
'navigation.magneticVariation.value'
)
}
if (_.isUndefined(magneticVariation) || magneticVariation === null) {
return
}
if (
_.isUndefined(courseOverGroundTrue) ||
courseOverGroundTrue === null
) {
return [{ path: 'navigation.courseOverGroundMagnetic', value: null }]
}
var courseOverGroundMagnetic = courseOverGroundTrue - magneticVariation
if (courseOverGroundMagnetic < 0) {
courseOverGroundMagnetic = Math.PI * 2 + courseOverGroundMagnetic
} else if (courseOverGroundMagnetic > Math.PI * 2) {
courseOverGroundMagnetic = courseOverGroundMagnetic - Math.PI * 2
}
return [
{
path: 'navigation.courseOverGroundMagnetic',
value: courseOverGroundMagnetic
}
]
},
tests: [
{
input: [1.0, 0.1],
expected: [{ path: 'navigation.courseOverGroundMagnetic', value: 0.9 }]
},
{
input: [null, -0.01],
expected: [{ path: 'navigation.courseOverGroundMagnetic', value: null }]
},
{
input: [0.2, null]
}
]
}
}
48 changes: 48 additions & 0 deletions calcs/courseOverGroundTrue.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
const _ = require('lodash')

module.exports = function (app, plugin) {
return {
group: 'heading',
optionKey: 'cog_true',
title: 'True Course Over Ground',
derivedFrom: [
'navigation.courseOverGroundMagnetic',
'navigation.magneticVariation'
],
defaults: [undefined, 9999],
calculator: function (courseOverGroundMagnetic, magneticVariation) {
if (magneticVariation === 9999) {
magneticVariation = app.getSelfPath(
'navigation.magneticVariation.value'
)
}
if (_.isUndefined(magneticVariation) || magneticVariation === null) {
return
}
if (
_.isUndefined(courseOverGroundMagnetic) ||
courseOverGroundMagnetic === null
) {
return [{ path: 'navigation.courseOverGroundTrue', value: null }]
}
var courseOverGroundTrue = courseOverGroundMagnetic + magneticVariation
if (courseOverGroundTrue < 0) {
courseOverGroundTrue = Math.PI * 2 + courseOverGroundTrue
} else if (courseOverGroundTrue > Math.PI * 2) {
courseOverGroundTrue = courseOverGroundTrue - Math.PI * 2
}
return [
{ path: 'navigation.courseOverGroundTrue', value: courseOverGroundTrue }
]
},
tests: [
{
input: [null, 0.01],
expected: [{ path: 'navigation.courseOverGroundTrue', value: null }]
},
{
input: [0.2, null]
}
]
}
}
Loading