signalk-polar-performance-plugin 0.0.52 → 0.0.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "signalk-polar-performance-plugin",
3
- "version": "0.0.52",
3
+ "version": "0.0.53",
4
4
  "description": "A plugin that calculates performance information based on a (CSV) polar diagram.",
5
5
  "main": "plugin/index.js",
6
6
  "scripts": {
package/plugin/index.js CHANGED
@@ -22,7 +22,12 @@ module.exports = function (app) {
22
22
  trueWindSpeedPath: {
23
23
  type: 'string',
24
24
  default: 'environment.wind.speedTrue',
25
- title: 'Wind speed path to use'
25
+ title: 'Wind speed path (TWS) to use'
26
+ },
27
+ useTWSsource: {
28
+ type: 'string',
29
+ default: '',
30
+ title: 'Source (name.id) to filter TWS on'
26
31
  },
27
32
  beatAngle: {
28
33
  type: 'boolean',
@@ -206,10 +211,12 @@ module.exports = function (app) {
206
211
  HDG = delta.value
207
212
  // app.debug('heading (HDG): %d', HDG)
208
213
  } else if (delta.path == trueWindSpeedPath) {
209
- TWS = applyDamping(delta.value, 'TWS', options.dampingTWS || 0)
210
- // app.debug('%s (TWS): %d applyDamping: %d', trueWindSpeedPath, delta.value, TWS)
211
- // app.debug('TWS: %d TWA: %d BSP: %d', msToKts(TWS), radToDeg(TWA)*port, msToKts(BSP))
212
- sendUpdates(getPerformanceData(TWS, TWA, BSP))
214
+ if (options.useTWSsource == '' || source == options.useTWSsource) {
215
+ TWS = applyDamping(delta.value, 'TWS', options.dampingTWS || 0)
216
+ // app.debug('%s (TWS): %d applyDamping: %d', trueWindSpeedPath, delta.value, TWS)
217
+ // app.debug('TWS: %d TWA: %d BSP: %d', msToKts(TWS), radToDeg(TWA)*port, msToKts(BSP))
218
+ sendUpdates(getPerformanceData(TWS, TWA, BSP))
219
+ }
213
220
  } else if (delta.path == 'environment.wind.angleTrueWater') {
214
221
  let TWAtmp = applyDamping(delta.value, 'TWA', options.dampingTWA || 0)
215
222
  if (TWAtmp < 0) {