diff --git a/calcs/eta.js b/calcs/eta.js index 195a493..dcee4e6 100644 --- a/calcs/eta.js +++ b/calcs/eta.js @@ -17,32 +17,37 @@ module.exports = function (app) { date = new Date() } - var datems = date.getTime() - var timetopoint = Math.floor(distance / (velocityMadeGood * 0.514444) * 1000) + var datems = date.getTime() + var timetopoint = Math.floor( + distance / (velocityMadeGood * 0.514444) * 1000 + ) - // app.debug(`Using datetime: ${date} ms to point : ${timetopoint} currentms: ${datems}`) - var etams = datems + timetopoint - // app.debug(`eta in ms: ${etams} ms to point : ${timetopoint} currentms: ${datems}`) + // app.debug(`Using datetime: ${date} ms to point : ${timetopoint} currentms: ${datems}`) + var etams = datems + timetopoint + // app.debug(`eta in ms: ${etams} ms to point : ${timetopoint} currentms: ${datems}`) if (velocityMadeGood > 0) { var etad = new Date(parseInt(etams)) var eta = etad.toISOString() - var ttg = Math.floor((timetopoint / 1000)); + var ttg = Math.floor(timetopoint / 1000) } else { var eta = null var ttg = null } - // app.debug(`what is eta: ${eta} etams: ${etams} etad: ${etad}`) + // app.debug(`what is eta: ${eta} etams: ${etams} etad: ${etad}`) return [ { - path: 'navigation.courseGreatCircle.nextPoint.estimatedTimeOfArrival', value: eta + path: 'navigation.courseGreatCircle.nextPoint.estimatedTimeOfArrival', + value: eta }, { - path: 'navigation.courseGreatCircle.nextPoint.timeToGo', value: ttg + path: 'navigation.courseGreatCircle.nextPoint.timeToGo', + value: ttg }, - { - path: 'navigation.courseGreatCircle.nextPoint.eta', value: eta + { + path: 'navigation.courseGreatCircle.nextPoint.eta', + value: eta } ] } diff --git a/calcs/vmg_wind_stw.js b/calcs/vmg_wind_stw.js index 3dfdf6e..f67a324 100644 --- a/calcs/vmg_wind_stw.js +++ b/calcs/vmg_wind_stw.js @@ -9,7 +9,12 @@ module.exports = function (app) { 'navigation.speedThroughWater' ], calculator: function (angleTrueWater, speedThroughWater) { - return [ { path: 'performance.velocityMadeGood', value: Math.cos(angleTrueWater) * speedThroughWater } ] + return [ + { + path: 'performance.velocityMadeGood', + value: Math.cos(angleTrueWater) * speedThroughWater + } + ] } } }