static void UpdateValues() { static PeriodClock last_time; if (!last_time.CheckUpdate(200)) return; if (EnableAutoBrightness) { altair_control.SetBacklight(-100); } else { altair_control.SetBacklight(BrightnessValue); } }
void ProgressGlue::SetValue(unsigned value) { if (global_progress_window == nullptr) return; if (!throttle_clock.CheckUpdate(200)) return; global_progress_window->SetValue(value); UIGlobals::GetMainWindow().RefreshSize(); UIGlobals::GetMainWindow().Refresh(); }
void ProgressGlue::Step() { if (global_progress_window == NULL) return; if (!throttle_clock.CheckUpdate(200)) return; global_progress_window->Step(); UIGlobals::GetMainWindow().RefreshSize(); UIGlobals::GetMainWindow().Refresh(); }
static void VegaWriteDemo() { static PeriodClock last_time; if (!last_time.CheckUpdate(250)) return; TCHAR dbuf[100]; _stprintf(dbuf, _T("PDVDD,%d,%d"), iround(VegaDemoW * 10), iround(VegaDemoV * 10)); PopupOperationEnvironment env; VarioWriteNMEA(dbuf, env); }
/** * Calculates the own TeamCode and saves it to Calculated */ inline void GlideComputer::CalculateOwnTeamCode() { // No reference waypoint for teamcode calculation chosen -> cancel if (!DetermineTeamCodeRefLocation()) return; // Only calculate every 10sec otherwise cancel calculation if (!last_team_code_update.CheckUpdate(10000)) return; // Get bearing and distance to the reference waypoint const GeoVector v = team_code_ref_location.DistanceBearing(Basic().location); // Save teamcode to Calculated SetCalculated().own_teammate_code.Update(v.bearing, v.distance); }