source: pacpussensors/trunk/NMEA0183/src/HSPOS.cpp@ 64

Last change on this file since 64 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: 4.8 KB
Line 
1#include "HSPOS.hpp"
2//#pragma hdrstop
3
4/*
5** Author: Samuel R. Blackburn
6** Internet: sam_blackburn@pobox.com
7**
8** You can use it any way you like as long as you don't try to sell it.
9**
10** Copyright, 1996, Samuel R. Blackburn
11**
12** $Workfile: HSPOS.cpp $
13** $Revision: 6 $
14** $Modtime: 10/12/98 6:39a $
15*/
16
17
18
19HSPOS::HSPOS()
20{
21 Mnemonic = "HSPOS";
22 Empty();
23}
24
25HSPOS::~HSPOS()
26{
27 //Mnemonic.Empty();
28 Empty();
29}
30
31void HSPOS::Empty( void )
32{
33
34
35 //UTCTime.Empty();
36 Position.Empty();
37 depth = 0.0;
38 altitude = 0.0;
39 latitudeStdDev = 0.0;
40 longitudeStdDev = 0.0;
41 latLongCov = 0.0;
42 depthStdDev = 0.0;
43 UTMzone = 0;
44 UTMzoneChar = ' ';
45 eastindProjection = 0.0;
46 northingProjection = 0.0;
47 logMislignment = 0.0;
48 logScaleFactorError = 0.0;
49 compensationSoundVelocity = 0.0;
50}
51
52BOOL HSPOS::Parse( const SENTENCE& sentence )
53{
54 /*
55 ** HSPOS - Global Positioning System Fix Data
56 ** Time, Position and fix related data fora GPS receiver.
57 **
58 ** 1 2 3 4 5 6 7 8 9 10 11 12 1314 15 16 17 18
59 ** | | | | | | | | | | | | | | | | | |
60 ** $HSPOS_,hhmmss.ss,llmm.mmmmm,H,LLmm.mmmmm,D,d.dd,a.ad,x.xx,y.yy,z.zz,d.dd,nn,c,e.e,n.n,m.mmmm,s.ssss,vvvv.v<CR><LF>
61 **
62 ** Field Number:
63 ** 1) hhmmss.ss is the UTC absolute time
64 2) llmm.mmmmm is the latitude in deg, decimal in min
65 3) H N: north, S: south
66 4) LLmm.mmmmm is the longitude in deg, decimal in min
67 5) D E: east, W: west
68 6) d.dd is the depth in meters
69 7) a.aa is the altitude in meters (from DVL)
70 8) x.xx is the latitude Std (meters)
71 9) y.yy is the longitude Std (meters)
72 10) z.zz is the latitude longitude covariance (meters)
73 11) d.dd is the depth Std (meters)
74 12) nn is the UTM zone integer
75 13) c is the UTM zone character
76 14) e.e is the easting projection
77 15) n.n is the northing projection
78 16) m.mmmm is the log misalignment estimation in degrees
79 17) s.ssss is the log scale factor error estimation in %
80 18) vvvv.v is the compensation sound velocity in m/s
81
82
83 */
84
85 UTCTime = sentence.Field( 1 );
86 Time = sentence.Time( 1 );
87 Position.Parse( 2, 3, 4, 5, sentence );
88 depth = sentence.Double( 6 );
89 altitude = sentence.Double( 7 );
90 latitudeStdDev = sentence.Double( 8 );
91 longitudeStdDev = sentence.Double( 9 );
92 latLongCov = sentence.Double( 10 );
93 depthStdDev = sentence.Double( 11 );
94 UTMzone = sentence.Integer( 12 );
95 UTMzoneChar = sentence.Field(13).at(0);
96 eastindProjection = sentence.Double( 14 );
97 northingProjection = sentence.Double( 15 );
98 logMislignment = sentence.Double( 16 );
99 logScaleFactorError = sentence.Double( 17 );
100 compensationSoundVelocity = sentence.Double( 18 );
101
102 return( TRUE );
103}
104
105QString HSPOS::PlainEnglish( void ) const
106{
107 QString return_string;
108
109 return_string = "not yet available ";
110
111 return( return_string );
112}
113
114BOOL HSPOS::Write( SENTENCE& sentence )
115{
116 /*
117 ** Let the parent do its thing
118 */
119
120 RESPONSE::Write( sentence );
121
122 sentence += UTCTime;
123 sentence += Position;
124 sentence += depth;
125 sentence += altitude;
126 sentence += latitudeStdDev;
127 sentence += longitudeStdDev;
128 sentence += latLongCov;
129 sentence += depthStdDev;
130 sentence += UTMzone;
131 sentence += UTMzoneChar;
132 sentence += eastindProjection;
133 sentence += northingProjection;
134 sentence += logMislignment;
135 sentence += logScaleFactorError;
136 sentence += compensationSoundVelocity;
137
138 sentence.Finish();
139
140 return( TRUE );
141}
142
143const HSPOS& HSPOS::operator = ( const HSPOS& source )
144{
145 UTCTime = source.UTCTime;
146 Position = source.Position;
147 depth = source.depth;
148 altitude = source.altitude;
149 latitudeStdDev = source.latitudeStdDev;
150 longitudeStdDev = source.longitudeStdDev;
151 latLongCov = source.latLongCov;
152 depthStdDev = source.depthStdDev;
153 UTMzone = source.UTMzone;
154 UTMzoneChar = source.UTMzoneChar;
155 eastindProjection = source.eastindProjection;
156 northingProjection = source.northingProjection;
157 logMislignment = source.logMislignment;
158 logScaleFactorError = source.logScaleFactorError;
159 compensationSoundVelocity = source.compensationSoundVelocity;
160
161 return( *this );
162}
Note: See TracBrowser for help on using the repository browser.