signalk-polar-performance-plugin 0.0.28 → 0.0.30

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/plugin/index.js +3 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "signalk-polar-performance-plugin",
3
- "version": "0.0.28",
3
+ "version": "0.0.30",
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
@@ -299,6 +299,7 @@ module.exports = function (app) {
299
299
  let VMGLower = polar[indexTWS]['Beat VMG']
300
300
  let VMGUpper = polar[indexTWS+1]['Beat VMG']
301
301
  performance.beatVMG = VMGLower + ((VMGUpper - VMGLower) * twsGapRatio)
302
+ performance.targetVMG = performance.beatVMG
302
303
  }
303
304
  } else {
304
305
  // app.debug('Downwind')
@@ -322,6 +323,7 @@ module.exports = function (app) {
322
323
  let VMGUpper = polar[indexTWS+1]['Run VMG']
323
324
  //app.debug('VMGLower: %s VMGUpper: %s', VMGLower, VMGUpper)
324
325
  performance.runVMG = VMGLower + ((VMGUpper - VMGLower) * twsGapRatio)
326
+ performance.targetVMG = performance.runVMG
325
327
  }
326
328
  }
327
329
  // Calculate opposite Tack True
@@ -408,7 +410,7 @@ module.exports = function (app) {
408
410
  performance.polarSpeedRatio = BSP / performance.polarSpeed
409
411
  if (options.VMG == true) {
410
412
  performance.velocityMadeGood = Math.abs(BSP * Math.cos(TWA))
411
- performance.polarVelocityMadeGood = Math.abs(performance.targetVelocityMadeGood * Math.cos(targetTWA))
413
+ performance.polarVelocityMadeGood = performance.targetVMG
412
414
  performance.polarVelocityMadeGoodRatio = performance.velocityMadeGood / performance.polarVelocityMadeGood
413
415
  }
414
416
  } else {