Code Monkey home page Code Monkey logo

Comments (2)

bcl avatar bcl commented on June 27, 2024 1

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.

schwehr avatar schwehr commented on June 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.