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


C++ AtmosphericPressure::QNHAltitudeToStaticPressure方法代码示例

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


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

示例1: fabs

static bool
test_isa_pressure(const fixed alt, const fixed prat)
{
  AtmosphericPressure pres;
  fixed p0 = pres.QNHAltitudeToStaticPressure(alt);
  if (verbose) {
    printf("%g\n",FIXED_DOUBLE(p0));
  }
  return fabs(p0/fixed(101325)-prat)<fixed(0.001);
}
开发者ID:hnpilot,项目名称:XCSoar,代码行数:10,代码来源:test_pressure.cpp

示例2: fabs

static bool
test_isa_pressure(const fixed alt, const fixed prat)
{
  const AtmosphericPressure pres = AtmosphericPressure::Standard();
  fixed p0 = pres.QNHAltitudeToStaticPressure(alt).GetPascal();
  if (verbose) {
    printf("%g\n", double(p0));
  }
  return fabs(p0/fixed(101325)-prat)<fixed(0.001);
}
开发者ID:Adrien81,项目名称:XCSoar,代码行数:10,代码来源:test_pressure.cpp

示例3: if

static void
ComputePressure(NMEAInfo &basic, const AtmosphericPressure qnh)
{
  const bool qnh_available = qnh.IsPlausible();
  const bool static_pressure_available = basic.static_pressure_available;
  const bool pressure_altitude_available = basic.pressure_altitude_available;

  if (!static_pressure_available) {
    if (pressure_altitude_available) {
      basic.static_pressure =
        AtmosphericPressure::PressureAltitudeToStaticPressure(basic.pressure_altitude);
      basic.static_pressure_available = basic.pressure_altitude_available;
    } else if (basic.baro_altitude_available && qnh_available) {
      basic.static_pressure =
        qnh.QNHAltitudeToStaticPressure(basic.baro_altitude);
      basic.static_pressure_available = basic.baro_altitude_available;
    }
  }

  if (!pressure_altitude_available) {
    if (static_pressure_available) {
      basic.pressure_altitude =
        AtmosphericPressure::StaticPressureToPressureAltitude(basic.static_pressure);
      basic.pressure_altitude_available = basic.static_pressure_available;
    } else if (basic.baro_altitude_available && qnh_available) {
      basic.pressure_altitude =
        qnh.QNHAltitudeToPressureAltitude(basic.baro_altitude);
      basic.pressure_altitude_available = basic.baro_altitude_available;
    }
  }

  if (qnh_available) {
    /* if the current pressure and the QNH is known, then true baro
       altitude should be discarded, because the external device which
       provided it may have a different QNH setting */

    if (static_pressure_available) {
      basic.baro_altitude =
        qnh.StaticPressureToQNHAltitude(basic.static_pressure);
      basic.baro_altitude_available = basic.static_pressure_available;
    } else if (pressure_altitude_available) {
      basic.baro_altitude =
        qnh.PressureAltitudeToQNHAltitude(basic.pressure_altitude);
      basic.baro_altitude_available = basic.pressure_altitude_available;
    }
  } else if (!basic.baro_altitude_available && pressure_altitude_available)
    /* no QNH, but let's fill in the best fallback value we can get,
       without setting BaroAltitudeAvailable */
    basic.baro_altitude = basic.pressure_altitude;
}
开发者ID:rjsikarwar,项目名称:XCSoar,代码行数:50,代码来源:BasicComputer.cpp

示例4:

AtmosphericPressure
AtmosphericPressure::FindQNHFromPressure(const AtmosphericPressure pressure,
        const fixed alt_known)
{
    return pressure.QNHAltitudeToStaticPressure(-alt_known);
}
开发者ID:CnZoom,项目名称:XcSoarPull,代码行数:6,代码来源:Pressure.cpp


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