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


C++ NMEAInputLine::Skip方法代码示例

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


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

示例1: wind

static bool
PZAN3(NMEAInputLine &line, NMEAInfo &info)
{
  // old: $PZAN3,+,026,V,321,035,A,321,035,V*cc
  // new: $PZAN3,+,026,A,321,035,V[,A]*cc

  line.Skip(3);

  int direction, speed;
  if (!line.ReadChecked(direction) || !line.ReadChecked(speed))
    return false;

  char okay = line.ReadFirstChar();
  if (okay == 'V') {
    okay = line.ReadFirstChar();
    if (okay == 'V')
      return true;

    if (okay != 'A') {
      line.Skip();
      okay = line.ReadFirstChar();
    }
  }

  if (okay == 'A') {
    SpeedVector wind(Angle::Degrees(direction),
                     Units::ToSysUnit(fixed(speed), Unit::KILOMETER_PER_HOUR));
    info.ProvideExternalWind(wind);
  }

  return true;
}
开发者ID:CnZoom,项目名称:XcSoarPull,代码行数:32,代码来源:Zander.cpp

示例2: if

/**
 * $PWES1,DD,MM,S,AAA,F,V,LLL,BB*CS<CR><LF>
 */
static bool
PWES1(NMEAInputLine &line, NMEAInfo &info)
{
  line.Skip(); /* device */

  int i;
  if (line.ReadChecked(i))
    info.settings.ProvideMacCready(fixed(i) / 10, info.clock);

  info.switch_state.flight_mode = SwitchState::FlightMode::UNKNOWN;
  if (line.ReadChecked(i)) {
    if (i == 0)
      info.switch_state.flight_mode = SwitchState::FlightMode::CIRCLING;
    else if (i == 1)
      info.switch_state.flight_mode = SwitchState::FlightMode::CRUISE;
  }

  line.Skip(3);

  if (line.ReadChecked(i))
    info.settings.ProvideWingLoading(fixed(i) / 10, info.clock);

  if (line.ReadChecked(i))
    info.settings.ProvideBugs(fixed(100 - i) / 100, info.clock);

  return true;
}
开发者ID:CnZoom,项目名称:XcSoarPull,代码行数:30,代码来源:Westerboer.cpp

示例3: if

/**
 * $PWES1,DD,MM,S,AAA,F,V,LLL,BB*CS<CR><LF>
 */
static bool
PWES1(NMEAInputLine &line, NMEAInfo &info)
{
  line.Skip(); /* device */

  int i;
  if (line.ReadChecked(i))
    info.settings.ProvideMacCready(fixed(i) / 10, info.clock);

  if (line.ReadChecked(i)) {
    if (i == 0) {
      info.switch_state.flight_mode = SwitchInfo::FlightMode::CIRCLING;
      info.switch_state.speed_command = false;
      info.switch_state_available = true;
    } else if (i == 1) {
      info.switch_state.flight_mode = SwitchInfo::FlightMode::CRUISE;
      info.switch_state.speed_command = true;
      info.switch_state_available = true;
    }
  }

  line.Skip(3);

  if (line.ReadChecked(i))
    info.settings.ProvideWingLoading(fixed(i) / 10, info.clock);

  if (line.ReadChecked(i))
    info.settings.ProvideBugs(fixed(100 - i) / 100, info.clock);

  return true;
}
开发者ID:osteocool,项目名称:XCSoar-1,代码行数:34,代码来源:Westerboer.cpp

示例4:

static bool
ParseAPENV1(NMEAInputLine &line, NMEAInfo &info)
{
  // $APENV1,IAS,Altitude,0,0,0,VerticalSpeed,

  int ias;
  if (!line.ReadChecked(ias)) return false;

  int altitude;
  if (!line.ReadChecked(altitude)) return false;

  line.Skip();
  line.Skip();
  line.Skip();

  // In ft/min, quality of this is limited, do not use for the time being
  int vs;
  if (!line.ReadChecked(vs)) return false;

  auto sys_alt = Units::ToSysUnit(fixed(altitude), Unit::FEET);
  info.ProvidePressureAltitude(sys_alt);
  info.ProvideIndicatedAirspeedWithAltitude(Units::ToSysUnit(fixed(ias), Unit::KNOTS), sys_alt);

  return true;
}
开发者ID:kwtskran,项目名称:XCSoar,代码行数:25,代码来源:LevilAHRS_G.cpp

示例5: fixed

static bool
PTFRS(NMEAInputLine &line, NMEAInfo &info)
{
    // $PTFRS,1,0,0,0,0,0,0,0,5,1,10,0,3,1338313437,0,0,0,,,2*4E
    //
    // $PTFRS,<sealed>,<downloadmode>,<event>,<neartp>,<sealing>,<baromode>,
    //        <decllock>,<newrecavail>,<enl>,<rpm>,<interval>,<error>,<timbase>,
    //        <time>,<secpower>,<secpowerint>,<usup>,<ulit>,
    //        <chargerstate>,<antstate>*CS<CR><LF>

    line.Skip(8);

    unsigned enl;
    if (line.ReadChecked(enl)) {
        info.engine_noise_level = enl;
        info.engine_noise_level_available.Update(info.clock);
    }

    line.Skip(7);

    unsigned supply_voltage;
    if (line.ReadChecked(supply_voltage) && supply_voltage != 0) {
        info.voltage = fixed(supply_voltage) / 1000;
        info.voltage_available.Update(info.clock);
    }

    return true;
}
开发者ID:kedder,项目名称:xcsoar,代码行数:28,代码来源:AltairPro.cpp

示例6: CelsiusToKelvin

/**
 * Parse a "$VMVABD" sentence.
 *
 * Example: "$VMVABD,0000.0,M,0547.0,M,-0.0,,,MS,0.0,KH,22.4,C*65"
 */
static bool
FlytecParseVMVABD(NMEAInputLine &line, NMEAInfo &info)
{
  fixed value;

  // 0,1 = GPS altitude, unit
  if (line.ReadCheckedCompare(info.gps_altitude, "M"))
    info.gps_altitude_available.Update(info.clock);

  // 2,3 = baro altitude, unit
  if (line.ReadCheckedCompare(value, "M"))
    info.ProvideBaroAltitudeTrue(value);

  // 4-7 = integrated vario, unit
  line.Skip(4);

  // 8,9 = indicated or true airspeed, unit
  if (line.ReadCheckedCompare(value, "KH"))
    // XXX is that TAS or IAS?  Documentation isn't clear.
    info.ProvideBothAirspeeds(Units::ToSysUnit(value, Unit::KILOMETER_PER_HOUR));

  // 10,11 = temperature, unit
  info.temperature_available =
    line.ReadCheckedCompare(value, "C");
  if (info.temperature_available)
    info.temperature = CelsiusToKelvin(value);

  return true;
}
开发者ID:Adrien81,项目名称:XCSoar,代码行数:34,代码来源:Parser.cpp

示例7:

bool
NMEAParser::GSA(NMEAInputLine &line, NMEAInfo &info)
{
    /*
     * $--GSA,a,a,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x.x,x.x,x.x*hh
     *
     * Field Number:
     *  1) Selection mode
     *         M=Manual, forced to operate in 2D or 3D
     *         A=Automatic, 3D/2D
     *  2) Mode (1 = no fix, 2 = 2D fix, 3 = 3D fix)
     *  3) ID of 1st satellite used for fix
     *  4) ID of 2nd satellite used for fix
     *  ...
     *  14) ID of 12th satellite used for fix
     *  15) PDOP
     *  16) HDOP
     *  17) VDOP
     *  18) checksum
     */

    line.Skip();

    if (line.Read(0) == 1)
        info.location_available.Clear();

    // satellites are in items 4-15 of GSA string (4-15 is 1-indexed)
    for (unsigned i = 0; i < GPSState::MAXSATELLITES; i++)
        info.gps.satellite_ids[i] = line.Read(0);

    info.gps.satellite_ids_available.Update(info.clock);

    return true;
}
开发者ID:ThomasXBMC,项目名称:XCSoar,代码行数:34,代码来源:Parser.cpp

示例8: altitude

// RMN: Volkslogger
// Source data:
// $PGCS,1,0EC0,FFF9,0C6E,02*61
// $PGCS,1,0EC0,FFFA,0C6E,03*18
static bool
vl_PGCS1(NMEAInputLine &line, NMEAInfo &info)
{
  if (line.Read(1) != 1)
    return false;

  /* pressure sensor */
  line.Skip();

  // four characers, hex, barometric altitude
  unsigned u_altitude;
  if (line.ReadHexChecked(u_altitude)) {
    int altitude(u_altitude);
    if (altitude > 60000)
      /* Assuming that altitude has wrapped around.  60 000 m occurs
         at QNH ~2000 hPa */
      altitude -= 65535;

    info.ProvidePressureAltitude(fixed(altitude));
  }

  // ExtractParameter(String,ctemp,3);
  // four characters, hex, constant.  Value 1371 (dec)

  // nSatellites = (int)(min(12,HexStrToDouble(ctemp, NULL)));

  return false;
}
开发者ID:DRIZO,项目名称:xcsoar,代码行数:32,代码来源:Parser.cpp

示例9: SmallHypot

// $PDVDS,nx,nz,flap,stallratio,netto
static bool
PDVDS(NMEAInputLine &line, NMEAInfo &info)
{
  fixed AccelX = line.Read(fixed_zero);
  fixed AccelZ = line.Read(fixed_zero);

  fixed mag = SmallHypot(AccelX, AccelZ);
  info.acceleration.ProvideGLoad(fixed(mag) / 100, true);

  /*
  double flap = line.Read(0.0);
  */
  line.Skip();

  info.stall_ratio = line.Read(fixed_zero);
  info.stall_ratio_available.Update(info.clock);

  fixed value;
  if (line.ReadChecked(value))
    info.ProvideNettoVario(value / 10);

  //hasVega = true;

  return true;
}
开发者ID:alon,项目名称:xcsoar,代码行数:26,代码来源:Parser.cpp

示例10: IAS

static bool
LXWP0(NMEAInputLine &line, NMEAInfo &info)
{
  /*
  $LXWP0,Y,222.3,1665.5,1.71,,,,,,239,174,10.1

   0 loger_stored (Y/N)
   1 IAS (kph) ----> Condor uses TAS!
   2 baroaltitude (m)
   3-8 vario (m/s) (last 6 measurements in last second)
   9 heading of plane
  10 windcourse (deg)
  11 windspeed (kph)
  */

  line.Skip();

  fixed airspeed;
  bool tas_available = line.ReadChecked(airspeed);
  if (tas_available && (airspeed < fixed(-50) || airspeed > fixed(250)))
    /* implausible */
    return false;

  fixed value;
  if (line.ReadChecked(value))
    /* a dump on a LX7007 has confirmed that the LX sends uncorrected
       altitude above 1013.25hPa here */
    info.ProvidePressureAltitude(value);

  if (tas_available)
    /*
     * Call ProvideTrueAirspeed() after ProvidePressureAltitude() to use
     * the provided altitude (if available)
     */
    info.ProvideTrueAirspeed(Units::ToSysUnit(airspeed, Unit::KILOMETER_PER_HOUR));

  if (line.ReadChecked(value))
    info.ProvideTotalEnergyVario(value);

  line.Skip(6);

  SpeedVector wind;
  if (ReadSpeedVector(line, wind))
    info.ProvideExternalWind(wind);

  return true;
}
开发者ID:kwtskran,项目名称:XCSoar,代码行数:47,代码来源:Parser.cpp

示例11: ReadString

static void
ParseNanoInfo(NMEAInputLine &line, DeviceInfo &device)
{
  ReadString(line, device.product);
  ReadString(line, device.software_version);
  line.Skip(); /* ver.date, e.g. "May 12 2012 21:38:28" */
  ReadString(line, device.hardware_version);
}
开发者ID:kwtskran,项目名称:XCSoar,代码行数:8,代码来源:Parser.cpp

示例12: IAS

static bool
cLXWP0(NMEAInputLine &line, NMEAInfo &info)
{
  /*
  $LXWP0,Y,222.3,1665.5,1.71,,,,,,239,174,10.1

   0 logger_stored (Y/N)
   1 IAS (kph) ----> Condor uses TAS!
   2 baroaltitude (m)
   3 vario (m/s)
   4-8 unknown
   9 heading of plane
  10 windcourse (deg)
  11 windspeed (kph)
  */

  fixed value;

  line.Skip();

  fixed airspeed;
  bool tas_available = line.ReadChecked(airspeed);

  fixed alt = line.Read(fixed_zero);

  if (tas_available)
    info.ProvideTrueAirspeedWithAltitude(Units::ToSysUnit(airspeed,
                                                               Unit::KILOMETER_PER_HOUR),
                                              alt);

  // ToDo check if QNH correction is needed!
  info.ProvideBaroAltitudeTrue(alt);

  if (line.ReadChecked(value))
    info.ProvideTotalEnergyVario(value);

  line.Skip(6);

  SpeedVector wind;
  if (ReadSpeedVector(line, wind))
    info.ProvideExternalWind(wind);

  return true;
}
开发者ID:alon,项目名称:xcsoar,代码行数:44,代码来源:Condor.cpp

示例13:

static bool
GPWIN(NMEAInputLine &line, NMEAInfo &info)
{
  line.Skip(2);

  fixed value;
  if (line.ReadChecked(value))
    info.ProvidePressureAltitude(value / 10);

  return false;
}
开发者ID:Tjeerdm,项目名称:XCSoarDktjm,代码行数:11,代码来源:PosiGraph.cpp

示例14:

void
ParsePFLAU(NMEAInputLine &line, FlarmStatus &flarm, double clock)
{
    flarm.available.Update(clock);

    // PFLAU,<RX>,<TX>,<GPS>,<Power>,<AlarmLevel>,<RelativeBearing>,<AlarmType>,
    //   <RelativeVertical>,<RelativeDistance>(,<ID>)
    flarm.rx = line.Read(0);
    flarm.tx = line.Read(false);
    flarm.gps = (FlarmStatus::GPSStatus)
                line.Read((int)FlarmStatus::GPSStatus::NONE);

    line.Skip();
    flarm.alarm_level = (FlarmTraffic::AlarmType)
                        line.Read((int)FlarmTraffic::AlarmType::NONE);
}
开发者ID:ahsparrow,项目名称:xcsoar,代码行数:16,代码来源:StaticParser.cpp

示例15: fixed

bool
NMEAParser::PTAS1(NMEAInputLine &line, NMEAInfo &info)
{
    /*
     * $PTAS1,xxx,yyy,zzzzz,aaa*CS<CR><LF>
     *
     * xxx
     * CV or current vario. =vario*10+200 range 0-400(display +/-20.0 knots)
     *
     * yyy
     * AV or average vario. =vario*10+200 range 0-400(display +/-20.0 knots)
     *
     * zzzzz
     * Barometric altitude in feet +2000
     *
     * aaa
     * TAS knots 0-200
     */

    // Parse current vario data
    fixed vario;
    if (line.ReadChecked(vario)) {
        // Properly convert to m/s
        vario = Units::ToSysUnit((vario - fixed(200)) / 10, Unit::KNOTS);
        info.ProvideTotalEnergyVario(vario);
    }

    // Skip average vario data
    line.Skip();

    // Parse barometric altitude
    fixed baro_altitude;
    if (line.ReadChecked(baro_altitude)) {
        // Properly convert to meter
        baro_altitude = Units::ToSysUnit(baro_altitude - fixed(2000), Unit::FEET);
        info.ProvidePressureAltitude(baro_altitude);
    }

    // Parse true airspeed
    fixed vtas;
    if (line.ReadChecked(vtas))
        info.ProvideTrueAirspeed(Units::ToSysUnit(vtas, Unit::KNOTS));

    return true;
}
开发者ID:ThomasXBMC,项目名称:XCSoar,代码行数:45,代码来源:Parser.cpp


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