本文整理汇总了C++中InfoBoxWindow类的典型用法代码示例。如果您正苦于以下问题:C++ InfoBoxWindow类的具体用法?C++ InfoBoxWindow怎么用?C++ InfoBoxWindow使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了InfoBoxWindow类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fixed
void
InfoBoxContentTaskTimeUnderMaxHeight::Update(InfoBoxWindow &infobox)
{
const CommonStats &common_stats = XCSoarInterface::Calculated().common_stats;
const TaskStats &task_stats = XCSoarInterface::Calculated().task_stats;
const fixed maxheight = fixed(protected_task_manager->
get_ordered_task_behaviour().start_max_height);
if (!task_stats.task_valid || !positive(maxheight)
|| !protected_task_manager
|| !positive(common_stats.TimeUnderStartMaxHeight)) {
infobox.SetInvalid();
return;
}
const int dd = (int)(XCSoarInterface::Basic().Time -
common_stats.TimeUnderStartMaxHeight);
TCHAR HHMMSSsmart[32];
TCHAR SSsmart[32];
Units::TimeToTextSmart(HHMMSSsmart, SSsmart, dd);
infobox.SetValue(HHMMSSsmart);
infobox.SetComment(_("Time Below"));
}
示例2:
void
InfoBoxContentFinalETEVMG::Update(InfoBoxWindow &infobox)
{
if (!XCSoarInterface::Basic().GroundSpeedAvailable) {
infobox.SetInvalid();
return;
}
const fixed d = XCSoarInterface::Calculated().task_stats.
total.remaining.get_distance();
const fixed &v = XCSoarInterface::Basic().GroundSpeed;
if (!XCSoarInterface::Calculated().task_stats.task_valid ||
!positive(d) ||
!positive(v)) {
infobox.SetInvalid();
return;
}
TCHAR HHMMSSsmart[32];
TCHAR SSsmart[32];
const int dd = (int)(d/v);
Units::TimeToTextSmart(HHMMSSsmart, SSsmart, dd);
infobox.SetValue(HHMMSSsmart);
infobox.SetComment(SSsmart);
}
示例3: DetectCurrentTime
void
InfoBoxContentNextETA::Update(InfoBoxWindow &infobox)
{
// use proper non-terminal next task stats
if (!XCSoarInterface::Calculated().task_stats.task_valid ||
!XCSoarInterface::Calculated().task_stats.current_leg.achievable()) {
infobox.SetInvalid();
return;
}
TCHAR tmp[32];
int dd = (int)(XCSoarInterface::Calculated().task_stats.current_leg.
solution_remaining.TimeElapsed) +
DetectCurrentTime(XCSoarInterface::Basic());
const BrokenTime t = BrokenTime::FromSecondOfDayChecked(abs(dd));
// Set Value
_stprintf(tmp, _T("%02u:%02u"), t.hour, t.minute);
infobox.SetValue(tmp);
// Set Comment
_stprintf(tmp, _T("%02u"), t.second);
infobox.SetComment(tmp);
}
示例4: abs
void
InfoBoxContentTaskAATimeDelta::Update(InfoBoxWindow &infobox)
{
const TaskStats &task_stats = XCSoarInterface::Calculated().task_stats;
const CommonStats &common_stats = XCSoarInterface::Calculated().common_stats;
if (!task_stats.task_valid || !task_stats.total.achievable() ||
!positive(task_stats.total.TimeRemaining) ||
!positive(common_stats.aat_time_remaining)) {
infobox.SetInvalid();
return;
}
fixed diff = task_stats.total.TimeRemaining -
common_stats.aat_time_remaining;
TCHAR HHMMSSsmart[32];
TCHAR SSsmart[32];
const int dd = abs((int)diff);
Units::TimeToTextSmart(HHMMSSsmart, SSsmart, dd);
TCHAR tmp[32];
_stprintf(tmp, negative(diff) ? _T("-%s") : _T("%s"), HHMMSSsmart);
infobox.SetValue(tmp);
infobox.SetComment(SSsmart);
// Set Color (red/blue/black)
infobox.SetColor(negative(diff) ? 1 :
task_stats.total.TimeRemaining <
common_stats.aat_time_remaining + fixed(5) ? 2 : 0);
}
示例5: SystemFreeRAM
void
InfoBoxContentFreeRAM::Update(InfoBoxWindow &infobox)
{
#ifdef HAVE_MEM_INFO
TCHAR tmp[32];
TCHAR unit;
unsigned long freeRAM = SystemFreeRAM();
double f = freeRAM;
if (freeRAM >= 1024 * 1024 *1024) {
f /= (1024 * 1024 * 1024);
unit = _T('G');
} else if (freeRAM >= 1024 * 1024) {
f /= (1024 * 1024);
unit = _T('M');
} else if (freeRAM >= 1024) {
f /= 1024;
unit = _T('K');
} else
unit = _T('B');
_stprintf(tmp, _T("%.1f%c"), f, unit);
infobox.SetValue(tmp);
#else
infobox.SetInvalid();
#endif
}
示例6:
void
InfoBoxContentThermalBand::Update(InfoBoxWindow &infobox)
{
infobox.SetComment(_T(""));
infobox.SetValue(_T(""));
infobox.invalidate();
}
示例7: SetVSpeed
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);
}
示例8:
void
InfoBoxContentTrack::Update(InfoBoxWindow &infobox)
{
if (!XCSoarInterface::Basic().track_available) {
infobox.SetInvalid();
return;
}
infobox.SetValue(XCSoarInterface::Basic().track, _T("T"));
}
示例9:
void
InfoBoxContentTrack::Update(InfoBoxWindow &infobox)
{
if (XCSoarInterface::Basic().gps.NAVWarning) {
infobox.SetInvalid();
return;
}
infobox.SetValue(XCSoarInterface::Basic().TrackBearing, _T("T"));
}
示例10:
void
InfoBoxContentWindBearing::Update(InfoBoxWindow &infobox)
{
const DerivedInfo &info = CommonInterface::Calculated();
if (!info.wind_available) {
infobox.SetInvalid();
return;
}
infobox.SetValue(info.wind.bearing, _T("T"));
}
示例11:
void
InfoBoxContentHorizon::Update(InfoBoxWindow &infobox)
{
infobox.SetComment(_T(""));
if (!CommonInterface::Basic().acceleration.available) {
infobox.SetInvalid();
return;
}
infobox.SetValue(_T(""));
infobox.invalidate();
}
示例12: SystemLoadCPU
void
InfoBoxContentCPULoad::Update(InfoBoxWindow &infobox)
{
TCHAR tmp[32];
unsigned percent_load = SystemLoadCPU();
if (percent_load <= 100) {
_stprintf(tmp, _T("%d%%"), percent_load);
infobox.SetValue(tmp);
} else {
infobox.SetInvalid();
}
}
示例13: sizeof
void
InfoBoxContentBarogram::Update(InfoBoxWindow &infobox)
{
const NMEA_INFO &basic = CommonInterface::Basic();
TCHAR sTmp[32];
Units::FormatUserAltitude(basic.NavAltitude, sTmp,
sizeof(sTmp) / sizeof(sTmp[0]));
infobox.SetComment(sTmp);
infobox.SetValue(_T(""));
infobox.invalidate();
}
示例14:
void
InfoBoxContentLDCruise::Update(InfoBoxWindow &infobox)
{
if (XCSoarInterface::Calculated().CruiseLD == fixed(999)) {
infobox.SetInvalid();
return;
}
// Set Value
TCHAR tmp[32];
_stprintf(tmp, _T("%2.0f"), (double)XCSoarInterface::Calculated().CruiseLD);
infobox.SetValue(tmp);
}
示例15:
void
InfoBoxContentGLoad::Update(InfoBoxWindow &infobox)
{
if (!XCSoarInterface::Basic().acceleration.Available) {
infobox.SetInvalid();
return;
}
// Set Value
TCHAR tmp[32];
_stprintf(tmp, _T("%2.2f"),
(double)XCSoarInterface::Basic().acceleration.Gload);
infobox.SetValue(tmp);
}