barnaclebill - If a plugin like signalk-derived...

If a plugin like signalk-derived-data doesn't have all of the source data specified in "derivedFrom", will the calculation not happen? Asking because I modified the trueWind calc to still calculate TWA even if headTrue is null, but still not getting TWA (when SK has no heading but has AWA, AWS, and STW).
10 Replies
Scott Bender
Scott Bender2mo ago
It probably makes sense to split these into two different calcs. One for TWA and another for TWD.
barnaclebill
barnaclebillOP2mo ago
I did it, but it still feels kind of messy...I think TWS will be calculated twice every "cycle". https://github.com/SignalK/signalk-derived-data/pull/156
Scott Bender
Scott Bender2mo ago
So make the TWD calc depend on TWA? So then it’s only calculated once.
barnaclebill
barnaclebillOP2mo ago
Good point...I will try that. I'm already at the limit of my coding ability though :- )
PaddyB
PaddyB2mo ago
Get an Ai to write it for you. Doesn't nail it first time every time. But often does😊 Gemini in VScode seems reliable. Will tell you what does what as well if you ask. Or perplexity.ai. copy n paste the code in from github, seems it can't get in to github
PaddyB
PaddyB2mo ago
barnaclebill
barnaclebillOP2mo ago
I would appreciate it if someone else could try it...code is on Github in the above PR. I am not near my boat, so I used the SK sample data file, but I also extracted all the heading PGNs from the file to test both TWA and TWD.
Scott Bender
Scott Bender2mo ago
I will test it before I merge, hopefully tomorrow morning….
PaddyB
PaddyB2mo ago
"dir = null", line 18, does this do anything?
barnaclebill
barnaclebillOP2mo ago
Nope!

Did you find this page helpful?