本文整理汇总了C++中GlidePolar::GetAverageSpeed方法的典型用法代码示例。如果您正苦于以下问题:C++ GlidePolar::GetAverageSpeed方法的具体用法?C++ GlidePolar::GetAverageSpeed怎么用?C++ GlidePolar::GetAverageSpeed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GlidePolar
的用法示例。
在下文中一共展示了GlidePolar::GetAverageSpeed方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: chart
void
RenderMacCready(Canvas &canvas, const PixelRect rc,
const ChartLook &chart_look,
const GlidePolar &glide_polar)
{
ChartRenderer chart(chart_look, canvas, rc);
if (!glide_polar.IsValid()) {
chart.DrawNoData();
return;
}
chart.ScaleXFromValue(0);
chart.ScaleXFromValue(MAX_MACCREADY);
chart.ScaleYFromValue(0);
chart.ScaleYFromValue(glide_polar.GetVMax());
chart.DrawXGrid(Units::ToSysVSpeed(1), 1, ChartRenderer::UnitFormat::NUMERIC);
chart.DrawYGrid(Units::ToSysSpeed(10), 10, ChartRenderer::UnitFormat::NUMERIC);
GlidePolar gp = glide_polar;
double m = 0;
double m_last;
gp.SetMC(m);
double v_last = gp.GetVBestLD();
double vav_last = 0;
do {
m_last = m;
m+= MAX_MACCREADY/STEPS_MACCREADY;
gp.SetMC(m);
const double v = gp.GetVBestLD();
const double vav = gp.GetAverageSpeed();
chart.DrawLine(m_last, v_last, m, v, ChartLook::STYLE_BLACK);
chart.DrawLine(m_last, vav_last, m, vav, ChartLook::STYLE_BLUETHINDASH);
v_last = v;
vav_last = vav;
} while (m<MAX_MACCREADY);
// draw current MC setting
chart.DrawLine(glide_polar.GetMC(), 0, glide_polar.GetMC(), glide_polar.GetVMax(),
ChartLook::STYLE_REDTHICKDASH);
// draw labels and other overlays
gp.SetMC(0.9*MAX_MACCREADY);
chart.DrawLabel(_T("Vopt"), 0.9*MAX_MACCREADY, gp.GetVBestLD());
gp.SetMC(0.9*MAX_MACCREADY);
chart.DrawLabel(_T("Vave"), 0.9*MAX_MACCREADY, gp.GetAverageSpeed());
chart.DrawYLabel(_T("V"), Units::GetSpeedName());
chart.DrawXLabel(_T("MC"), Units::GetVerticalSpeedName());
RenderGlidePolarInfo(canvas, rc, chart_look, glide_polar);
}
示例2:
void
MacCreadyCaption(TCHAR *sTmp, const GlidePolar &glide_polar)
{
if (!glide_polar.IsValid()) {
*sTmp = _T('\0');
return;
}
_stprintf(sTmp,
_T("%s: %d %s\r\n%s: %d %s"),
_("Vopt"),
(int)Units::ToUserSpeed(glide_polar.GetVBestLD()),
Units::GetSpeedName(),
_("Vave"),
(int)Units::ToUserTaskSpeed(glide_polar.GetAverageSpeed()),
Units::GetTaskSpeedName());
}