当前位置: 首页>>代码示例>>C++>>正文


C++ SENTENCE类代码示例

本文整理汇总了C++中SENTENCE的典型用法代码示例。如果您正苦于以下问题:C++ SENTENCE类的具体用法?C++ SENTENCE怎么用?C++ SENTENCE使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了SENTENCE类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Parse

BOOL HSC::Parse( const SENTENCE& sentence )
{
   ASSERT_VALID( this );

   /*
   ** HSC - Heading Steering Command
   **
   **        1   2 3   4  5
   **        |   | |   |  |
   ** $--HSC,x.x,T,x.x,M,*hh<CR><LF>
   **
   ** Field Number: 
   **  1) Heading Degrees, True
   **  2) T = True
   **  3) Heading Degrees, Magnetic
   **  4) M = Magnetic
   **  5) Checksum
   */

   /*
   ** First we check the checksum...
   */

   if ( sentence.IsChecksumBad( 5 ) == True )
   {
      SetErrorMessage( "Invalid Checksum" );
      return( FALSE );
   } 

   DegreesTrue     = sentence.Double( 1 );
   DegreesMagnetic = sentence.Double( 3 );

   return( TRUE );
}
开发者ID:mikejwatts,项目名称:epl_pi,代码行数:34,代码来源:hsc.cpp

示例2: Parse

BOOL ZTG::Parse( const SENTENCE& sentence )
{
   ASSERT_VALID( this );

   /*
   ** ZTG - UTC & Time to Destination Waypoint
   **
   **        1         2         3    4
   **        |         |         |    |
   ** $--ZTG,hhmmss.ss,hhmmss.ss,c--c*hh<CR><LF>
   **
   ** Fields:
   **  1) Universal Time Coordinated (UTC)
   **  2) Time Remaining
   **  3) Destination Waypoint ID
   **  4) Checksum
   */

   /*
   ** First we check the checksum...
   */

   if ( sentence.IsChecksumBad( 4 ) == True )
   {
      SetErrorMessage( "Invalid Checksum" );
      return( FALSE );
   } 

   UTCTime       = sentence.Field( 1 );
   TimeRemaining = sentence.Field( 2 );
   To            = sentence.Field( 3 );

   return( TRUE );
}
开发者ID:mikejwatts,项目名称:epl_pi,代码行数:34,代码来源:ztg.cpp

示例3: Parse

bool HDM::Parse( const SENTENCE& sentence )
{
   /*
   ** HDM - Heading - Deviation & Variation
   **
   **        1   2 3
   **        |   | |
   ** $--HDM,x.x,M*hh<CR><LF>
   **
   ** Field Number: 
   **  1) Heading in degrees
   **  2) M, Magnetic Deviation
   **  3) Checksum
   */

   /*
   ** First we check the checksum...
   */

   if ( sentence.IsChecksumBad( 3 ) == True )
   {
      SetErrorMessage( "Invalid Checksum" );
      return( false );
   } 

   HeadingDegrees = sentence.Double( 1 );

   return( true );
}
开发者ID:SammyB428,项目名称:NMEA0183,代码行数:29,代码来源:HDM.CPP

示例4: Parse

bool MTW::Parse( const SENTENCE& sentence )
{
//   ASSERT_VALID( this );

   /*
   ** MTW - Water Temperature
   **
   **        1   2 3
   **        |   | | 
   ** $--MTW,x.x,C*hh<CR><LF>
   **
   ** Field Number: 
   **  1) Degrees
   **  2) Unit of Measurement, Celcius
   **  3) Checksum
   */

   /*
   ** First we check the checksum...
   */

   if ( sentence.IsChecksumBad( 3 ) == TRUE )
   {
      SetErrorMessage( _T("Invalid Checksum") );
      return( FALSE );
   } 

   Temperature       = sentence.Double( 1 );
   UnitOfMeasurement = sentence.Field( 2 );

   return( TRUE );
}
开发者ID:JONA-GA,项目名称:connectorga_pi,代码行数:32,代码来源:mtw.cpp

示例5: Parse

bool WDR::Parse( const SENTENCE& sentence )
{
   /*
   ** WDR - Distance to Waypoint, Rhumb Line
   **
   **        1   2 3    4
   **        |   | |    |
   ** $--WDR,x.x,N,c--c*hh<CR><LF>
   **
   ** 1) Distance to waypoint
   ** 2) N = Nautical Miles
   ** 3) Waypoint ID (To)
   ** 4) Checksum
   */

   /*
   ** First we check the checksum...
   */

   if ( sentence.IsChecksumBad( 4 ) == True )
   {
      SetErrorMessage( "Invalid Checksum" );
      return( false );
   }

   NauticalMiles = sentence.Double( 1 );
   To            = sentence.Field( 3 );

   return( true );
}
开发者ID:SammyB428,项目名称:NMEA0183,代码行数:30,代码来源:WDR.CPP

示例6: Write

bool APB::Write( SENTENCE& sentence )
{
//   ASSERT_VALID( this );

   /*
   ** Let the parent do its thing
   */
   
   RESPONSE::Write( sentence );

   sentence += IsLoranBlinkOK;
   sentence += IsLoranCCycleLockOK;
   sentence.Add( CrossTrackErrorMagnitude, g_NMEAAPBPrecision);

   if(DirectionToSteer == Left)
       sentence += _T("L");
   else
       sentence += _T("R");
   
   sentence += CrossTrackUnits;
   sentence += IsArrivalCircleEntered;
   sentence += IsPerpendicular;
   sentence.Add( BearingOriginToDestination, g_NMEAAPBPrecision);
   sentence += BearingOriginToDestinationUnits;
   sentence += To;
   sentence.Add( BearingPresentPositionToDestination, g_NMEAAPBPrecision );
   sentence += BearingPresentPositionToDestinationUnits;
   sentence.Add( HeadingToSteer, g_NMEAAPBPrecision );
   sentence += HeadingToSteerUnits;

   sentence.Finish();

   return( TRUE );
}
开发者ID:AluOne,项目名称:OpenCPN,代码行数:34,代码来源:apb.cpp

示例7: Parse

bool HDT::Parse( const SENTENCE& sentence )
{

   /*
   ** HDT - Heading - True
   **
   **        1   2 3
   **        |   | |
   ** $--HDT,x.x,T*hh<CR><LF>
   **
   ** Field Number:
   **  1) Heading Degrees, TRUE
   **  2) T = True
   **  3) Checksum
   */

   /*
   ** First we check the checksum...
   */

   if ( sentence.IsChecksumBad( 3 ) == TRUE )
   {
      SetErrorMessage( _T("Invalid Checksum") );
      return( FALSE );
   }

   DegreesTrue = sentence.Double( 1 );

   return( TRUE );
}
开发者ID:AluOne,项目名称:OpenCPN,代码行数:30,代码来源:hdt.cpp

示例8: Parse

BOOL STN::Parse( const SENTENCE& sentence )
{
   ASSERT_VALID( this );

   /*
   ** STN - Multiple Data ID
   **
   **        1   2
   **        |   |
   ** $--STN,x.x,*hh<CR><LF>
   **
   ** Field Number: 
   **  1) Talker ID Number
   **  2) Checksum
   */

   /*
   ** First we check the checksum...
   */

   if ( sentence.IsChecksumBad( 2 ) == True )
   {
      SetErrorMessage( "Invalid Checksum" );
      return( FALSE );
   } 

   TalkerIDNumber   = sentence.Integer( 1 );

   return( TRUE );
}
开发者ID:mikejwatts,项目名称:epl_pi,代码行数:30,代码来源:stn.cpp

示例9: Parse

bool VPW::Parse( const SENTENCE& sentence )
{
   /*
   ** VPW - Speed - Measured Parallel to Wind
   **
   **        1   2 3   4 5
   **        |   | |   | |
   ** $--VPW,x.x,N,x.x,M*hh<CR><LF>
   **
   ** Field Number: 
   **  1) Speed, "-" means downwind
   **  2) N = Knots
   **  3) Speed, "-" means downwind
   **  4) M = Meters per second
   **  5) Checksum
   */

   /*
   ** First we check the checksum...
   */

   if ( sentence.IsChecksumBad( 5 ) == True )
   {
      SetErrorMessage( "Invalid Checksum" );
      return( false );
   } 

   Knots           = sentence.Double( 1 );
   MetersPerSecond = sentence.Double( 3 );

   return( true );
}
开发者ID:SammyB428,项目名称:NMEA0183,代码行数:32,代码来源:VPW.CPP

示例10: Parse

bool DPT::Parse( const SENTENCE& sentence )
{
//   ASSERT_VALID( this );

   /*
   ** DPT - Heading - Deviation & Variation
   **
   **        1   2   3
   **        |   |   |
   ** $--DPT,x.x,x.x*hh<CR><LF>
   **
   ** Field Number: 
   **  1) Depth, meters
   **  2) Offset from transducer, 
   **     positive means distance from tansducer to water line
   **     negative means distance from transducer to keel
   **  3) Checksum
   */

   /*
   ** First we check the checksum...
   */

   if ( sentence.IsChecksumBad( 3 ) == TRUE )
   {
      SetErrorMessage( _T("Invalid Checksum") );
      return( FALSE );
   } 

   DepthMeters                = sentence.Double( 1 );
   OffsetFromTransducerMeters = sentence.Double( 2 );

   return( TRUE );
}
开发者ID:AluOne,项目名称:OpenCPN,代码行数:34,代码来源:dpt.cpp

示例11: Parse

bool VWE::Parse( const SENTENCE& sentence )
{
   /*
   ** VWE - Wind Track Efficiency
   **
   **        1   2
   **        |   |
   ** $--VWE,x.x,*hh<CR><LF>
   **
   ** Field Number: 
   **  1) Efficiency, Percent
   **  2) Checksum
   */

   /*
   ** First we check the checksum...
   */

   if ( sentence.IsChecksumBad( 2 ) == True )
   {
      SetErrorMessage( "Invalid Checksum" );
      return( false );
   } 

   EfficiencyPercent = sentence.Integer( 1 );

   return( true );
}
开发者ID:SammyB428,项目名称:NMEA0183,代码行数:28,代码来源:VWE.CPP

示例12: Parse

bool GPWPL::Parse( const SENTENCE& sentence )
{

   /*
   ** WPL - Waypoint Location
   **
   **        +-------------------------------- 1) Latitude
   **        |       +------------------------ 2) N or S (North or South)
   **        |       | +---------------------- 3) Longitude
   **        |       | |        +------------- 4) E or W (East or West)
   **        |       | |        | +----------- 5) Waypoint name
   **        |       | |        | |    +-------6) Checksum
   **        |       | |        | |    |
   ** $--WPL,llll.ll,a,yyyyy.yy,a,c--c*hh<CR><LF>
   */

   /*
   ** First we check the checksum...
   */

   if ( sentence.IsChecksumBad( 6 ) == NTrue )
   {
      SetErrorMessage( _T("Invalid Checksum") );
      return( FALSE );
   }

   Position.Parse( 1, 2, 3, 4, sentence );
   To = sentence.Field( 5 );

   return( TRUE );
}
开发者ID:AluOne,项目名称:OpenCPN,代码行数:31,代码来源:GPwpl.cpp

示例13: Parse

bool HDM::Parse( const SENTENCE& sentence )
{

   /*
   ** HDM - Heading - Magnetic
   **
   **        1   2 3
   **        |   | |
   ** $--HDM,x.x,M*hh<CR><LF>
   **
   ** Field Number:
   **  1) Heading Degrees, Magnetic
   **  2) M = Magnetic
   **  3) Checksum
   */

   /*
   ** First we check the checksum...
   */

   if ( sentence.IsChecksumBad( 3 ) == TRUE )
   {
      SetErrorMessage( _T("Invalid Checksum") );
      return( FALSE );
   }

   DegreesMagnetic = sentence.Double( 1 );

   return( TRUE );
}
开发者ID:JONA-GA,项目名称:connectorga_pi,代码行数:30,代码来源:hdm.cpp

示例14: Parse

bool GTD::Parse( const SENTENCE& sentence )
{
   /*
   ** GTD - Geographical Position, Loran-C TDs
   **
   **        1   2   3   4   5   6
   **        |   |   |   |   |   |
   ** $--GTD,x.x,x.x,x.x,x,x,x.x*hh<CR><LF>
   **
   **  1) Time Difference 1 Microseconds
   **  2) Time Difference 2 Microseconds
   **  3) Time Difference 3 Microseconds
   **  4) Time Difference 4 Microseconds
   **  5) Time Difference 5 Microseconds
   **  6) Checksum
   */

   /*
   ** First we check the checksum...
   */

   if ( sentence.IsChecksumBad( 6 ) == True )
   {
      SetErrorMessage( "Invalid Checksum" );
      return( false );
   } 

   TimeDifference1 = sentence.Field( 1 );
   TimeDifference2 = sentence.Field( 2 );
   TimeDifference3 = sentence.Field( 3 );
   TimeDifference4 = sentence.Field( 4 );
   TimeDifference5 = sentence.Field( 5 );

   return( true );
}
开发者ID:SammyB428,项目名称:NMEA0183,代码行数:35,代码来源:GTD.CPP

示例15: Parse

bool TEP::Parse( const SENTENCE& sentence )
{
   /*
   ** TEP - TRANSIT Satellite Predicted Elevation
   **
   **        1   2 3
   **        |   | |
   ** $--TEP,x.x,T*hh<CR><LF>
   **
   ** Field Number: 
   **  1) Elevation degrees
   **  2) D = Degrees
   **  3) Checksum
   */

   /*
   ** First we check the checksum...
   */

   if ( sentence.IsChecksumBad( 3 ) == True )
   {
      SetErrorMessage( "Invalid Checksum" );
      return( false );
   } 

   ElevationDegrees = sentence.Double( 1 );

   return( true );
}
开发者ID:SammyB428,项目名称:NMEA0183,代码行数:29,代码来源:TEP.CPP


注:本文中的SENTENCE类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。