[59] | 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: lcd.cpp $
|
---|
| 13 | ** $Revision: 4 $
|
---|
| 14 | ** $Modtime: 10/10/98 2:44p $
|
---|
| 15 | */
|
---|
| 16 |
|
---|
| 17 |
|
---|
| 18 |
|
---|
| 19 | LCD::LCD()
|
---|
| 20 | {
|
---|
| 21 | Mnemonic = "LCD";
|
---|
| 22 | Empty();
|
---|
| 23 | }
|
---|
| 24 |
|
---|
| 25 | LCD::~LCD()
|
---|
| 26 | {
|
---|
| 27 | //Mnemonic.Empty();
|
---|
| 28 | Empty();
|
---|
| 29 | }
|
---|
| 30 |
|
---|
| 31 | void LCD::Empty( void )
|
---|
| 32 | {
|
---|
| 33 | GroupRepetitionInterval = 0;
|
---|
| 34 | Master.Empty();
|
---|
| 35 | Secondary1.Empty();
|
---|
| 36 | Secondary2.Empty();
|
---|
| 37 | Secondary3.Empty();
|
---|
| 38 | Secondary4.Empty();
|
---|
| 39 | Secondary5.Empty();
|
---|
| 40 | }
|
---|
| 41 |
|
---|
| 42 | BOOL LCD::Parse( const SENTENCE& sentence )
|
---|
| 43 | {
|
---|
| 44 | /*
|
---|
| 45 | ** LCD - Loran-C Signal Data
|
---|
| 46 | **
|
---|
| 47 | ** 1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
---|
| 48 | ** | | | | | | | | | | | | | |
|
---|
| 49 | ** $--LCD,xxxx,xxx,xxx,xxx,xxx,xxx,xxx,xxx,xxx,xxx,xxx,xxx,xxx*hh<CR><LF>
|
---|
| 50 | **
|
---|
| 51 | ** 1) Group Repetition Interval (GRI) Microseconds/10
|
---|
| 52 | ** 2) Master Relative SNR
|
---|
| 53 | ** 3) Master Relative ECD
|
---|
| 54 | ** 4) Time Difference 1 Microseconds
|
---|
| 55 | ** 5) Time Difference 1 Signal Status
|
---|
| 56 | ** 6) Time Difference 2 Microseconds
|
---|
| 57 | ** 7) Time Difference 2 Signal Status
|
---|
| 58 | ** 8) Time Difference 3 Microseconds
|
---|
| 59 | ** 9) Time Difference 3 Signal Status
|
---|
| 60 | ** 10) Time Difference 4 Microseconds
|
---|
| 61 | ** 11) Time Difference 4 Signal Status
|
---|
| 62 | ** 12) Time Difference 5 Microseconds
|
---|
| 63 | ** 13) Time Difference 5 Signal Status
|
---|
| 64 | ** 14) Checksum
|
---|
| 65 | */
|
---|
| 66 |
|
---|
| 67 | /*
|
---|
| 68 | ** First we check the checksum...
|
---|
| 69 | */
|
---|
| 70 |
|
---|
| 71 | if ( sentence.IsChecksumBad( 14 ) == True )
|
---|
| 72 | {
|
---|
| 73 | SetErrorMessage( "Invalid Checksum" );
|
---|
| 74 | return( FALSE );
|
---|
| 75 | }
|
---|
| 76 |
|
---|
| 77 | GroupRepetitionInterval = sentence.Integer( 1 );
|
---|
| 78 | Master.Parse( 2, sentence );
|
---|
| 79 | Secondary1.Parse( 4, sentence );
|
---|
| 80 | Secondary2.Parse( 6, sentence );
|
---|
| 81 | Secondary3.Parse( 8, sentence );
|
---|
| 82 | Secondary4.Parse( 10, sentence );
|
---|
| 83 | Secondary5.Parse( 12, sentence );
|
---|
| 84 |
|
---|
| 85 | return( TRUE );
|
---|
| 86 | }
|
---|
| 87 |
|
---|
| 88 | BOOL LCD::Write( SENTENCE& sentence )
|
---|
| 89 | {
|
---|
| 90 | /*
|
---|
| 91 | ** Let the parent do its thing
|
---|
| 92 | */
|
---|
| 93 |
|
---|
| 94 | RESPONSE::Write( sentence );
|
---|
| 95 |
|
---|
| 96 | sentence += GroupRepetitionInterval;
|
---|
| 97 | Master.Write( sentence );
|
---|
| 98 | Secondary1.Write( sentence );
|
---|
| 99 | Secondary2.Write( sentence );
|
---|
| 100 | Secondary3.Write( sentence );
|
---|
| 101 | Secondary4.Write( sentence );
|
---|
| 102 | Secondary5.Write( sentence );
|
---|
| 103 |
|
---|
| 104 | sentence.Finish();
|
---|
| 105 |
|
---|
| 106 | return( TRUE );
|
---|
| 107 | }
|
---|
| 108 |
|
---|
| 109 | const LCD& LCD::operator = ( const LCD& source )
|
---|
| 110 | {
|
---|
| 111 | GroupRepetitionInterval = source.GroupRepetitionInterval;
|
---|
| 112 | Master = source.Master;
|
---|
| 113 | Secondary1 = source.Secondary1;
|
---|
| 114 | Secondary2 = source.Secondary2;
|
---|
| 115 | Secondary3 = source.Secondary3;
|
---|
| 116 | Secondary4 = source.Secondary4;
|
---|
| 117 | Secondary5 = source.Secondary5;
|
---|
| 118 |
|
---|
| 119 | return( *this );
|
---|
| 120 | }
|
---|