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


C++ NMEAParser::ParseNMEAString_Internal方法代码示例

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


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

示例1: ParseNMEAString

/**
 * Redirects parsing of the String into GPS_INFO to the right device parser
 * @param device 0 or 1, depending on the port used
 * @param String NMEA string
 * @param GPS_INFO GPS_INFO struct that will be updated
 * @return Parsing success
 */
bool NMEAParser::ParseNMEAString(int device, const TCHAR *String,
    NMEA_INFO *GPS_INFO) {
  switch (device) {
  case 0:
    return nmeaParser1.ParseNMEAString_Internal(String, GPS_INFO);
  case 1:
    return nmeaParser2.ParseNMEAString_Internal(String, GPS_INFO);
  };
  return false;
}
开发者ID:scottp,项目名称:xcsoar,代码行数:17,代码来源:Parser.cpp

示例2: ParseNMEAString

BOOL NMEAParser::ParseNMEAString(int device,
				 TCHAR *String, NMEA_INFO *GPS_INFO)
{
  switch (device) {
  case 0: 
    return nmeaParser1.ParseNMEAString_Internal(String, GPS_INFO);
  case 1:
    return nmeaParser2.ParseNMEAString_Internal(String, GPS_INFO);
  };
  return FALSE;
}
开发者ID:miza,项目名称:LK8000,代码行数:11,代码来源:Parser.cpp

示例3: ParseNMEAString

BOOL NMEAParser::ParseNMEAString(int device,
				 TCHAR *String, NMEA_INFO *pGPS)
{

  LKASSERT(!ReplayLogger::IsEnabled());

  switch (device) {
  case 0: 
    return nmeaParser1.ParseNMEAString_Internal(String, pGPS);
  case 1:
    return nmeaParser2.ParseNMEAString_Internal(String, pGPS);
  };
  return FALSE;
}
开发者ID:rkalman,项目名称:LK8000,代码行数:14,代码来源:Parser.cpp

示例4: sprintf

/**
 * This function creates some simulated traffic for FLARM debugging
 * @param GPS_INFO Pointer to the NMEA_INFO struct
 */
void
Simulator::GenerateFLARMTraffic(NMEAInfo &basic)
{
  static int i = 90;

  i++;
  if (i > 255)
    i = 0;

  if (i > 80)
    return;

  const Angle angle = Angle::degrees(fixed((i * 360) / 255)).as_bearing();
  Angle dangle = (angle + Angle::degrees(fixed(120))).as_bearing();
  Angle hangle = dangle.flipped().as_bearing();

  int alt = (angle.ifastsine()) / 7;
  int north = (angle.ifastsine()) / 2 - 200;
  int east = (angle.ifastcosine()) / 1.5;
  int track = -angle.as_bearing().value_degrees();
  unsigned alarm_level = (i % 30 > 13 ? 0 : (i % 30 > 5 ? 2 : 1));

  NMEAParser parser;
  char buffer[50];

  // PFLAA,<AlarmLevel>,<RelativeNorth>,<RelativeEast>,<RelativeVertical>,
  //   <IDType>,<ID>,<Track>,<TurnRate>,<GroundSpeed>,<ClimbRate>,<AcftType>
  sprintf(buffer, "$PFLAA,%d,%d,%d,%d,2,DDA85C,%d,0,35,0,1",
          alarm_level, north, east, alt, track);
  AppendNMEAChecksum(buffer);
  parser.ParseNMEAString_Internal(buffer, basic);

  alt = (angle.ifastcosine()) / 10;
  north = (dangle.ifastsine()) / 1.20 + 300;
  east = (dangle.ifastcosine()) + 500;
  track = hangle.value_degrees();

  // PFLAA,<AlarmLevel>,<RelativeNorth>,<RelativeEast>,<RelativeVertical>,
  //   <IDType>,<ID>,<Track>,<TurnRate>,<GroundSpeed>,<ClimbRate>,<AcftType>
  sprintf(buffer, "$PFLAA,0,%d,%d,%d,2,AA9146,,,,,1",
          north, east, alt);
  AppendNMEAChecksum(buffer);
  parser.ParseNMEAString_Internal(buffer, basic);

  // PFLAU,<RX>,<TX>,<GPS>,<Power>,<AlarmLevel>,<RelativeBearing>,<AlarmType>,
  //   <RelativeVertical>,<RelativeDistance>(,<ID>)
  sprintf(buffer, "$PFLAU,2,1,2,1,%d", alarm_level);
  AppendNMEAChecksum(buffer);
  parser.ParseNMEAString_Internal(buffer, basic);
}
开发者ID:macsux,项目名称:XCSoar,代码行数:54,代码来源:Simulator.cpp


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