Last change
on this file 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.7 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: zfo.cpp $
|
---|
13 | ** $Revision: 4 $
|
---|
14 | ** $Modtime: 10/10/98 2:40p $
|
---|
15 | */
|
---|
16 |
|
---|
17 |
|
---|
18 |
|
---|
19 | ZFO::ZFO()
|
---|
20 | {
|
---|
21 | Mnemonic = "ZFO";
|
---|
22 | Empty();
|
---|
23 | }
|
---|
24 |
|
---|
25 | ZFO::~ZFO()
|
---|
26 | {
|
---|
27 | //Mnemonic.Empty();
|
---|
28 | Empty();
|
---|
29 | }
|
---|
30 |
|
---|
31 | void ZFO::Empty( void )
|
---|
32 | {
|
---|
33 | //UTCTime.Empty();
|
---|
34 | //ElapsedTime.Empty();
|
---|
35 | //From.Empty();
|
---|
36 | }
|
---|
37 |
|
---|
38 | BOOL ZFO::Parse( const SENTENCE& sentence )
|
---|
39 | {
|
---|
40 | /*
|
---|
41 | ** ZFO - UTC & Time from origin Waypoint
|
---|
42 | **
|
---|
43 | ** 1 2 3 4
|
---|
44 | ** | | | |
|
---|
45 | ** $--ZFO,hhmmss.ss,hhmmss.ss,c--c*hh<CR><LF>
|
---|
46 | **
|
---|
47 | ** Fields:
|
---|
48 | ** 1) Universal Time Coordinated (UTC)
|
---|
49 | ** 2) Elapsed Time
|
---|
50 | ** 3) Origin Waypoint ID
|
---|
51 | ** 4) Checksum
|
---|
52 | */
|
---|
53 |
|
---|
54 | /*
|
---|
55 | ** First we check the checksum...
|
---|
56 | */
|
---|
57 |
|
---|
58 | if ( sentence.IsChecksumBad( 4 ) == True )
|
---|
59 | {
|
---|
60 | SetErrorMessage( "Invalid Checksum" );
|
---|
61 | return( FALSE );
|
---|
62 | }
|
---|
63 |
|
---|
64 | UTCTime = sentence.Field( 1 );
|
---|
65 | Time = sentence.Time( 1 );
|
---|
66 | ElapsedTime = sentence.Field( 2 );
|
---|
67 | From = sentence.Field( 3 );
|
---|
68 |
|
---|
69 | return( TRUE );
|
---|
70 | }
|
---|
71 |
|
---|
72 | BOOL ZFO::Write( SENTENCE& sentence )
|
---|
73 | {
|
---|
74 | /*
|
---|
75 | ** Let the parent do its thing
|
---|
76 | */
|
---|
77 |
|
---|
78 | RESPONSE::Write( sentence );
|
---|
79 |
|
---|
80 | sentence += UTCTime;
|
---|
81 | sentence += ElapsedTime;
|
---|
82 | sentence += From;
|
---|
83 |
|
---|
84 | sentence.Finish();
|
---|
85 |
|
---|
86 | return( TRUE );
|
---|
87 | }
|
---|
88 |
|
---|
89 | const ZFO& ZFO::operator = ( const ZFO& source )
|
---|
90 | {
|
---|
91 | UTCTime = source.UTCTime;
|
---|
92 | Time = source.Time;
|
---|
93 | ElapsedTime = source.ElapsedTime;
|
---|
94 | From = source.From;
|
---|
95 |
|
---|
96 | return( *this );
|
---|
97 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.