M0r13n / pyais

AIS message decoding and encoding in Python (AIVDM/AIVDO)
MIT License
176 stars 61 forks source link

Navigational statuses 9, 10, 13 and Ship type 29 #123

Closed garserker closed 11 months ago

garserker commented 11 months ago

Hello!

Could you please add navigational statuses 9, 10 and 13 to the NavigationStatus enum? Yes, they have "reserved for future..." names, but nevertheless it would be useful to be able to generate messages with these statuses at least for test purposes, to check the behavior of the application.

Also сould you please add the ship type 29 (WIG, no additional information) to the ShipType enum? According to the documents (ITU-R M.1371-5), 20x codes should have the same logic as for 40x, 60x, 70x, 80x and 90x codes.

Thanks.

M0r13n commented 11 months ago

Hey @garserker,

I understand your motivation regarding the NavigationStatus enum. Because their names must not be equal, I am thinking about the following improved enum:

class NavigationStatus(IntEnum):
    UnderWayUsingEngine = 0
    AtAnchor = 1
    NotUnderCommand = 2
    RestrictedManoeuverability = 3
    ConstrainedByHerDraught = 4
    Moored = 5
    Aground = 6
    EngagedInFishing = 7
    UnderWaySailing = 8
    ReservedFutureAmendmentHSC = 9
    ReservedFutureAmendmentWIG = 10
    PowerDrivenVesselTowingAstern = 11
    PowerDrivenVesselPushingAhead = 12
    ReservedFutureUse = 13
    AISSARTActive = 14
    Undefined = 15

This should fit your needs, right?

garserker commented 11 months ago

Yes, I'm absolutely fine with that, thank you.

M0r13n commented 11 months ago

@garserker The changes are in version 2.5.8