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


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

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


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

示例1: 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.read_checked(i))
    info.settings.ProvideMacCready(fixed(i) / 10, info.clock);

  if (line.read_checked(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.read_checked(i))
    info.settings.ProvideWingLoading(fixed(i) / 10, info.clock);

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

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

示例2:

/**
 * 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, NMEA_INFO &info)
{
  fixed value;

  // 0,1 = GPS altitude, unit
  if (line.read_checked_compare(info.GPSAltitude, "M"))
    info.GPSAltitudeAvailable.Update(info.clock);

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

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

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

  // 10,11 = temperature, unit
  info.TemperatureAvailable =
    line.read_checked_compare(value, "C");
  if (info.TemperatureAvailable)
    info.OutsideAirTemperature = Units::ToSysUnit(value, unGradCelcius);

  return true;
}
开发者ID:joachimwieland,项目名称:xcsoar-jwieland,代码行数:34,代码来源:Flytec.cpp

示例3:

/**
 * 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, NMEA_INFO &info, bool enable_baro)
{
  fixed value;

  // 0,1 = GPS altitude, unit
  line.read_checked_compare(info.GPSAltitude, "M");

  // 2,3 = baro altitude, unit
  bool available = line.read_checked_compare(value, "M");
  if (enable_baro) {
    if (available)
      info.BaroAltitude = value;
    info.BaroAltitudeAvailable = available;
  }

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

  // 8,9 = indicated or true airspeed, unit
  info.AirspeedAvailable = line.read_checked_compare(value, "KH");
  if (info.AirspeedAvailable) {
    // XXX is that TAS or IAS?  Documentation isn't clear.
    info.TrueAirspeed = Units::ToSysUnit(value, unKiloMeterPerHour);
    info.IndicatedAirspeed = info.TrueAirspeed;
  }

  // 10,11 = temperature, unit
  info.TemperatureAvailable =
    line.read_checked_compare(value, "C");
  if (info.TemperatureAvailable)
    info.OutsideAirTemperature = Units::ToSysUnit(value, unGradCelcius);

  return true;
}
开发者ID:galippi,项目名称:xcsoar,代码行数:40,代码来源:Flytec.cpp

示例4: 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.read_checked_compare(info.gps_altitude, "M"))
    info.gps_altitude_available.Update(info.clock);

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

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

  // 8,9 = indicated or true airspeed, unit
  if (line.read_checked_compare(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.read_checked_compare(value, "C");
  if (info.temperature_available)
    info.temperature = CelsiusToKelvin(value);

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

示例5:

// $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);

  int mag = (int)hypot(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.read_checked(value))
    info.ProvideNettoVario(value / 10);

  //hasVega = true;

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

示例6: fixed

static bool
LXWP2(NMEAInputLine &line, NMEA_INFO *GPS_INFO)
{
  /*
   * $LXWP2,
   * maccready value, (m/s)
   * ballast, (1.0 - 1.5)
   * bugs, (0 - 100%)
   * polar_a,
   * polar_b,
   * polar_c,
   * audio volume
   */

  fixed value;
  // MacCready value
  if (line.read_checked(value))
    GPS_INFO->MacCready = value;

  // Ballast
  line.skip();
  /*
  if (line.read_checked(value))
    GPS_INFO->Ballast = value;
  */

  // Bugs
  if (line.read_checked(value))
    GPS_INFO->Bugs = fixed(100) - value;

  return true;
}
开发者ID:hnpilot,项目名称:XCSoar,代码行数:32,代码来源:LX.cpp

示例7:

/**
 * Parses a PFLAU sentence
 * (Operating status and priority intruder and obstacle data)
 * @param String Input string
 * @param params Parameter array
 * @param nparams Number of parameters
 * @param GPS_INFO GPS_INFO struct to parse into
 * @return Parsing success
 * @see http://flarm.com/support/manual/FLARM_DataportManual_v4.06E.pdf
 */
bool
NMEAParser::PFLAU(NMEAInputLine &line, FLARM_STATE &flarm)
{
  static int old_flarm_rx = 0;

  flarm.FLARM_Available = true;
  isFlarm = true;

  // PFLAU,<RX>,<TX>,<GPS>,<Power>,<AlarmLevel>,<RelativeBearing>,<AlarmType>,
  //   <RelativeVertical>,<RelativeDistance>(,<ID>)
  flarm.FLARM_RX = line.read(0);
  flarm.FLARM_TX = line.read(0);
  flarm.FLARM_GPS = line.read(0);
  line.skip();
  flarm.FLARM_AlarmLevel = line.read(0);

  // process flarm updates

  if (flarm.FLARM_RX && old_flarm_rx == 0)
    // traffic has appeared..
    InputEvents::processGlideComputer(GCE_FLARM_TRAFFIC);

  if (flarm.FLARM_RX == 0 && old_flarm_rx)
    // traffic has disappeared..
    InputEvents::processGlideComputer(GCE_FLARM_NOTRAFFIC);

  // TODO feature: add another event for new traffic.

  old_flarm_rx = flarm.FLARM_RX;

  return false;
}
开发者ID:Plantain,项目名称:XCSoar,代码行数:42,代码来源:Parser.cpp

示例8:

static bool
LXWP2(NMEAInputLine &line, NMEA_INFO *GPS_INFO)
{
  /*
   * $LXWP2,
   * maccready value, (m/s)
   * ballast, (1.0 - 1.5)
   * bugs, (0 - 100%)
   * polar_a,
   * polar_b,
   * polar_c,
   * audio volume
   */

  fixed value;
  // MacCready value
  if (line.read_checked(value))
    GPS_INFO->settings.ProvideMacCready(value, GPS_INFO->Time);

  // Ballast
  line.skip();
  /*
  if (line.read_checked(value))
    GPS_INFO->ProvideBallast(value, GPS_INFO->Time);
  */

  // Bugs
  if (line.read_checked(value))
    GPS_INFO->settings.ProvideBugs((fixed(100) - value) / 100, GPS_INFO->Time);

  return true;
}
开发者ID:Mrdini,项目名称:XCSoar,代码行数:32,代码来源:LX.cpp

示例9: fixed

/**
 * $PWES0,DD,VVVV,MMMM,NNNN,BBBB,SSSS,AAAAA,QQQQQ,IIII,TTTT,UUU,CCC*CS<CR><LF>
 */
static bool
PWES0(NMEAInputLine &line, NMEAInfo &info)
{
    int i, k;

    line.skip(); /* device */

    if (line.read_checked(i))
        info.ProvideTotalEnergyVario(fixed(i) / 10);

    line.skip(); /* average vario */

    if (line.read_checked(i))
        info.ProvideNettoVario(fixed(i) / 10);

    line.skip(); /* average netto vario */
    line.skip(); /* speed to fly */

    if (line.read_checked(i))
        info.ProvidePressureAltitude(fixed(i));

    if (line.read_checked(i))
        info.ProvideBaroAltitudeTrue(fixed(i));

    bool have_ias = line.read_checked(i);
    bool have_tas = line.read_checked(k);
    if (have_ias && have_tas)
        info.ProvideBothAirspeeds(Units::ToSysUnit(fixed(i) / 10,
                                  unKiloMeterPerHour),
                                  Units::ToSysUnit(fixed(k) / 10,
                                          unKiloMeterPerHour));

    if (line.read_checked(i)) {
        info.voltage = fixed(i) / 10;
        info.voltage_available.Update(info.clock);
    }

    if (line.read_checked(i)) {
        info.temperature = Units::ToSysUnit(fixed(i) / 10, unGradCelcius);
        info.temperature_available = true;
    }

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

示例10: IAS

static bool
LXWP0(NMEAInputLine &line, NMEA_INFO *GPS_INFO, bool enable_baro)
{
  /*
  $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;
  GPS_INFO->AirspeedAvailable = line.read_checked(airspeed);

  fixed alt = line.read(fixed_zero);

  if (GPS_INFO->AirspeedAvailable) {
    GPS_INFO->TrueAirspeed = Units::ToSysUnit(airspeed, unKiloMeterPerHour);
    GPS_INFO->IndicatedAirspeed =
      GPS_INFO->TrueAirspeed / AtmosphericPressure::AirDensityRatio(alt);
  }

  if (enable_baro) {
    GPS_INFO->BaroAltitudeAvailable = true;
    GPS_INFO->BaroAltitude = alt; // ToDo check if QNH correction is needed!
  }

  GPS_INFO->TotalEnergyVarioAvailable =
    line.read_checked(GPS_INFO->TotalEnergyVario);

  line.skip(6);

  GPS_INFO->ExternalWindAvailable = ReadSpeedVector(line, GPS_INFO->wind);

  TriggerVarioUpdate();

  return true;
}
开发者ID:hnpilot,项目名称:XCSoar,代码行数:44,代码来源:LX.cpp

示例11: IAS

static bool
LXWP0(NMEAInputLine &line, NMEA_INFO *GPS_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)
  */

  fixed value;

  line.skip();

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

  fixed alt = fixed_zero;
  if (line.read_checked(alt))
    /* a dump on a LX7007 has confirmed that the LX sends uncorrected
       altitude above 1013.25hPa here */
    GPS_INFO->ProvidePressureAltitude(alt);

  if (tas_available)
    GPS_INFO->ProvideTrueAirspeedWithAltitude(Units::ToSysUnit(airspeed,
                                              unKiloMeterPerHour),
                                              alt);

  if (line.read_checked(value))
    GPS_INFO->ProvideTotalEnergyVario(value);

  line.skip(6);

  SpeedVector wind;
  if (ReadSpeedVector(line, wind))
    GPS_INFO->ProvideExternalWind(wind);

  return true;
}
开发者ID:Mrdini,项目名称:XCSoar,代码行数:44,代码来源:LX.cpp

示例12:

/**
 * $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.read_checked(i))
        info.settings.ProvideMacCready(fixed(i) / 10, info.clock);

    line.skip(4);

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

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

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

示例13:

static bool
GPWIN(NMEAInputLine &line, NMEA_INFO *GPS_INFO)
{
  line.skip(2);

  fixed value;
  if (line.read_checked(value))
    GPS_INFO->ProvidePressureAltitude(value / 10);

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

示例14:

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

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

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

示例15: fixed

/*
!w,<1>,<2>,<3>,<4>,<5>,<6>,<7>,<8>,<9>,<10>,<11>,<12>,<13>*hh<CR><LF>
<1>  Vector wind direction in degrees
<2>  Vector wind speed in 10ths of meters per second
<3>  Vector wind age in seconds
<4>  Component wind in 10ths of Meters per second + 500 (500 = 0, 495 = 0.5 m/s tailwind)
<5>  True altitude in Meters + 1000
<6>  Instrument QNH setting
<7>  True airspeed in 100ths of Meters per second
<8>  Variometer reading in 10ths of knots + 200
<9>  Averager reading in 10ths of knots + 200
<10> Relative variometer reading in 10ths of knots + 200
<11> Instrument MacCready setting in 10ths of knots
<12> Instrument Ballast setting in percent of capacity
<13> Instrument Bug setting
*hh  Checksum, XOR of all bytes
*/
static bool
cai_w(NMEAInputLine &line, NMEAInfo &info)
{
  SpeedVector wind;
  if (ReadSpeedVector(line, wind))
    info.ProvideExternalWind(wind.Reciprocal());

  line.skip(2);

  fixed value;
  if (line.read_checked(value))
    info.ProvideBaroAltitudeTrue(value - fixed(1000));

  if (line.read_checked(value))
    info.settings.ProvideQNH(value, info.clock);

  if (line.read_checked(value))
    info.ProvideTrueAirspeed(value / 100);

  if (line.read_checked(value))
    info.ProvideTotalEnergyVario(Units::ToSysUnit((value - fixed(200)) / 10,
                                                  unKnots));

  line.skip(2);

  int i;

  if (line.read_checked(i))
    info.settings.ProvideMacCready(Units::ToSysUnit(fixed(i) / 10, unKnots),
                                   info.clock);

  if (line.read_checked(i))
    info.settings.ProvideBallastFraction(fixed(i) / 100, info.clock);

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

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


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