1
1
# -- TRIMBLE -- #
2
2
3
3
# pylint: disable=wildcard-import,unused-wildcard-import
4
+ from decimal import Decimal
4
5
from ... import nmea
5
6
from ...nmea_utils import *
6
7
""" Support for proprietary messages from BD9xx recievers.
@@ -16,15 +17,15 @@ def __new__(_cls, manufacturer, data):
16
17
'''
17
18
Return the correct sentence type based on the first field
18
19
'''
19
- sentence_type = data [0 ] or data [ 1 ]
20
+ sentence_type = data [1 ]
20
21
name = manufacturer + sentence_type
21
- cls = _cls .sentence_types .get (name , _cls )
22
+ if name not in _cls .sentence_types :
23
+ # TNLDG does not have a sentence type
24
+ if TNLDG .match (data ):
25
+ return super (TNL , TNLDG ).__new__ (TNLDG )
26
+ cls = _cls .sentence_types .get (name , TNL )
22
27
return super (TNL , cls ).__new__ (cls )
23
28
24
- def __init__ (self , manufacturer , data ):
25
- self .sentence_type = data [0 ] or data [1 ]
26
- super (TNL , self ).__init__ (manufacturer , data )
27
-
28
29
29
30
class TNLAVR (TNL ):
30
31
"""
@@ -66,6 +67,29 @@ class TNLBPQ(TNL, LatLonFix, DatetimeFix):
66
67
('Total number of satelites in use' , 'num_sats' ),
67
68
)
68
69
70
+ class TNLDG (TNL ):
71
+ """
72
+ Trimble DG message (L-band, beacon signal strength, etc)
73
+ """
74
+ @staticmethod
75
+ def match (data ):
76
+ return re .match (r'\d+\.\d{1}' , data [1 ])
77
+
78
+ def __init__ (self , * args , ** kwargs ):
79
+ self .subtype = 'DG'
80
+ super (TNLDG , self ).__init__ (* args , ** kwargs )
81
+
82
+ fields = (
83
+ ('Empty' , '_' ),
84
+ ('Signal strength' , 'strength' , float ),
85
+ ('SNR in db' , 'snr' , float ),
86
+ ('Signal frequency in kHz' , 'frequency' , float ),
87
+ ('Bit rate' , 'bitrate' , Decimal ),
88
+ ('Channel number' , 'channel_no' , Decimal ),
89
+ ('Tracking status' , 'status' ),
90
+ ('Channel used' , 'channel_used' ),
91
+ ('Tracking performance indicator' , 'performance' , Decimal ),
92
+ )
69
93
70
94
class TNLGGK (TNL , LatLonFix , DatetimeFix ):
71
95
"""
@@ -89,6 +113,24 @@ class TNLGGK(TNL, LatLonFix, DatetimeFix):
89
113
)
90
114
91
115
116
+ class TNLVGK (TNL , DatetimeFix ):
117
+ """
118
+ Trimble VGK (vector information) message
119
+ """
120
+ fields = (
121
+ ('Empty' , '_' ),
122
+ ('Sentence Type' , 'type' ),
123
+ ('Timestamp' , 'timestamp' , timestamp ),
124
+ ('Datestamp' , 'datestamp' , datestamp ),
125
+ ('East component' , 'east' , float ),
126
+ ('North component' , 'north' , float ),
127
+ ('Up component' , 'up' , float ),
128
+ ('GPS Quality' , 'gps_quality' ),
129
+ ('Number of satelites' , 'num_sats' , Decimal ),
130
+ ('DOP of fix' , 'dop' , float ),
131
+ ('Meters' , 'meters' ),
132
+ )
133
+
92
134
class TNLVHD (TNL , DatetimeFix ):
93
135
"""
94
136
Trimble VHD Message
@@ -97,18 +139,37 @@ class TNLVHD(TNL, DatetimeFix):
97
139
('Empty' , '_' ),
98
140
('Sentence Type' , 'type' ),
99
141
('Timestamp' , 'timestamp' , timestamp ),
100
- (" Datestamp" , " datestamp" , datestamp ),
101
- ('Azimuth Angle' , 'azimuth' ),
102
- ('AzimuthTime' , 'azdt' ),
103
- ('Vertical Angle' , 'vertical' ),
104
- ('VerticalTime' , 'vertdt' ),
105
- ('Range' , 'range' ),
106
- ('RangeTime' , 'rdt' ),
142
+ (' Datestamp' , ' datestamp' , datestamp ),
143
+ ('Azimuth Angle' , 'azimuth' , float ),
144
+ ('AzimuthTime' , 'azdt' , float ),
145
+ ('Vertical Angle' , 'vertical' , float ),
146
+ ('VerticalTime' , 'vertdt' , float ),
147
+ ('Range' , 'range' , float ),
148
+ ('RangeTime' , 'rdt' , float ),
107
149
('GPS Quality' , 'gps_quality' ),
108
- ('Total number of satelites in use' , 'num_sats' ),
109
- ('PDOP' , 'pdop' ),
150
+ ('Total number of satelites in use' , 'num_sats' , Decimal ),
151
+ ('PDOP' , 'pdop' , float ),
110
152
)
111
153
154
+ class TNLPJK (TNL , DatetimeFix ):
155
+ """
156
+ Trimble PJK message
157
+ """
158
+ fields = (
159
+ ('Empty' , '_' ),
160
+ ('Sentence Type' , 'type' ),
161
+ ('Timestamp' , 'timestamp' , timestamp ),
162
+ ('Datestamp' , 'datestamp' , datestamp ),
163
+ ('Northing' , 'northing' , float ),
164
+ ('North' , 'north' ),
165
+ ('Easting' , 'easting' , float ),
166
+ ('East' , 'east' ),
167
+ ('GPS Quality' , 'gps_quality' ),
168
+ ('Number of satellites' , 'num_sats' , Decimal ),
169
+ ('DOP of fix' , 'dop' , float ),
170
+ ('Height of antenna phase center' , 'height' ),
171
+ ('Meters' , 'meters' ),
172
+ )
112
173
113
174
class TNLPJT (TNL ):
114
175
"""
0 commit comments