AMSP-04 / NETN-AIS

NATO Education and Training Network (NETN) Automatic Identification System (AIS) Module
Other
3 stars 0 forks source link

Change ShipTypeType to VesselTypeEnum8 #30

Closed bergtwvd closed 10 months ago

bergtwvd commented 10 months ago

At the moment ShipTypeType is defined as an octet; however the set of values is a known enumeration in the ITU standard.

Below the Java representation, which need to be turned into a FOM enumeration datatype.

/**
 * ITU-R M.1371-5 (02/2014) Vessel Types.
 *
 * @author Tom van den Berg (TNO, The Netherlands)
 */
public enum VesselTypeEnum {
    NOT_AVAILABLE_OR_NO_SHIP(0),

    // [2x] Wing in Ground Category
    WIG(20), // WIG, Wing-in-Ground craft
    WIG_X(21), // WIG carrying DG, HS, or MP, IMO hazard or pollutant category X
    WIG_Y(22), // WIG carrying DG, HS, or MP, IMO hazard or pollutant category Y
    WIG_Z(23), // WIG carrying DG, HS, or MP, IMO hazard or pollutant category Z
    WIG_OS(24), // WIG carrying DG, HS, or MP, IMO hazard or pollutant category OS
    WIG_NO_ADD_INFO(29), // WIG, no additional information

    // [3x] Vessel Category
    FISHING_VESSEL(30), // should include fish processors and fish tenders
    TOWING1_VESSEL(31), // towing ahead or alongside, but, not astern
    TOWING2_VESSEL(32), // towing and length of the tow exceeds 200 m or breadth exceeds 25 m
    DREDGING_OR_UNDERWATER_OPS_VESSEL(33), // Engaged in dredging or underwater operations
    DIVING_OPS_VESSEL(34), // engaged in diving operations
    MILITARY_OPS_VESSEL(35), // engaged in military operations or other types of restricted operations
    SAILING_VESSEL(36), // sailing vessels
    PLEASURE_CRAFT_VESSEL(37), // pleasure craft

    // [4x] High-Speed Craft Category
    HSC(40), // high speed craft or passenger ferries
    HSC_X(41), // HSC carrying DG, HS, or MP, IMO hazard or pollutant category X
    HSC_Y(42), // HSC carrying DG, HS, or MP, IMO hazard or pollutant category Y
    HSC_Z(43), // HSC carrying DG, HS, or MP, IMO hazard or pollutant category Z
    HSC_OS(44), // HSC carrying DG, HS, or MP, IMO hazard or pollutant category OS
    HSC_NO_ADD_INFO(49), // HSC, no additional information

    // [5x] Special Craft Category
    PILOT_VESSEL(50), // pilot vessel
    SAR_VESSEL(51), // search and rescue vessels, i.e. USCG boats, USCG Auxiliary boats, assistance towers, first responders, standby vessels
    TUG(52), // tugs, light boats, fleet boats, or similar workboats
    PORT_TENDER(53), // port tenders, yacht tenders, dive tenders, attending and off-shore supply vessels, or similar support craft; but, not fish tenders
    ANTI_POLUTION_VESSEL(54), // vessels with anti-pollution facilities or equipment
    LAW_ENFORCEMENT_VESSEL(55), // law enforcement vessels, i.e. U.S. Customs and Border Protection vessels, Department of Natural Resources Conservation boats, marine ice boats, etc
    MEDICAL_TRANSPORT_VESSEL(58), // medical transports (as defined in the 1949 Geneva Convention and Additional Protocols) or similar public safety vessel
    SPECIAL_CRAFT(59), // Special craft, e.g. fire fighting

    // [6x] Passenger Category
    PASSENGER_SHIP(60), // Passenger ships other than HSC and passenger ferries
    PASSENGER_SHIP_X(61), // Passenger ships carrying DG, HS, or MP, IMO hazard or pollutant category X
    PASSENGER_SHIP_Y(62), // Passenger ships carrying DG, HS, or MP, IMO hazard or pollutant category Y
    PASSENGER_SHIP_Z(63), // Passenger ships carrying DG, HS, or MP, IMO hazard or pollutant category Z
    PASSENGER_SHIP_OS(64), // Passenger ships carrying DG, HS, or MP, IMO hazard or pollutant category OS
    PASSENGER_SHIP_NO_ADD_INFO(69), // Passenger ships other than HSC and passenger ferries, no additional information

    // [7x] Cargo Category
    CARGO_SHIP(70), // Cargo (freight) ships or integrated tug barge (ITB) vessels
    CARGO_SHIP_X(71), // Cargo (freight) ships carrying DG, HS, or MP, IMO hazard or pollutant category X
    CARGO_SHIP_Y(72), // Cargo (freight) ships carrying DG, HS, or MP, IMO hazard or pollutant category Y
    CARGO_SHIP_Z(73), // Cargo (freight) ships carrying DG, HS, or MP, IMO hazard or pollutant category Z
    CARGO_SHIP_OS(74), // Cargo (freight) ships carrying DG, HS, or MP, IMO hazard or pollutant category OS
    CARGO_SHIP_NO_ADD_INFO(79), // Cargo (freight) ships or integrated tug barge (ITB) vessels, no additional information

    // [8x] Tanker Category
    TANKER(80), // Tankers or integrated tug tank barge vessels
    TANKER_X(81), // Tankers or integrated tug tank barge vessels carrying DG, HS, or MP, IMO hazard or pollutant category X
    TANKER_Y(82), // Tankers or integrated tug tank barge vessels carrying DG, HS, or MP, IMO hazard or pollutant category Y
    TANKER_Z(83), // Tankers or integrated tug tank barge vessels carrying DG, HS, or MP, IMO hazard or pollutant category Z
    TANKER_OS(84), // Tankers or integrated tug tank barge vessels carrying DG, HS, or MP, IMO hazard or pollutant category OS
    TANKER_NO_ADD_INFO(89), // Tankers or integrated tug tank barge vessels, no additional information

    // [9x] Other Category
    OTHER(90), // Other types of ship
    OTHER_X(91), // Other types of ship carrying DG, HS, or MP, IMO hazard or pollutant category X
    OTHER_Y(92), // Other types of ship carrying DG, HS, or MP, IMO hazard or pollutant category Y
    OTHER_Z(93), // Other types of ship carrying DG, HS, or MP, IMO hazard or pollutant category Z
    OTHER_OS(94), // Other types of ship carrying DG, HS, or MP, IMO hazard or pollutant category OS
    OTHER_NO_ADD_INFO(99); // Other types of ship, no additional information

    private final byte value;

    private VesselTypeEnum(int value) {
        this.value = (byte) value;
    }

    public byte getValue() {
        return value;
    }
}
bergtwvd commented 10 months ago

To be consistent with the existing datatype naming in this module, a more fitting name for this datatype is ShipTypeEnumType.

A change of all datatype names in this module to become more consistent with the overall NETN naming scheme should be handled via another issue.