Comments (2)
Taking a quick look at adding a test for Message2 and getting some suspicious results. Couple of surprising things that I see:
* Messages 1, 2, and 3 are the same except for the message id (or effectively they can be represented 100% the same with a tiny bit of larger code side on the message state)
True, but I like keeping them all as separate parse functions for consistency instead of cluttering up a common parser with extra logic.
* `longitude` and `latitude` in message and position are confusing at it seems that are confusing names as they are `signed 1/10000 degree position` and longs
They are the raw 1/10000 positions value with sign. In C there is a pos2ddd function that converts them to decimal lat/long but it looks like I never wrote the equivalent function for Java. It would probably go in the Position class.
* rot, cog, looks like the raw values not the turn rate
Correct, for the most part aisparser just presents the raw values to the user and lets them decide how they want to deal with them.
* Is there a reason not to break out the submessage?
I don't remember anymore :)
But my current philosophy is to change as little as possible while cleaning things up and adding tests. There are quite a few people using this codebase so I'd like to get better tests in place first, do a new release (I tagged my old one from 2015 as v1.0.0 today), then we can start changing the API. This will give people a better update path if they want to take it.
This is also an example of junit4 with test discovery and a touch of cleanup. I did a by hand conversion of tabs to 4 spaces as tabs cause endless tool troubles for me. Would be maybe best to pick a formatter tool and setting and use that?
IIRC I wrote this using Eclipse. These days I use vim with 4 spaces everywhere (except for Go which insists on tabs), so if there is a java tool like go fmt that will reformat things in a nice consistent way feel free to include that.
from aisparser.
12aede5 of pr #21 adds a junit4 based message2 test so closing this. Thanks for commenting on my list of surprises.
from aisparser.
Related Issues (20)
- [Java] Messages without channel code not supported HOT 3
- [C++] C project fail to compile on C++ compiler HOT 1
- Userid should be returned as string, not long HOT 1
- NMEA Data Parsing with ais_text.exe HOT 1
- Build error on OSX 10.9.x HOT 1
- error parsing ais message type 5 HOT 2
- Setup Continuous Integration (CI) HOT 1
- Flush out test coverage for Message 1
- Setup a fuzzer HOT 2
- Setup better code coverage and static analsis
- Java: Test Message 17 - GNSS broadcast
- Java: Test Message 16 - assigned mode command
- Java: Implement message 27 HOT 1
- Type 5 message parsing HOT 4
- AIS TYPE 5 Error HOT 1
- Java parser doesn't check for matching channel when parsing multi-part message
- Add github actions for testing
- Bad variable name
- Any interest in updated Visual Studio project files?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aisparser.