2022-04-15, 04:18 PM
Something like this?
But this code fails to start Derived data plugin so there is some error in there:
But this code fails to start Derived data plugin so there is some error in there:
Code:
module.exports = function (app, plugin) {
return [
{
group: 'wind',
optionKey: 'directionTrueDeg',
title: 'Stationary True Wind Direction in Degrees (based on AWA)',
derivedFrom: ['environment.wind.angleApparent'],
calculator: function (awa) {
if (awa < 0) {
let windHeadingDeg = awa * (180 / Math.PI) + 360
} else if (awa > 0) {
let windHeadingDeg = awa * (180 / Math.PI)
}
}
return [{ path: 'environment.wind.directionTrueDeg', value: windHeadingDeg }]
}
]
}