本文整理汇总了C++中InfoBoxWindow::SetValueUnit方法的典型用法代码示例。如果您正苦于以下问题:C++ InfoBoxWindow::SetValueUnit方法的具体用法?C++ InfoBoxWindow::SetValueUnit怎么用?C++ InfoBoxWindow::SetValueUnit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InfoBoxWindow
的用法示例。
在下文中一共展示了InfoBoxWindow::SetValueUnit方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sizeof
void
InfoBoxContentAltitudeQFE::Update(InfoBoxWindow &infobox)
{
const NMEA_INFO &basic = CommonInterface::Basic();
TCHAR sTmp[32];
if (!basic.GPSAltitudeAvailable) {
infobox.SetInvalid();
return;
}
fixed Value = basic.GPSAltitude;
const Waypoint* home_waypoint = way_points.find_home();
if (home_waypoint)
Value -= home_waypoint->Altitude;
// Set Value
Units::FormatUserAltitude(Value, sTmp,
sizeof(sTmp) / sizeof(sTmp[0]), false);
infobox.SetValue(sTmp);
// Set Comment
Units::FormatAlternateUserAltitude(Value, sTmp,
sizeof(sTmp) / sizeof(sTmp[0]));
infobox.SetComment(sTmp);
// Set Unit
infobox.SetValueUnit(Units::Current.AltitudeUnit);
}
示例2: if
void
InfoBoxContentTeamDistance::Update(InfoBoxWindow &infobox)
{
if (!XCSoarInterface::SettingsComputer().TeammateCodeValid) {
infobox.SetInvalid();
return;
}
// Set Value
TCHAR tmp[32];
Units::FormatUserDistance(XCSoarInterface::Calculated().TeammateRange,
tmp, 32, false);
infobox.SetValue(tmp);
// Set Unit
infobox.SetValueUnit(Units::DistanceUnit);
// Set Comment
if (!XCSoarInterface::SettingsComputer().TeamFlarmIdTarget.defined())
infobox.SetComment(_T("---"));
else if (!string_is_empty(XCSoarInterface::SettingsComputer().TeamFlarmCNTarget))
infobox.SetComment(XCSoarInterface::SettingsComputer().TeamFlarmCNTarget);
else
infobox.SetComment(_T("???"));
if (XCSoarInterface::Basic().flarm.FindTraffic(
XCSoarInterface::SettingsComputer().TeamFlarmIdTarget) != NULL)
infobox.SetColorBottom(2);
else
infobox.SetColorBottom(1);
}
示例3:
void
InfoBoxContentAltitudeBaro::Update(InfoBoxWindow &infobox)
{
const NMEAInfo &basic = CommonInterface::Basic();
TCHAR sTmp[32];
if (!basic.baro_altitude_available) {
infobox.SetInvalid();
if (basic.pressure_altitude_available)
infobox.SetComment(_("no QNH"));
return;
}
// Set Value
Units::FormatUserAltitude(basic.baro_altitude, sTmp,
ARRAY_SIZE(sTmp), false);
infobox.SetValue(sTmp);
// Set Comment
Units::FormatAlternateUserAltitude(basic.baro_altitude, sTmp,
ARRAY_SIZE(sTmp));
infobox.SetComment(sTmp);
// Set Unit
infobox.SetValueUnit(Units::Current.AltitudeUnit);
}
示例4: sizeof
void
InfoBoxContentAltitudeAGL::Update(InfoBoxWindow &infobox)
{
TCHAR sTmp[32];
if (!XCSoarInterface::Calculated().TerrainValid) {
infobox.SetInvalid();
return;
}
// Set Value
Units::FormatUserAltitude(XCSoarInterface::Basic().AltitudeAGL, sTmp,
sizeof(sTmp) / sizeof(sTmp[0]), false);
infobox.SetValue(sTmp);
// Set Comment
Units::FormatAlternateUserAltitude(XCSoarInterface::Basic().AltitudeAGL, sTmp,
sizeof(sTmp) / sizeof(sTmp[0]));
infobox.SetComment(sTmp);
// Set Unit
infobox.SetValueUnit(Units::AltitudeUnit);
if (XCSoarInterface::Basic().AltitudeAGL <
XCSoarInterface::SettingsComputer().safety_height_terrain)
// red
infobox.SetColor(1);
else
infobox.SetColor(0);
}
示例5:
static void
SetVSpeed(InfoBoxWindow &infobox, fixed value)
{
TCHAR buffer[32];
Units::FormatUserVSpeed(value, buffer, 32, false);
infobox.SetValue(buffer[0] == _T('+') ? buffer + 1 : buffer);
infobox.SetValueUnit(Units::Current.VerticalSpeedUnit);
}
示例6:
void
InfoBoxContentHomeDistance::Update(InfoBoxWindow &infobox)
{
const CommonStats &common_stats = XCSoarInterface::Calculated().common_stats;
// Set Value
TCHAR tmp[32];
Units::FormatUserDistance(common_stats.vector_home.Distance, tmp, 32, false);
infobox.SetValue(tmp);
// Set Unit
infobox.SetValueUnit(Units::DistanceUnit);
infobox.SetComment(common_stats.vector_home.Bearing);
}
示例7: SetValueFromFixed
void
InfoBoxContentTaskSpeedInstant::Update(InfoBoxWindow &infobox)
{
const TaskStats &task_stats = XCSoarInterface::Calculated().task_stats;
if (!task_stats.task_valid) {
infobox.SetInvalid();
return;
}
// Set Value
SetValueFromFixed(infobox, _T("%2.0f"),
Units::ToUserTaskSpeed(task_stats.get_pirker_speed()));
// Set Unit
infobox.SetValueUnit(Units::Current.TaskSpeedUnit);
}
示例8:
void
InfoBoxContentThermalLastGain::Update(InfoBoxWindow &infobox)
{
const OneClimbInfo &thermal = CommonInterface::Calculated().last_thermal;
if (!thermal.IsDefined()) {
infobox.SetInvalid();
return;
}
// Set Value
TCHAR sTmp[32];
Units::FormatUserAltitude(thermal.gain, sTmp, 32, false);
infobox.SetValue(sTmp);
// Set Unit
infobox.SetValueUnit(Units::Current.AltitudeUnit);
}
示例9:
void
InfoBoxContentOLC::Update(InfoBoxWindow &infobox)
{
if (!XCSoarInterface::SettingsComputer().enable_olc) {
infobox.SetInvalid();
return;
}
const CommonStats &common_stats = XCSoarInterface::Calculated().common_stats;
// Set Value
TCHAR tmp[32];
Units::FormatUserDistance(common_stats.distance_olc, tmp, 32, false);
infobox.SetValue(tmp);
// Set Unit
infobox.SetValueUnit(Units::DistanceUnit);
}
示例10: SetValueFromFixed
void
InfoBoxContentWindSpeed::Update(InfoBoxWindow &infobox)
{
const DerivedInfo &info = CommonInterface::Calculated();
if (!info.wind_available) {
infobox.SetInvalid();
return;
}
// Set Value
SetValueFromFixed(infobox, _T("%2.0f"),
Units::ToUserWindSpeed(info.wind.norm));
// Set Unit
infobox.SetValueUnit(Units::Current.WindSpeedUnit);
// Set Comment
infobox.SetComment(info.wind.bearing, _T("T"));
}