コード例 #1
0
ファイル: Flytec.cpp プロジェクト: galippi/xcsoar
/**
 * 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;
}
コード例 #2
0
/**
 * 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;
}
コード例 #3
0
ファイル: Flytec.cpp プロジェクト: mobotics/XCSoar
/**
 * 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;
}
コード例 #4
0
ファイル: Flytec.cpp プロジェクト: galippi/xcsoar
/**
 * Parse a "$BRSF" sentence.
 *
 * Example: "$BRSF,063,-013,-0035,1,193,00351,535,485*38"
 */
static bool
FlytecParseBRSF(NMEAInputLine &line, NMEA_INFO &info, bool enable_baro)
{
  fixed value;

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

  // 1 = integrated vario [dm/s]
  // 2 = altitude A2 [m] (XXX what's this?)
  // 3 = waypoint
  // 4 = bearing to waypoint [degrees]
  // 5 = distance to waypoint [100m]
  // 6 = MacCready speed to fly [100m/h]
  // 7 = speed to fly, best glide [100m/h]

  return true;
}