-
Notifications
You must be signed in to change notification settings - Fork 223
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add heave type Signed-off-by: Joep de Jong <joep@joepdejong.com> Signed-off-by: GitHub <noreply@github.com> * Add Furuno proprietary types Signed-off-by: Joep de Jong <joep@joepdejong.com> Signed-off-by: GitHub <noreply@github.com> * Cleanup Furuno --------- Signed-off-by: Joep de Jong <joep@joepdejong.com> Signed-off-by: GitHub <noreply@github.com>
- Loading branch information
1 parent
36d149b
commit f298742
Showing
5 changed files
with
96 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
from . import ash | ||
from . import fec | ||
from . import grm | ||
from . import kwd | ||
from . import mgn | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
''' | ||
Support for proprietary messages from Furuno receivers. | ||
''' | ||
# Implemented by Joep de Jong | ||
# pylint: disable=wildcard-import,unused-wildcard-import | ||
|
||
from ... import nmea | ||
from ...nmea_utils import * | ||
|
||
class FEC(nmea.ProprietarySentence): | ||
sentence_types = {} | ||
|
||
def __new__(_cls, manufacturer, data): | ||
name = manufacturer + data[1] | ||
cls = _cls.sentence_types.get(name, _cls) | ||
return super(FEC, cls).__new__(cls) | ||
|
||
class FECGPatt(FEC): | ||
""" | ||
Furuno GPatt Message | ||
$PFEC,GPatt,aaa.a,bb.b,cc.c,*hh<CR><LF> | ||
$PFEC: Talker identifier + sentence formatter* | ||
GPatt: Global positioning attitude, sentence formatter | ||
aaa.a: Yaw (degrees)* | ||
bb.b: Pitch (degrees)* | ||
cc.c: Roll (degrees)* | ||
*hh: Checksum* | ||
""" | ||
fields = ( | ||
('R', '_r'), | ||
('Subtype', 'subtype'), | ||
('Yaw', 'yaw', float), | ||
('Pitch', 'pitch', float), | ||
('Roll', 'roll', float), | ||
) | ||
|
||
|
||
class FECGPhve(FEC): | ||
""" | ||
Furuno GPatt Message | ||
$PFEC,GPhve,xx.xxx,A*hh<CR><LF> | ||
$PFEC: Talker identifier | ||
GPhve: Datagram identifier | ||
xx.xxx: Heave (Metres) | ||
A: Status | ||
*hh: Checksum | ||
""" | ||
|
||
fields = ( | ||
("R", "_r"), | ||
("Subtype", "subtype"), | ||
("Heave", "heave", float), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import pynmea2 | ||
|
||
|
||
def test_fecgpatt(): | ||
data = "$PFEC,GPatt,294.7,-02.5,+00.4*45" | ||
msg = pynmea2.parse(data) | ||
assert type(msg) == pynmea2.fec.FECGPatt | ||
assert msg.manufacturer == 'FEC' | ||
assert msg.yaw == 294.7 | ||
assert msg.pitch == -2.5 | ||
assert msg.roll == 0.4 | ||
assert msg.render() == data | ||
|
||
|
||
def test_fecgphve(): | ||
data = "$PFEC,GPhve,00.007,A*08" | ||
msg = pynmea2.parse(data) | ||
assert type(msg) == pynmea2.fec.FECGPhve | ||
assert msg.manufacturer == "FEC" | ||
assert msg.heave == 0.007 | ||
assert msg.render() == data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters