Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: add MTA, MWD and VWT sentences #179

Merged
merged 13 commits into from
Oct 24, 2020
Merged

Conversation

pbfulmar
Copy link
Contributor

Hi,
integrated a NKE instrument system with SignalK.
Added the following sentences (all sent by the NKE Multigraphic) to the NMEA parser:

  • MTA, mean temperature of air
  • MWD, wind speed and direction
  • VWT, true wind angle and speed

Thanks for all your great work with SignalK!

@tkurki tkurki changed the title added sentences: MTA MWD VWT feature: add MTA, MWD and VWT sentences Oct 12, 2020
Copy link
Member

@tkurki tkurki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the pr - looks pretty good, some minor review comments.

hooks/MTA.js Show resolved Hide resolved
test/MWD.js Outdated Show resolved Hide resolved
test/MWD.js Outdated Show resolved Hide resolved
test/VWT.js Outdated Show resolved Hide resolved
hooks/MWD.js Outdated Show resolved Hide resolved
Hans-Peter Bergander added 6 commits October 13, 2020 11:00
…n MWD sentence

- returns true/magnetic direction whichever is present
- returns speed given in m/s if both kn and m/s are present
- tests for correct pathes by position
- returns value given in m/s if present, kn and km/h as fallback
- tests for calculation of angles, missing data, improper designators
@pbfulmar
Copy link
Contributor Author

Thank you for your kind reply and the detailed and helpful review!
I simply started with copy-paste of some existing modules since I couldn't tell which checks are eventually already done somewhere else, maybe by the parser.

The new commits include:

  • checks for the units/designator fields in the MTA, MWD and VWT sentences
  • converted values (from knots or km/h) are only used, when no value in m/s is present in any of the three sentences
  • tests for the pathes are changed to positional references and a set of more systematic tests

This is my very first pr in github :-) should I click on the "resolve conversation" buttons or are you going to do that?
Viele Grüße
Peter

@pbfulmar pbfulmar requested a review from tkurki October 13, 2020 16:38
@tkurki
Copy link
Member

tkurki commented Oct 13, 2020

And a fine one it is!

I have absolutely no idea if the fields can be in different order, but when not knowing exactly maybe the extra tests are in order.

If you want to tweak this to perfection in the ideal world this would be three separate commits, that each add one sentence, but I can merge it like it is and just squash all the commits to one. I don't want to see the whole story, just the end results in master's commit history.

@pbfulmar
Copy link
Contributor Author

Thank you!
And I will remember to keep any future pr as small as possible :-)

Regarding the order of the fields: at least for MWD it must be fixed because 'M' is used for both 'magnetic' as well as for 'm/s'. In different order it would be ambiguous. Better don't trust any input data - so I think the extra tests are definitely in order.

Anything else you'd like me to do?

@tkurki tkurki merged commit 31412f6 into SignalK:master Oct 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants