-
Notifications
You must be signed in to change notification settings - Fork 30
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
Support for canboat's '-nv' option #79
Comments
Sounds like a good plan to me.
2017-07-21 20:00 GMT+02:00 Jouni Hartikainen <[email protected]>:
… For some use cases (e.g. signalk-socketcan-device
<https://github.com/chacal/signalk-socketcan-device>) it is useful to run
canboat's analyzer with its -nv option that adds 'raw' values for various
look-up style fields in PGNs in addition to normal human readable ones. Eg.
field "COG Reference":"True" becomes "COG Reference":{"value":0,"name":"
True"}.
This change in input naturally breaks n2k-signalk as it expects its input
in the former form.
I'm planning on adding transparent support for the latter input format for
n2k-signalk, but wanted to create this issue first to discuss the matter
and gather ideas on implementation. The idea at the moment is to change the
implementation for all PGNs that use these 'lookup' style fields in a way
that the input format is detected automatically by first checking if the
value is Object and if it is, using .name instead of the field itself.
The following PGNs use 'lookup' style fields and would thus need to be
changed:
127488
127489
127505
129026
129029
129038
129040
129041
129283
129284
129291
129794
129810
130306
130311
130312
130577
130842
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#79>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABiJesVIr3sxDocm2nzxnfIgOBqWZRMrks5sQOcrgaJpZM4Oftmy>
.
|
I poked around with the code and came up with a solution that - albeit a bit hackily - adds support for the Commit is here: chacal@623cf6a I also thought about how to add test cases for What do you think? If this looks good, I can add tests for the other affected PGNs as well. |
Added a small helper for constructing -nv style input fields for test JSON as I noticed that its quite error prone to write JSON strings by hand: chacal@00b6f05 |
For some use cases (e.g. signalk-socketcan-device) it is useful to run canboat's
analyzer
with its-nv
option that adds 'raw' values for various look-up style fields in PGNs in addition to normal human readable ones. Eg. field"COG Reference":"True"
becomes"COG Reference":{"value":0,"name":"True"}
.This change in input naturally breaks
n2k-signalk
as it expects its input in the former form.I'm planning on adding transparent support for the latter input format for
n2k-signalk
, but wanted to create this issue first to discuss the matter and gather ideas on implementation. The idea at the moment is to change the implementation for all PGNs that use these 'lookup' style fields in a way that the input format is detected automatically by first checking if the value isObject
and if it is, using.name
instead of the field itself.The following PGNs use 'lookup' style fields and would thus need to be changed:
The text was updated successfully, but these errors were encountered: