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


C++ InfoBoxWindow::SetValueUnit方法代码示例

本文整理汇总了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);
}
开发者ID:Mrdini,项目名称:XCSoar,代码行数:30,代码来源:Altitude.cpp

示例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);
}
开发者ID:Plantain,项目名称:XCSoar,代码行数:31,代码来源:Team.cpp

示例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);
}
开发者ID:macsux,项目名称:XCSoar,代码行数:28,代码来源:Altitude.cpp

示例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);
}
开发者ID:Plantain,项目名称:XCSoar,代码行数:30,代码来源:Altitude.cpp

示例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);
}
开发者ID:joachimwieland,项目名称:xcsoar-jwieland,代码行数:8,代码来源:MacCready.cpp

示例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);
}
开发者ID:galippi,项目名称:xcsoar,代码行数:15,代码来源:Task.cpp

示例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);
}
开发者ID:joachimwieland,项目名称:xcsoar-jwieland,代码行数:16,代码来源:Task.cpp

示例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);
}
开发者ID:macsux,项目名称:XCSoar,代码行数:17,代码来源:Thermal.cpp

示例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);
}
开发者ID:Plantain,项目名称:XCSoar,代码行数:18,代码来源:Task.cpp

示例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"));
}
开发者ID:macsux,项目名称:XCSoar,代码行数:19,代码来源:Weather.cpp


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