signalk-polar-performance-plugin 0.0.26 → 0.0.27
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/README.md +3 -1
- package/package.json +1 -1
- package/plugin/index.js +8 -2
package/README.md
CHANGED
|
@@ -43,12 +43,14 @@ In the plugin configuration you can toggle the following options:
|
|
|
43
43
|
- Fill up the ends of the polar diagram
|
|
44
44
|
- Visualisation of the polar diagram
|
|
45
45
|
- Configurable damping alorithm on inputs
|
|
46
|
+
- Extrapolation of polar data towards 0
|
|
47
|
+
- Configurable overall performance adjustment ratio
|
|
46
48
|
|
|
47
49
|
### To-do list
|
|
48
50
|
- Improved interpolation
|
|
49
51
|
- Make moment to do calculation smarter/configurable
|
|
50
52
|
- API to see JSON of polar
|
|
51
|
-
- Extrapolation of polar data
|
|
53
|
+
- Extrapolation of polar data towards 50 kts?
|
|
52
54
|
- Create polar from live data
|
|
53
55
|
-- Save polar info to file
|
|
54
56
|
-- Save new record speed for angle in polar
|
package/package.json
CHANGED
package/plugin/index.js
CHANGED
|
@@ -50,6 +50,12 @@ module.exports = function (app) {
|
|
|
50
50
|
type: 'boolean',
|
|
51
51
|
title: 'Enable writing of maximum speed angle and boat speed for a given TWS'
|
|
52
52
|
},
|
|
53
|
+
perfAdjust: {
|
|
54
|
+
type: 'number',
|
|
55
|
+
description: 'This ratio allows you to lower the polar boat speeds in case you are not expecting to meet 100% due to e.g. weight. 1 = 100%, 0.8 = 80% etc',
|
|
56
|
+
title: 'Performance adjustment ratio',
|
|
57
|
+
default: 1
|
|
58
|
+
},
|
|
53
59
|
dampingTWA: {
|
|
54
60
|
type: 'number',
|
|
55
61
|
description: 'If data appears erratic or too sensitive, damping may be applied to amke information appear more stable. With damping set to 0, the data is presented in raw form wih no damping applied.',
|
|
@@ -462,7 +468,7 @@ module.exports = function (app) {
|
|
|
462
468
|
for (let index = 0; index < row.length-1; index++) {
|
|
463
469
|
if (row[index+1] != 0) {
|
|
464
470
|
polar[index][angleName] = angle
|
|
465
|
-
let tbs = ktsToMs(Number(row[index+1]))
|
|
471
|
+
let tbs = ktsToMs(Number(row[index+1])) * (options.perfAdjust || 1)
|
|
466
472
|
let vmg = tbs * Math.abs(Math.cos(angle))
|
|
467
473
|
polar[index][VMGName] = roundDec(vmg)
|
|
468
474
|
if (typeof polar[index]['twa'] == 'undefined') {
|
|
@@ -483,7 +489,7 @@ module.exports = function (app) {
|
|
|
483
489
|
if (typeof polar[index].twa == 'undefined') {
|
|
484
490
|
polar[index].twa = []
|
|
485
491
|
}
|
|
486
|
-
let tbs = ktsToMs(Number(row[index+1]))
|
|
492
|
+
let tbs = ktsToMs(Number(row[index+1])) * (options.perfAdjust || 1)
|
|
487
493
|
let vmg = tbs * Math.abs(Math.cos(angle))
|
|
488
494
|
let Obj = {"twa": angle, "tbs": tbs, "vmg": vmg}
|
|
489
495
|
// app.debug('Adding Obj: %s', JSON.stringify(Obj))
|