本文整理汇总了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));
}
示例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;
}