signalk-polar-performance-plugin 0.0.34 → 0.0.35

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.34",
3
+ "version": "0.0.35",
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
@@ -164,11 +164,11 @@ module.exports = function (app) {
164
164
  deltas.forEach(delta => {
165
165
  // app.debug('handleData: %s', JSON.stringify(delta))
166
166
  if (delta.path == 'navigation.speedThroughWater') {
167
- STW = applyDamping (delta.value, 'BSP', options.dampingBSP || 0)
167
+ STW = applyDamping (delta.value, 'STW', options.dampingBSP || 0)
168
168
  BSP = STW
169
169
  // app.debug('speedThroughWater (STW): %d', STW)
170
170
  } else if (delta.path == 'navigation.speedOverGround') {
171
- SOG = applyDamping (delta.value, 'BSP', options.dampingBSP || 0)
171
+ SOG = applyDamping (delta.value, 'SOG', options.dampingBSP || 0)
172
172
  BSP = SOG
173
173
  // app.debug('speedThroughWater (STW): %d', STW)
174
174
  } else if (delta.path == 'navigation.headingTrue') {
@@ -409,6 +409,7 @@ module.exports = function (app) {
409
409
  }
410
410
  // Calculate polar performance ratio
411
411
  if (typeof performance.polarSpeed != 'undefined') {
412
+ app.debug('performance.polarSpeedRatio = BSP (%s)/ performance.polarSpeed (%s)', msToKts(BSP).toFixed(2), msToKts(performance.polarSpeed).toFixed(2))
412
413
  performance.polarSpeedRatio = BSP / performance.polarSpeed
413
414
  if (options.VMG == true) {
414
415
  performance.velocityMadeGood = Math.abs(BSP * Math.cos(TWA))