source: pacpussensors/trunk/NMEA0183/src/GST.cpp@ 80

Last change on this file since 80 was 59, checked in by DHERBOMEZ Gérald, 10 years ago

Integration of new modules:

  • GPS NMEA0183 decoder
  • Span CPT Decoder

Update of:

File size: 2.9 KB
Line 
1#include "nmea0183.h"
2#pragma hdrstop
3
4
5GST::GST()
6{
7 Mnemonic = "GST";
8 Empty();
9}
10
11GST::~GST()
12{
13 //Mnemonic.Empty();
14 Empty();
15}
16
17void GST::Empty( void )
18{
19 //UTCTime.Empty();
20 RMSvalue = 0.0;
21 ErrorEllipseMajor = 0.0;
22 ErrorEllipseMinor = 0.0;
23 ErrorEllipseOrientation = 0.0;
24 LatitudeError = 0.0;
25 LongitudeError = 0.0;
26 HeightError = 0.0;
27}
28
29BOOL GST::Parse( const SENTENCE& sentence )
30{
31 /*
32 ** GST - Global Positioning System Sentence Translator
33 ** Position error statistics.
34 **
35 **
36 ** 1 2 3 4 5 6 7 8 9
37 ** | | | | | | | | |
38 ** $--GST,hhmmss.s,x.xxx,x.xxx,x.xxx,xxx.x,x.xxx,x.xxx,x.xxx*hh<CR><LF>
39 **
40 ** Field Number:
41 ** 1) Universal Time Coordinated (UTC)
42 ** 2) RMS value of the pseudorange residuals
43 ** 3) Error ellipse semi-major axis 1 sigma error, in meters
44 ** 4) Error ellipse semi-minor axis 1 sigma error, in meters
45 ** 5) Error ellipse orientation, degrees from true north
46 ** 6) Latitude 1 sigma error, in meters
47 ** 7) Longitude 1 sigma error, in meters
48 ** 8) Height 1 sigma error, in meters
49 ** 9) Checksum
50 */
51
52 /*
53 ** First we check the checksum...
54 */
55
56 if ( sentence.IsChecksumBad( 15 ) == True )
57 {
58 SetErrorMessage( "Invalid Checksum" );
59 return( FALSE );
60 }
61
62 UTCTime = sentence.Field( 1 );
63 Time = sentence.Time( 1 );
64 RMSvalue = sentence.Double( 2 );
65 ErrorEllipseMajor = sentence.Double( 3 );
66 ErrorEllipseMinor = sentence.Double( 4 );
67 ErrorEllipseOrientation = sentence.Double( 5 );
68 LatitudeError = sentence.Double( 6 );
69 LongitudeError = sentence.Double( 7 );
70 HeightError = sentence.Double( 8 );
71 return( TRUE );
72}
73
74
75BOOL GST::Write( SENTENCE& sentence )
76{
77 /*
78 ** Let the parent do its thing
79 */
80
81 RESPONSE::Write( sentence );
82
83 sentence += UTCTime;
84 sentence += RMSvalue;
85 sentence += ErrorEllipseMajor;
86 sentence += "M";
87 sentence += ErrorEllipseMinor;
88 sentence += "M";
89 sentence += ErrorEllipseOrientation;
90 sentence += LatitudeError;
91 sentence += "M";
92 sentence += LongitudeError;
93 sentence += "M";
94 sentence += HeightError;
95 sentence += "M";
96 sentence.Finish();
97
98 return( TRUE );
99}
100
101const GST& GST::operator = ( const GST& source )
102{
103 UTCTime = source.UTCTime;
104 Time = source.Time;
105 RMSvalue = source.RMSvalue;
106 ErrorEllipseMajor = source.ErrorEllipseMajor;
107 ErrorEllipseMinor = source.ErrorEllipseMinor;
108 ErrorEllipseOrientation = source.ErrorEllipseOrientation;
109 LatitudeError = source.LatitudeError;
110 LongitudeError = source.LongitudeError;
111 HeightError = source.HeightError;
112
113 return( *this );
114}
Note: See TracBrowser for help on using the repository browser.