from enum import Enum, auto
class Type(Enum):
    EBYTE = 0
    ACTISENSE = 1
    YACHT_DEVICES = 2
    
class PhysicalQuantities(Enum):
    ELECTRICAL_CURRENT = auto(), # Ampere (A)
    ELECTRICAL_CHARGE = auto(), # Coulomb (C)
    ELECTRICAL_ENERGY = auto(), # Kilo Watt Hour (kWh)
    ELECTRICAL_POWER = auto(), # Watt (W)
    ELECTRICAL_APPARENT_POWER = auto(), # Volt Ampere (VA)
    ELECTRICAL_REACTIVE_POWER = auto(), # Volt Ampere Reactive (VAR)
    POTENTIAL_DIFFERENCE = auto(), # Volt (V)
    POWER_FACTOR = auto(), # Cos(Phi) (Cos Phi)
    LENGTH = auto(), # Meter (m)
    DISTANCE = auto(), # meter (m)
    SPEED = auto(), # meter per second (m/s)
    ANGLE = auto(), # radian (rad)
    ANGULAR_VELOCITY = auto(), # radians per second (rad/s)
    VOLUME = auto(), # liter (L)
    VOLUMETRIC_FLOW = auto(), # liter per hour (L/h)
    MAGNETIC_FIELD = auto(), # Tesla (T)
    FREQUENCY = auto(), # Hertz (Hz)
    DATE = auto(), # days (d)
    TIME = auto(), # Second (s)
    DURATION = auto(), # Second (s)
    GEOGRAPHICAL_LATITUDE = auto(), # degree (deg)
    GEOGRAPHICAL_LONGITUDE = auto(), # degree (deg)
    TEMPERATURE = auto(), # Kelvin (K)
    PRESSURE = auto(), # Pascal (Pa)
    PRESSURE_RATE = auto(), # Pascal per hour (Pa/hr)
    CONCENTRATION = auto(), # parts per million (ppm)
    SIGNAL_STRENGTH = auto(), # decibel (dB)
    SIGNAL_TO_NOISE_RATIO = auto(), # decibel (dB)

class FieldTypes(Enum):
    NUMBER = auto(), # Number (Binary numbers are little endian. Number fields that are at least two bits in length use the highest positive value to represent unknown. Number fields with at least 7 as maximum (3 bits unsigned, 4 bits signed) use the highest value minus one as an error indicator. This is likely also true for numbers where 3 is the maximum value, but there are few fields that have this length -- certainly as a number, there are a lot of lookup fields of two bits length.  For signed numbers the maximum values are the maximum positive value and that minus 1, not the all-ones bit encoding which is the maximum negative value.)
    FLOAT = auto(), # 32 bit IEEE-754 floating point number ()
    DECIMAL = auto(), # A unsigned numeric value represented with 2 decimal digits per byte (Each byte represent 2 digits, so 1234 is represented by 2 bytes containing 0x12 and 0x34. A number with an odd number of digits will have 0 as the first digit in the first byte.)
    LOOKUP = auto(), # Number value where each value encodes for a distinct meaning (Each lookup has a LookupEnumeration defining what the possible values mean)
    INDIRECT_LOOKUP = auto(), # Number value where each value encodes for a distinct meaning but the meaning also depends on the value in another field (Each lookup has a LookupIndirectEnumeration defining what the possible values mean)
    BITLOOKUP = auto(), # Number value where each bit value encodes for a distinct meaning (Each LookupBit has a LookupBitEnumeration defining what the possible values mean. A bitfield can have any combination of bits set.)
    DYNAMIC_FIELD_KEY = auto(), # Number value where each value encodes for a distinct meaning including a fieldtype of the next variable field; generally followed by an optional DYNAMIC_FIELD_LENGTH and a DYNAMIC_FIELD_VALUE field; when there is no DYNAMIC_FIELD_LENGTH field the length is contained in the lookup table (Each lookup has a LookupFieldTypeEnumeration defining what the possible values mean)
    DYNAMIC_FIELD_LENGTH = auto(), # Number value that indicates the length of the following DYNAMIC_FIELD_VALUE field ()
    DYNAMIC_FIELD_VALUE = auto(), # Variable field whose type and length is dynamic (The type definition of the field is defined by an earlier LookupFieldTypeEnumeration field. The length is defined by the preceding length field or the length determined by the lookup value.)
    TIME = auto(), # Time ()
    DURATION = auto(), # Duration ()
    DATE = auto(), # Date (The date, in days since 1 January 1970.)
    PGN = auto(), # Parameter Group Number (A 24 bit number referring to a PGN)
    ISO_NAME = auto(), # ISO NAME field (A 64 bit field containing the ISO name, e.g. all fields produced by PGN 60928. Use the definition of PGN 60928 to explain the subfields.)
    STRING_FIX = auto(), # A fixed length string containing single byte codepoints. (The length of the string is determined by the PGN field definition. Trailing bytes have been observed as '@', ' ', 0x0 or 0xff.)
    STRING_LZ = auto(), # A varying length string containing single byte codepoints encoded with a length byte and terminating zero. (The length of the string is determined by a starting length byte. It also contains a terminating zero byte. The length byte includes neither the zero byte or itself. The character encoding is UTF-8.)
    STRING_LAU = auto(), # A varying length string containing double or single byte codepoints encoded with a length byte and terminating zero. (The length of the string is determined by a starting length byte. This count includes the length and type bytes, so any empty string contains count 2. The 2nd byte contains 0 for UNICODE or 1 for ASCII.)
    BINARY = auto(), # Binary field (Unspecified content consisting of any number of bits.)
    RESERVED = auto(), # Reserved field (All reserved bits shall be 1)
    SPARE = auto(), # Spare field (All spare bits shall be 0)
    MMSI = auto(), # MMSI (The MMSI is encoded as a 32 bit number, but is always printed as a 9 digit number and should be considered as a string. The first three or four digits are special, see the USCG link for a detailed explanation.)
    VARIABLE = auto(), # Variable (The definition of the field is that of the reference PGN and reference field, this is totally variable.)
    FIELD_INDEX = auto(), # Field Index (Index of the specified field in the PGN referenced.)