Code Monkey home page Code Monkey logo

nmea-seatalk-multiplexer's People

Contributors

arnegue avatar

Watchers

 avatar

nmea-seatalk-multiplexer's Issues

Unify NMEA- and Seatalk-Datagram-Parsing

NMEADatagram (not NMEADevice) have own-class NMEA-Parsing (see parse_nmea_sentence)
SeatalkDevice (not SeatalkDatagram) has a method (parse_datagram).

Same with a map about IDs (SeatalkDevice: _seatalk_datagram_map, NMEADatagram: nmea_tag_datagram_map).
Maybe put that into Device-Base-Class?

Put each seatalk-datagram into an own file

The file seatalk_datagram.py has currently 1533 lines and contains 89 classes. Time to refactor and bring them into an own file each.

  • Put each datagram into own file
  • Create a directory "datagram" in seatalk and put every file there
  • remove redundant "datagram"-suffix

Change data-creation and multiplexing

Currently this program's focus is on NMEA-messages: Receiving NMEA-Messages on one device and forwarding it to another (without parsing whatsoever).
Only Seatalk-Mesages are getting parsed so that they may get put into another NMEA-Message and getting send to a NMEA-device. And then only if there is a one-to-one-datagram on each side. This is done throught inheritance. (Seatalk-datagram derives from nmea-datagram).

But there are some limitations.
E.g:
NMEA's datagram (RMC) needs more than one Seatalk-Datagram for its message: There are two seatalk-datagrams for one position: LatitudePosition (0x50) and LongitudePosition (0x51). One for time, one for date, one for speed....

TODOs and thoughts (will be edited through the whole process)

  • Write a "database" of the current ship "status" (~every datatype there is)
  • Write a publish/subscribe model to these values on the database
  • Add a timestamp (max-age) to the values
  • Fill these data from nmea- and seatalk-datagrams
  • Get rid of inheritance: Seatalk-datagram from NMEA-datagram (and use super() constructor instead)
  • Get rid of inheritance: Seatalk-Exceptions from NMEA-Exceptions
  • In devices, do not subscribe from other devices but rather from specific messages [nmea subscribe specific to nmea-datagrams, seatalk to specific seatalk-datagrams
  • If wanted: subscribe for every other datagram, which is not parsable (Seatalk doesn't have this feature yet)
  • Change SpecialDevices (SetTimeDevice from ShipData, so it doesn't depend on NMEA: Seatalk has a Date/Time object too)
  • Rename get_seatalk_datagram to get_datragram (SeatalkDatagram is a DeviceClass, that function only returns bytearray)

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.