@@ -181,3 +181,39 @@ class TNLPJT(TNL):
181
181
('Coordinate System' , 'coord_name' ),
182
182
('Project Name' , 'project_name' ),
183
183
)
184
+
185
+ class TNLEVT (TNL , DatetimeFix ):
186
+ """
187
+ Trimble EVT message (used for events like hardware triggers)
188
+
189
+ 0 Talker ID $PTNL
190
+ 1 Message ID EVT
191
+ 2 Event time. UTC time of event in format hhmmss.ssssss
192
+ 3 Port number. Port event markers receiver: "1" or "2" (optional), if two ports are available.
193
+ 4 NNNNNN. Incremental number of events on each independent port.
194
+ 5 WWWW. Week number of event (since 06 January 1980).
195
+ 6 Day of week. Days denoted 0 = Sunday…6 = Saturday.
196
+ 7 Leap second. UTC Leap Second offset from GPS time, Currently 18 seconds as of 07 July 2017.
197
+ 8 The checksum data, always begins with *
198
+
199
+ Example message:
200
+ $PTNL,EVT,131007.999785,2,460,2181,5,18*72
201
+ """
202
+ fields = (
203
+ ('Empty' , '_' ),
204
+ ('Sentence Type' , 'type' ),
205
+ ('Timestamp' , 'timestamp' , timestamp ),
206
+ ('Port Number' , 'port_num' , int ),
207
+ ('Event Number' , 'event_num' , int ),
208
+ ('GPS Week Number' , 'gps_week_num' , int ),
209
+ ('GPS Day of the Week' , 'gps_day_num' , int ),
210
+ ('Leap Seconds' , 'leap_secs' , int )
211
+ )
212
+
213
+ # We can derive the date from GPS Week Number and Day of the Week
214
+ # Presumingly 1024 overflow was taken into accound by the GPS unit
215
+ @property
216
+ def datestamp (self ):
217
+ gps_epoch = datetime .date (year = 1980 , month = 1 , day = 6 )
218
+ return gps_epoch + datetime .timedelta (
219
+ weeks = self .gps_week_num , days = self .gps_day_num )
0 commit comments