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


C++ GlidePolar::GetBugs方法代码示例

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


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

示例1:

void
GlidePolarTest::TestBugs()
{
  polar.SetBugs(fixed(0.75));
  ok1(equals(polar.GetBugs(), 0.75));

  ok1(equals(polar.polar.a, polar.ideal_polar.a * 4 / 3));
  ok1(equals(polar.polar.b, polar.ideal_polar.b * 4 / 3));
  ok1(equals(polar.polar.c, polar.ideal_polar.c * 4 / 3));

  ok1(equals(polar.SinkRate(Units::ToSysUnit(fixed(80), Unit::KILOMETER_PER_HOUR)),
             0.808));
  ok1(equals(polar.SinkRate(Units::ToSysUnit(fixed(120), Unit::KILOMETER_PER_HOUR)),
             1.32));
  ok1(equals(polar.SinkRate(Units::ToSysUnit(fixed(160), Unit::KILOMETER_PER_HOUR)),
             2.557333));

  ok1(equals(polar.GetVMin(), 19.93464));
  ok1(equals(polar.GetVBestLD(), 25.83043));

  polar.SetBugs(fixed(1));
}
开发者ID:CnZoom,项目名称:XcSoarPull,代码行数:22,代码来源:TestGlidePolar.cpp

示例2: LoadDialog

void
dlgBasicSettingsShowModal()
{
  const ComputerSettings &settings = CommonInterface::GetComputerSettings();

  glide_polar = settings.glide_polar_task;

  wf = LoadDialog(CallBackTable, XCSoarInterface::main_window,
                      _T("IDR_XML_BASICSETTINGS"));
  if (wf == NULL)
    return;

  changed = false;

  wf->SetTimerNotify(OnTimerNotify);
  OnTimerNotify(*wf);

  SetButtons();

  SetBallast();
  LoadFormProperty(*wf, _T("prpBugs"), (fixed_one - glide_polar.GetBugs()) * 100);
  LoadFormProperty(*wf, _T("prpQNH"), Units::ToUserPressure(settings.pressure.GetHectoPascal()));

  WndProperty* wp;
  wp = (WndProperty*)wf->FindByName(_T("prpQNH"));
  if (wp) {
    DataFieldFloat &df = *(DataFieldFloat *)wp->GetDataField();

    df.SetMin(Units::ToUserPressure(Units::ToSysUnit(fixed(850), unHectoPascal)));
    df.SetMax(Units::ToUserPressure(Units::ToSysUnit(fixed(1300), unHectoPascal)));
    df.SetStep(Units::ToUserPressure(Units::ToSysUnit(fixed_one, unHectoPascal)));
    df.SetUnits(Units::GetPressureName());
    df.SetStep(Units::PressureStep());
    df.SetFormat( Units::GetFormatUserPressure());
    wp->RefreshDisplay();
}
  wp = (WndProperty*)wf->FindByName(_T("prpTemperature"));
  if (wp) {
    DataFieldFloat &df = *(DataFieldFloat *)wp->GetDataField();
    df.SetMin(Units::ToUserTemperature(Units::ToSysUnit(fixed(-50), unGradCelcius)));
    df.SetMax(Units::ToUserTemperature(Units::ToSysUnit(fixed(60), unGradCelcius)));
    df.SetUnits(Units::GetTemperatureName());
    df.Set(Units::ToUserTemperature(settings.forecast_temperature));
    wp->RefreshDisplay();
  }

  if (wf->ShowModal() == mrOK) {
    ComputerSettings &settings = CommonInterface::SetComputerSettings();

    if (changed) {
      settings.glide_polar_task = glide_polar;

      if (protected_task_manager != NULL)
        protected_task_manager->SetGlidePolar(glide_polar);
    }

    SaveFormProperty(*wf, _T("prpTemperature"),
                     ugTemperature, settings.forecast_temperature);
  }

  delete wf;
}
开发者ID:,项目名称:,代码行数:62,代码来源:


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