source: pacpussensors/trunk/NMEA0183/src/TEP.cpp@ 127

Last change on this file since 127 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: 1.8 KB
Line 
1#include "nmea0183.h"
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: tep.cpp $
13** $Revision: 4 $
14** $Modtime: 10/10/98 2:56p $
15*/
16
17/*
18** This Sentence Not Recommended For New Designs
19** There is no recommended replacement.
20*/
21
22
23TEP::TEP()
24{
25 Mnemonic = "TEP";
26 Empty();
27}
28
29TEP::~TEP()
30{
31 //Mnemonic.Empty();
32 Empty();
33}
34
35void TEP::Empty( void )
36{
37 ElevationDegrees = 0.0;
38}
39
40BOOL TEP::Parse( const SENTENCE& sentence )
41{
42 /*
43 ** TEP - TRANSIT Satellite Predicted Elevation
44 **
45 ** 1 2 3
46 ** | | |
47 ** $--TEP,x.x,T*hh<CR><LF>
48 **
49 ** Field Number:
50 ** 1) Elevation degrees
51 ** 2) D = Degrees
52 ** 3) Checksum
53 */
54
55 /*
56 ** First we check the checksum...
57 */
58
59 if ( sentence.IsChecksumBad( 3 ) == True )
60 {
61 SetErrorMessage( "Invalid Checksum" );
62 return( FALSE );
63 }
64
65 ElevationDegrees = sentence.Double( 1 );
66
67 return( TRUE );
68}
69
70QString TEP::PlainEnglish( void ) const
71{
72 QString return_string;
73
74 //return_string.Format( "TRANSIT satellite predicted elevation is %6.2lf degrees.", ElevationDegrees );
75 return_string = "TRANSIT satellite predicted elevation is" + QString::number(ElevationDegrees ) + "degrees." ;
76
77
78 return( return_string );
79}
80
81BOOL TEP::Write( SENTENCE& sentence )
82{
83 /*
84 ** Let the parent do its thing
85 */
86
87 RESPONSE::Write( sentence );
88
89 sentence += ElevationDegrees;
90 sentence += "D";
91
92 sentence.Finish();
93
94 return( TRUE );
95}
96
97const TEP& TEP::operator = ( const TEP& source )
98{
99 ElevationDegrees = source.ElevationDegrees;
100
101 return( *this );
102}
Note: See TracBrowser for help on using the repository browser.