亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? sentence.cpp

?? 來自網絡,國外網友做的,vc++代碼,測試過,表示感謝. 可以讀取串口GPS數據顯示地理位置,需要有外置的串口的GPS接收機連接電腦,在demo主窗口界面可以輸出GPS接收的地理位置,經度緯度,時間
?? CPP
字號:
#include "nmea0183.h"
#pragma hdrstop

/*
** Author: Samuel R. Blackburn
** Internet: sam_blackburn@pobox.com
**
** You can use it any way you like as long as you don't try to sell it.
**
** Copyright, 1996, Samuel R. Blackburn
**
** $Workfile: sentence.cpp $
** $Revision: 5 $
** $Modtime: 10/10/98 2:43p $
*/

#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif

SENTENCE::SENTENCE()
{
   Sentence.Empty();
}

SENTENCE::~SENTENCE()
{
   Sentence.Empty();
}

NMEA0183_BOOLEAN SENTENCE::Boolean( int field_number ) const
{
   CString field_data;

   field_data = Field( field_number );

   if ( field_data == "A" )
   {
      return( True );
   }
   else if ( field_data == "V" )
   {
      return( False );
   }
   else
   {
      return( NMEA_Unknown );
   }
}

COMMUNICATIONS_MODE SENTENCE::CommunicationsMode( int field_number ) const
{
   CString field_data;

   field_data = Field( field_number );

   if ( field_data == "d" )
   {		 
      return( F3E_G3E_SimplexTelephone );
   }
   else if ( field_data == "e" )
   {
      return( F3E_G3E_DuplexTelephone );
   }
   else if ( field_data == "m" )
   {
      return( J3E_Telephone );
   }
   else if ( field_data == "o" )
   {
      return( H3E_Telephone );
   }
   else if ( field_data == "q" )
   {
      return( F1B_J2B_FEC_NBDP_TelexTeleprinter );
   }
   else if ( field_data == "s" )
   {
      return( F1B_J2B_ARQ_NBDP_TelexTeleprinter );
   }
   else if ( field_data == "w" )
   {
      return( F1B_J2B_ReceiveOnlyTeleprinterDSC );
   }
   else if ( field_data == "x" )
   {
      return( A1A_MorseTapeRecorder );
   }
   else if ( field_data == "{" )
   {
      return( A1A_MorseKeyHeadset );
   }
   else if ( field_data == "|" )
   {
      return( F1C_F2C_F3C_FaxMachine );
   }
   else
   {
      return( CommunicationsModeUnknown );
   }
}

BYTE SENTENCE::ComputeChecksum( void ) const
{
   BYTE checksum_value = 0;

   int string_length = Sentence.GetLength();
   int index = 1; // Skip over the $ at the begining of the sentence

   while( index < string_length    && 
          Sentence[ index ] != '*' && 
          Sentence[ index ] != CARRIAGE_RETURN && 
          Sentence[ index ] != LINE_FEED )
   {
      checksum_value ^= Sentence[ index ];
      index++;
   }

   return( checksum_value );
}

double SENTENCE::Double( int field_number ) const
{
   CString field_data;

   field_data = Field( field_number );

   return( ::atof( field_data ) );
}

EASTWEST SENTENCE::EastOrWest( int field_number ) const
{
   CString field_data;

   field_data = Field( field_number );

   if ( field_data == "E" )
   {
      return( East );
   }
   else if ( field_data == "W" )
   {
      return( West );
   }
   else
   {
      return( EW_Unknown );
   }
}

const CString SENTENCE::Field( int desired_field_number ) const
{
   // Thanks to Vilhelm Persson (vilhelm.persson@st.se) for finding a 
   // bug that lived here.

   CString return_string;

   return_string.Empty();

   int index                = 1; // Skip over the $ at the begining of the sentence
   int current_field_number = 0;
   int string_length        = 0;

   string_length = Sentence.GetLength();

   while( current_field_number < desired_field_number && index < string_length )
   {
      if ( Sentence[ index ] == ',' || Sentence[ index ] == '*' )
      {
         current_field_number++;
      }

      index++;
   }

   if ( current_field_number == desired_field_number )
   {
      while( index < string_length    &&
             Sentence[ index ] != ',' &&
             Sentence[ index ] != '*' &&
             Sentence[ index ] != 0x00 )
      {
         return_string += Sentence[ index ];
         index++;
      }
   }

   return( return_string );
}

WORD SENTENCE::GetNumberOfDataFields( void ) const
{
   int index                = 1; // Skip over the $ at the begining of the sentence
   int current_field_number = 0;
   int string_length        = 0;

   string_length = Sentence.GetLength();

   while( index < string_length )
   {
      if ( Sentence[ index ] == '*' )
      {
         return( (WORD) current_field_number );
      }

      if ( Sentence[ index ] == ',' )
      {
         current_field_number++;
      }

      index++;
   }

   return( (WORD) current_field_number );
}

void SENTENCE::Finish( void )
{
   BYTE checksum = ComputeChecksum();

   char temp_string[ 10 ];

   ::sprintf( temp_string, "*%02X%c%c", (int) checksum, CARRIAGE_RETURN, LINE_FEED );

   Sentence += temp_string;
}

int SENTENCE::Integer( int field_number ) const
{
   CString integer_string;

   integer_string = Field( field_number );

   return( ::atoi( integer_string ) );
}

NMEA0183_BOOLEAN SENTENCE::IsChecksumBad( int checksum_field_number ) const
{
   /*
   ** Checksums are optional, return TRUE if an existing checksum is known to be bad
   */

   CString checksum_in_sentence = Field( checksum_field_number );

   if ( checksum_in_sentence == "" )
   {
      return( NMEA_Unknown );
   }

   if ( ComputeChecksum() != HexValue( checksum_in_sentence ) )
   {
      return( True );
   } 

   return( False );
}

LEFTRIGHT SENTENCE::LeftOrRight( int field_number ) const
{
   CString field_data;

   field_data = Field( field_number );

   if ( field_data == "L" )
   {
      return( Left );
   }
   else if ( field_data == "R" )
   {
      return( Right );
   }
   else
   {
      return( LR_Unknown );
   }
}

NORTHSOUTH SENTENCE::NorthOrSouth( int field_number ) const
{
   CString field_data;

   field_data = Field( field_number );

   if ( field_data == "N" )
   {
      return( North );
   }
   else if ( field_data == "S" )
   {
      return( South );
   }
   else
   {
      return( NS_Unknown );
   }
}

REFERENCE SENTENCE::Reference( int field_number ) const
{
   CString field_data;

   field_data = Field( field_number );

   if ( field_data == "B" )
   {
      return( BottomTrackingLog );
   }
   else if ( field_data == "M" )
   {
      return( ManuallyEntered );
   }
   else if ( field_data == "W" )
   {
      return( WaterReferenced );
   }
   else if ( field_data == "R" )
   {
      return( RadarTrackingOfFixedTarget );
   }
   else if ( field_data == "P" )
   {
      return( PositioningSystemGroundReference );
   }
   else
   {
      return( ReferenceUnknown );
   }
}

const CTime SENTENCE::Time( int field_number ) const
{
   CTime return_value;

   return_value = CTime::GetCurrentTime();

   CString temp_string = Field( field_number );

   if ( temp_string.GetLength() >= 6 )
   {
      char temp_number[ 3 ];

      temp_number[ 2 ] = 0x00;

      temp_number[ 0 ] = temp_string[ 0 ];
      temp_number[ 1 ] = temp_string[ 1 ];

      int hours = ::atoi( temp_number );

      temp_number[ 0 ] = temp_string[ 2 ];
      temp_number[ 1 ] = temp_string[ 3 ];

      int minutes = ::atoi( temp_number );

      temp_number[ 0 ] = temp_string[ 4 ];
      temp_number[ 1 ] = temp_string[ 5 ];

      int seconds = ::atoi( temp_number );

      int year  = return_value.GetYear();
      int month = return_value.GetMonth();
      int day   = return_value.GetDay();

      return_value = CTime( year, month, day, hours, minutes, seconds );
   }

   return( return_value );
}

TRANSDUCER_TYPE SENTENCE::TransducerType( int field_number ) const
{
   CString field_data;

   field_data = Field( field_number );

   if ( field_data == "A" )
   {		 
      return( AngularDisplacementTransducer );
   }
   else if ( field_data == "D" )
   {
      return( LinearDisplacementTransducer );
   }
   else if ( field_data == "C" )
   {
      return( TemperatureTransducer );
   }
   else if ( field_data == "F" )
   {
      return( FrequencyTransducer );
   }
   else if ( field_data == "N" )
   {
      return( ForceTransducer );
   }
   else if ( field_data == "P" )
   {
      return( PressureTransducer );
   }
   else if ( field_data == "R" )
   {
      return( FlowRateTransducer );
   }
   else if ( field_data == "T" )
   {
      return( TachometerTransducer );
   }
   else if ( field_data == "H" )
   {
      return( HumidityTransducer );
   }
   else if ( field_data == "V" )
   {
      return( VolumeTransducer );
   }
   else
   {
      return( TransducerUnknown );
   }
}

/*
** Operators
*/

SENTENCE::operator CString() const
{
   return( Sentence );
}

const SENTENCE& SENTENCE::operator = ( const SENTENCE& source )
{
   Sentence = source.Sentence;

   return( *this );
}

const SENTENCE& SENTENCE::operator = ( const CString& source )
{
   Sentence = source;

   return( *this );
}

const SENTENCE& SENTENCE::operator += ( const CString& source )
{
   Sentence += ",";
   Sentence += source;

   return( *this );
}

const SENTENCE& SENTENCE::operator += ( double value )
{
   char temp_string[ 80 ];

   ::sprintf( temp_string, "%.3f", value );

   Sentence += ",";
   Sentence += temp_string;

   return( *this );
}

const SENTENCE& SENTENCE::operator += ( COMMUNICATIONS_MODE mode )
{
   Sentence += ",";

   switch( mode )
   {
      case F3E_G3E_SimplexTelephone:

	      Sentence += "d";
		   break;

      case F3E_G3E_DuplexTelephone:

	      Sentence += "e";
		   break;

      case J3E_Telephone:

	      Sentence += "m";
		   break;

      case H3E_Telephone:

	      Sentence += "o";
		   break;

      case F1B_J2B_FEC_NBDP_TelexTeleprinter:

	      Sentence += "q";
		   break;

      case F1B_J2B_ARQ_NBDP_TelexTeleprinter:

	      Sentence += "s";
		   break;

      case F1B_J2B_ReceiveOnlyTeleprinterDSC:

	      Sentence += "w";
		   break;

      case A1A_MorseTapeRecorder:

	      Sentence += "x";
		   break;

      case A1A_MorseKeyHeadset:

	      Sentence += "{";
		   break;

      case F1C_F2C_F3C_FaxMachine:

	      Sentence += "|";
		   break;
   }

   return( *this );
}

const SENTENCE& SENTENCE::operator += ( TRANSDUCER_TYPE transducer )
{
   Sentence += ",";

   switch( transducer )
   {
      case TemperatureTransducer:

	      Sentence += "C";
		   break;

      case AngularDisplacementTransducer:

	      Sentence += "A";
		   break;

      case LinearDisplacementTransducer:

	      Sentence += "D";
		   break;

      case FrequencyTransducer:

	      Sentence += "F";
		   break;

      case ForceTransducer:

	      Sentence += "N";
		   break;

      case PressureTransducer:

	      Sentence += "P";
		   break;

      case FlowRateTransducer:

	      Sentence += "R";
		   break;

      case TachometerTransducer:

	      Sentence += "T";
		   break;

      case HumidityTransducer:

	      Sentence += "H";
		   break;

      case VolumeTransducer:

	      Sentence += "V";
		   break;
   }

   return( *this );
}

const SENTENCE& SENTENCE::operator += ( NORTHSOUTH northing )
{
   Sentence += ",";

   if ( northing == North )
   {
      Sentence += "N";
   }
   else if ( northing == South )
   {
      Sentence += "S";
   }

   return( *this );
}

const SENTENCE& SENTENCE::operator += ( int value )
{
   char temp_string[ 80 ];

   ::sprintf( temp_string, "%d", value );

   Sentence += ",";
   Sentence += temp_string;

   return( *this );
}

const SENTENCE& SENTENCE::operator += ( EASTWEST easting )
{
   Sentence += ",";

   if ( easting == East )
   {
      Sentence += "E";
   }
   else if ( easting == West )
   {
      Sentence += "W";
   }

   return( *this );
}

const SENTENCE& SENTENCE::operator += ( NMEA0183_BOOLEAN boolean )
{
   Sentence += ",";

   if ( boolean == True )
   {
      Sentence += "A";
   }
   else if ( boolean == False )
   {
      Sentence += "V";
   }

   return( *this );
}

const SENTENCE& SENTENCE::operator += ( LATLONG& source )
{
   source.Write( *this );

   return( *this );
}

const SENTENCE& SENTENCE::operator += ( const CTime time )
{
   CString temp_string = time.Format( "%H%M%S" );

   Sentence += ",";
   Sentence += temp_string;

   return( *this );
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91看片淫黄大片一级在线观看| 色噜噜狠狠色综合中国| 亚洲裸体在线观看| 日韩精品一区二区三区在线播放| 成人黄色电影在线| 久久精品国产网站| 午夜精品久久久| 综合婷婷亚洲小说| 日本一区二区视频在线观看| 在线91免费看| 欧美亚一区二区| 成人av在线一区二区三区| 国内偷窥港台综合视频在线播放| 亚洲成人综合视频| 亚洲蜜臀av乱码久久精品蜜桃| 国产夜色精品一区二区av| 欧美一区二区三区在线电影| 欧美在线看片a免费观看| 成人精品视频一区| 国产91高潮流白浆在线麻豆 | 日韩美女天天操| 欧美性色欧美a在线播放| jizz一区二区| 成人免费毛片app| 国产乱码精品一区二区三区忘忧草 | 狠狠色狠狠色综合日日91app| 亚洲午夜久久久久久久久久久| 亚洲丝袜美腿综合| 亚洲欧美日韩综合aⅴ视频| 国产精品久久久久久户外露出| 久久精品夜色噜噜亚洲a∨| 精品成人佐山爱一区二区| 日韩欧美视频一区| 欧美一级理论片| 欧美一二三区精品| 欧美精品电影在线播放| 91精品在线观看入口| 欧美一区日本一区韩国一区| 91精品国产色综合久久| 制服丝袜激情欧洲亚洲| 欧美一区二区视频网站| 精品国产一二三区| 欧美精品一区二区三区久久久| 精品88久久久久88久久久| 久久久午夜精品理论片中文字幕| 精品国产露脸精彩对白| 国产网红主播福利一区二区| 国产人久久人人人人爽| 国产精品久久午夜| 亚洲日本丝袜连裤袜办公室| 一区二区三区在线视频播放| 亚洲成人自拍偷拍| 麻豆国产精品777777在线| 久久99日本精品| 国产精品一区二区视频| 成人激情图片网| 欧美手机在线视频| 日韩一区二区三区精品视频| 精品sm捆绑视频| 中文字幕一区二区三区色视频| 亚洲欧美日韩国产手机在线 | 一区二区三区不卡视频| 水野朝阳av一区二区三区| 久久国产精品99精品国产 | 亚洲一区在线视频| 奇米精品一区二区三区在线观看一| 男女视频一区二区| 高清国产午夜精品久久久久久| 91蜜桃网址入口| 欧美一卡2卡三卡4卡5免费| 久久精品无码一区二区三区| 亚洲视频狠狠干| 午夜国产精品影院在线观看| 国内精品伊人久久久久av一坑| 91丨九色丨尤物| 欧美一区三区二区| 亚洲欧美在线另类| 麻豆视频观看网址久久| 99精品桃花视频在线观看| 在线不卡一区二区| 中文一区在线播放| 蜜臀av性久久久久蜜臀av麻豆 | 欧美日韩午夜在线| 国产午夜一区二区三区| 五月天久久比比资源色| 懂色av一区二区在线播放| 欧美疯狂做受xxxx富婆| 中文字幕一区av| 国产一区二区视频在线播放| 日本精品一级二级| 久久精品一区蜜桃臀影院| 亚洲国产精品久久人人爱蜜臀| 国产麻豆视频精品| 91麻豆精品国产91久久久使用方法| 国产亚洲成aⅴ人片在线观看 | 日韩黄色在线观看| 99re这里只有精品6| 精品国产伦一区二区三区观看体验| 中文字幕色av一区二区三区| 视频一区视频二区中文字幕| av在线不卡免费看| 久久久天堂av| 奇米精品一区二区三区在线观看 | 丁香婷婷综合网| 日韩免费性生活视频播放| 亚洲狠狠爱一区二区三区| 懂色av一区二区三区免费看| 精品精品国产高清a毛片牛牛| 亚洲香蕉伊在人在线观| 91视频在线观看免费| 中文一区二区在线观看| 国产在线精品一区二区不卡了| 欧美一区二区视频在线观看2022| 亚洲综合视频网| 99国产麻豆精品| 国产精品视频第一区| 狠狠色狠狠色综合| 精品女同一区二区| 免费观看一级欧美片| 欧美伦理影视网| 亚洲国产精品久久一线不卡| 91福利国产成人精品照片| 最新久久zyz资源站| 99久久国产综合精品女不卡| 国产精品乱人伦中文| 国产成人av一区二区三区在线| 精品日产卡一卡二卡麻豆| 久久精品国产免费| 精品福利在线导航| 国产一区视频在线看| 337p粉嫩大胆色噜噜噜噜亚洲 | 麻豆免费精品视频| 日韩精品在线看片z| 久久不见久久见免费视频7| 日韩欧美电影一二三| 九九**精品视频免费播放| 日韩欧美国产麻豆| 国产一区二区三区免费看| 久久免费偷拍视频| 国产v综合v亚洲欧| 国产精品久久看| 91福利社在线观看| 亚洲bdsm女犯bdsm网站| 7777精品伊人久久久大香线蕉的| 亚洲成国产人片在线观看| 欧美一区二区三区在| 国内一区二区在线| 国产精品美女久久久久久久网站| 99久久精品国产观看| 亚洲国产精品久久久久婷婷884| 欧美日韩国产高清一区二区三区| 日本伊人午夜精品| 久久综合九色综合欧美98| 丰满白嫩尤物一区二区| 中文字幕一区二区三区视频| 欧美自拍偷拍午夜视频| 午夜欧美电影在线观看| 日韩精品一区在线| 成人ar影院免费观看视频| 亚洲另类中文字| 91精品国产品国语在线不卡| 国产精品一区专区| 亚洲欧美日韩系列| 91精品国产品国语在线不卡| 国产成人在线观看免费网站| 亚洲欧美激情小说另类| 91麻豆精品国产91久久久久 | 91精品国产日韩91久久久久久| 国内成+人亚洲+欧美+综合在线| 中文字幕成人av| 欧美精品九九99久久| 国产精品一区在线| 亚洲成人综合在线| 久久嫩草精品久久久精品一| 色嗨嗨av一区二区三区| 久草精品在线观看| 亚洲精品欧美专区| 日韩欧美成人午夜| 色素色在线综合| 国产精品一区二区久激情瑜伽| 亚洲精选视频免费看| 精品国产乱码久久久久久浪潮| 欧日韩精品视频| 国产精品自产自拍| 日韩一区欧美二区| 国产精品―色哟哟| 日韩欧美在线网站| 色老头久久综合| 高清不卡一区二区在线| 日韩精品91亚洲二区在线观看| 国产精品美女www爽爽爽| 日韩视频免费直播| 欧美亚洲精品一区| 波多野结衣在线aⅴ中文字幕不卡| 日韩综合在线视频| 伊人婷婷欧美激情| 国产精品私房写真福利视频| 精品少妇一区二区三区免费观看| 在线精品视频免费观看| 99免费精品在线观看|