signalk-polar-performance-plugin 0.0.52 → 0.0.54
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 +1 -1
- package/plugin/index.js +11 -9
package/package.json
CHANGED
package/plugin/index.js
CHANGED
|
@@ -19,10 +19,10 @@ module.exports = function (app) {
|
|
|
19
19
|
var schema = {
|
|
20
20
|
// The plugin schema
|
|
21
21
|
properties: {
|
|
22
|
-
|
|
22
|
+
useTWSsource: {
|
|
23
23
|
type: 'string',
|
|
24
|
-
default: '
|
|
25
|
-
title: '
|
|
24
|
+
default: '',
|
|
25
|
+
title: 'Source (name.id) to filter TWS on'
|
|
26
26
|
},
|
|
27
27
|
beatAngle: {
|
|
28
28
|
type: 'boolean',
|
|
@@ -139,7 +139,7 @@ module.exports = function (app) {
|
|
|
139
139
|
minPeriod: 500
|
|
140
140
|
},
|
|
141
141
|
{
|
|
142
|
-
path:
|
|
142
|
+
path: 'environment.wind.speedTrue',
|
|
143
143
|
policy: 'instant',
|
|
144
144
|
minPeriod: 500
|
|
145
145
|
},
|
|
@@ -205,11 +205,13 @@ module.exports = function (app) {
|
|
|
205
205
|
} else if (delta.path == 'navigation.headingTrue') {
|
|
206
206
|
HDG = delta.value
|
|
207
207
|
// app.debug('heading (HDG): %d', HDG)
|
|
208
|
-
} else if (delta.path ==
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
208
|
+
} else if (delta.path == 'environment.wind.speedTrue') {
|
|
209
|
+
if (options.useTWSsource == '' || source == options.useTWSsource) {
|
|
210
|
+
TWS = applyDamping(delta.value, 'TWS', options.dampingTWS || 0)
|
|
211
|
+
// app.debug('(TWS): %d applyDamping: %d', delta.value, TWS)
|
|
212
|
+
// app.debug('TWS: %d TWA: %d BSP: %d', msToKts(TWS), radToDeg(TWA)*port, msToKts(BSP))
|
|
213
|
+
sendUpdates(getPerformanceData(TWS, TWA, BSP))
|
|
214
|
+
}
|
|
213
215
|
} else if (delta.path == 'environment.wind.angleTrueWater') {
|
|
214
216
|
let TWAtmp = applyDamping(delta.value, 'TWA', options.dampingTWA || 0)
|
|
215
217
|
if (TWAtmp < 0) {
|