File: rdi.py

package info (click to toggle)
python-nmea2 1.19.0-3
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 420 kB
  • sloc: python: 2,948; makefile: 3
file content (28 lines) | stat: -rw-r--r-- 662 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
'''
Support for proprietary message(s) from RD Instruments
'''

from ... import nmea


class RDI(nmea.ProprietarySentence):
    '''
    RD Instruments message. Only one sentence known?
    '''
    sentence_types = {}
    def __new__(_cls, manufacturer, data):
        name = manufacturer + data[0]
        cls = _cls.sentence_types.get(name, _cls)
        return super(RDI, cls).__new__(cls)


class RDID(RDI):
    '''
    RD Instruments heading, pitch and roll data
    '''
    fields = (
        ('Subtype', 'subtype'),
        ("Pitch", "pitch", float),
        ("Roll", "roll", float),
        ("Heading", "heading", float)
    )