signalk-polar-performance-plugin 0.0.57 → 0.0.58

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 +76 -33
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "signalk-polar-performance-plugin",
3
- "version": "0.0.57",
3
+ "version": "0.0.58",
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
@@ -243,89 +243,132 @@ module.exports = function (app) {
243
243
  }
244
244
 
245
245
  if (BSP) {
246
- addValue('performance.boatSpeedDamped', BSP, { units: 'm/s' })
246
+ addValue('performance.boatSpeedDamped', BSP, {
247
+ units: 'm/s',
248
+ description: 'Boat speed after applying damping factor (see Polar Performance Plugin settings).'
249
+ })
247
250
  }
248
251
 
249
252
  if (TWA) {
250
253
  addValue('environment.wind.angleTrueWaterDamped', TWA * port, {
251
- units: 'rad'
254
+ units: 'rad',
255
+ description: 'True Wind Angle after applying damping factor, negative to port (see Polar Performance Plugin settings).'
252
256
  })
253
257
  }
254
258
 
255
259
  if (typeof perfObj.beatAngle !== 'undefined') {
256
260
  if (options.beatAngle === true) {
257
- addValue('performance.beatAngle', perfObj.beatAngle * port)
261
+ addValue('performance.beatAngle', perfObj.beatAngle * port, {
262
+ units: 'rad',
263
+ description: 'The optimal beat/upwind angle for current TWS, negative to port.'
264
+ })
258
265
  }
259
266
  if (options.targetTWA === true) {
260
- addValue('performance.targetAngle', perfObj.beatAngle * port)
267
+ addValue('performance.targetAngle', perfObj.beatAngle * port, {
268
+ units: 'rad',
269
+ description: 'The combined and automatic switching optimal beat or run angle for current TWS, negative to port.'
270
+ })
261
271
  }
262
272
  }
263
273
 
264
- if (typeof perfObj.beatVMG !== 'undefined') {
265
- addValue('performance.beatAngleVelocityMadeGood', perfObj.beatVMG)
274
+ if (typeof perfObj.runAngle !== 'undefined') {
275
+ if (options.beatAngle === true) {
276
+ addValue('performance.gybeAngle', perfObj.runAngle * port, {
277
+ units: 'rad',
278
+ description: 'The optimal run/downwind angle for current TWS, negative to port.'
279
+ })
280
+ }
266
281
  if (options.targetTWA === true) {
267
- addValue('performance.targetVelocityMadeGood', perfObj.beatVMG, {
268
- units: 'm/s'
282
+ addValue('performance.targetAngle', perfObj.runAngle * port, {
283
+ units: 'rad',
284
+ description: 'The combined and automatic switching optimal beat or run angle for current TWS, negative to port.'
269
285
  })
270
286
  }
271
287
  }
272
288
 
273
- if (typeof perfObj.runAngle !== 'undefined') {
274
- if (options.beatAngle === true) {
275
- addValue('performance.gybeAngle', perfObj.runAngle * port)
276
- }
289
+ if (typeof perfObj.beatVMG !== 'undefined') {
290
+ addValue('performance.beatAngleVelocityMadeGood', perfObj.beatVMG, {
291
+ units: 'm/s',
292
+ description: 'The beat/upwind Velocity Made Good for current boat speed and heading.'
293
+ })
277
294
  if (options.targetTWA === true) {
278
- addValue('performance.targetAngle', perfObj.runAngle * port)
295
+ addValue('performance.targetVelocityMadeGood', perfObj.beatVMG, {
296
+ units: 'm/s',
297
+ description: 'The combined and automatic switching beat or run Velocity Made Good for current boat speed and heading.'
298
+ })
279
299
  }
280
300
  }
281
301
 
282
302
  if (typeof perfObj.runVMG !== 'undefined') {
283
- addValue('performance.gybeAngleVelocityMadeGood', perfObj.runVMG)
303
+ addValue('performance.gybeAngleVelocityMadeGood', perfObj.runVMG, {
304
+ units: 'm/s',
305
+ description: 'The run/downwind Velocity Made Good for current boat speed and heading.'
306
+ })
284
307
  if (options.targetTWA === true) {
285
308
  addValue('performance.targetVelocityMadeGood', perfObj.runVMG, {
286
- units: 'm/s'
309
+ units: 'm/s',
310
+ description: 'The combined and automatic switching beat or run Velocity Made Good for current TWS and TWA.'
287
311
  })
288
312
  }
289
313
  }
290
314
 
291
315
  if (typeof perfObj.optimumWindAngle !== 'undefined') {
292
316
  addValue('performance.optimumWindAngle', perfObj.optimumWindAngle, {
293
- units: 'rad'
317
+ units: 'rad',
318
+ description: 'The optimum wind angle, negative to port (diff between TWA and environment.wind.directionTrue).'
294
319
  })
295
320
  }
296
321
 
297
322
  if (typeof perfObj.targetSpeed !== 'undefined') {
298
- addValue('performance.targetSpeed', perfObj.targetSpeed)
323
+ addValue('performance.targetSpeed', perfObj.targetSpeed, {
324
+ units: 'm/s',
325
+ description: 'Target boat speed based on current TWA.'
326
+ }
327
+ )
299
328
  }
300
329
 
301
330
  if (typeof perfObj.polarSpeed !== 'undefined') {
302
- addValue('performance.polarSpeed', perfObj.polarSpeed)
303
- addValue('performance.polarSpeedRatio', perfObj.polarSpeedRatio)
331
+ addValue('performance.polarSpeed', perfObj.polarSpeed, {
332
+ units: 'm/s',
333
+ description: 'The polar chart boat speed as per the polar chart for current TWS and TWA.'
334
+ })
335
+ addValue('performance.polarSpeedRatio', perfObj.polarSpeedRatio, {
336
+ units: 'ratio',
337
+ description: 'The ratio between actual boat speed and polar chart boat speed for current TWS and TWA.'
338
+ })
304
339
  if (typeof perfObj.velocityMadeGood !== 'undefined') {
305
- addValue('performance.velocityMadeGood', perfObj.velocityMadeGood)
306
- addValue(
307
- 'performance.polarVelocityMadeGood',
308
- perfObj.polarVelocityMadeGood,
309
- { units: 'm/s' }
310
- )
311
- addValue(
312
- 'performance.polarVelocityMadeGoodRatio',
313
- perfObj.polarVelocityMadeGoodRatio,
314
- { units: 'ratio' }
315
- )
340
+ addValue('performance.velocityMadeGood', perfObj.velocityMadeGood, {
341
+ units: 'm/s',
342
+ description: 'The actual Velocity Made Good based on current heading and boat speed.'
343
+ })
344
+ addValue('performance.polarVelocityMadeGood', perfObj.polarVelocityMadeGood, {
345
+ units: 'm/s',
346
+ description: 'The polar chart Velocity Made Good indicated in the polar for current TWS and TWA.'
347
+ })
348
+ addValue('performance.polarVelocityMadeGoodRatio', perfObj.polarVelocityMadeGoodRatio, {
349
+ units: 'ratio',
350
+ description: 'The ratio between actual Velocity Made Good and polar chart indicated Velocity Made Good for current TWS and TWA.'
351
+ })
316
352
  }
317
353
  }
318
354
 
319
355
  if (typeof perfObj.maxSpeed !== 'undefined') {
320
- addValue('performance.maxSpeed', perfObj.maxSpeed, { units: 'm/s' })
356
+ addValue('performance.maxSpeed', perfObj.maxSpeed, {
357
+ units: 'm/s',
358
+ description: 'Maximum boat speed as per polar chart.'
359
+ })
321
360
  addValue('performance.maxSpeedAngle', perfObj.maxSpeedAngle, {
322
- units: 'rad'
361
+ units: 'rad',
362
+ description: 'The angle to achieve maximum boat speed (not the VMG), based on current TWS, negative to port.'
323
363
  })
324
364
  }
325
365
 
326
366
  if (options.tackTrue === true) {
327
367
  if (typeof perfObj.tackTrue !== 'undefined') {
328
- addValue('performance.tackTrue', perfObj.tackTrue)
368
+ addValue('performance.tackTrue', perfObj.tackTrue, {
369
+ units: 'rad',
370
+ description: 'The Opposite Tack\'s heading relative to True North, based on current TWS.'
371
+ })
329
372
  }
330
373
  }
331
374