Skip to content

Commit

Permalink
Defined SignalType enum.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamshapiro0 committed Mar 25, 2024
1 parent 96a46b2 commit 1ed02b3
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions python/fusion_engine_client/messages/signal_defs.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,67 @@ class SatelliteTypeMask:
ALL = 0xFFFFFFFF


def _get_signal_type_offset(system: SatelliteType) -> int:
return 16 * int(system)


class SignalType(IntEnum):
UNKNOWN = 0

GPS_L1CA = 16
GPS_L1P = 17
GPS_L1C = 18
GPS_L2C = 20
GPS_L2P = 21
GPS_L5 = 24

GLO_L1CA = 32
GLO_L1P = 33
GLO_L2CA = 36
GLO_L2P = 37

GAL_E1A = 64
GAL_E1BC = 65
GAL_E5B = 68
GAL_E5A = 72
GAL_E6A = 76
GAL_E6BC = 77

BDS_B1I = 80
BDS_B1C = 81
BDS_B2I = 84
BDS_B2B = 85
BDS_B2A = 88
BDS_B3 = 92

@classmethod
def get_offset(cls, system: SatelliteType) -> int:
return _get_signal_type_offset(system)


@enum_bitmask(SignalType, offset=SignalType.get_offset(SatelliteType.GPS),
predicate=lambda x: str(x).startswith('GPS'))
class GPSSignalTypeMask:
ALL = 0xFFFF


@enum_bitmask(SignalType, offset=SignalType.get_offset(SatelliteType.GLONASS),
predicate=lambda x: str(x).startswith('GLO'))
class GLOSignalTypeMask:
ALL = 0xFFFF


@enum_bitmask(SignalType, offset=SignalType.get_offset(SatelliteType.GALILEO),
predicate=lambda x: str(x).startswith('GAL'))
class GALSignalTypeMask:
ALL = 0xFFFF


@enum_bitmask(SignalType, offset=SignalType.get_offset(SatelliteType.BEIDOU),
predicate=lambda x: str(x).startswith('BDS'))
class BDSSignalTypeMask:
ALL = 0xFFFF


class FrequencyBand(IntEnum):
UNKNOWN = 0
Expand Down

0 comments on commit 1ed02b3

Please sign in to comment.