mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 07:35:48 +08:00
UI aircraft component reduced airport update frequency
This commit is contained in:
@@ -106,11 +106,14 @@ namespace BlackGui
|
||||
if (sGui->getIContextSimulator()->getSimulatorStatus() > 0)
|
||||
{
|
||||
const bool visible = (this->isVisibleWidget() && this->currentWidget() == ui->tb_AirportsInRange);
|
||||
if (this->countAirportsInRangeInView() < 1 || visible)
|
||||
const bool counter = ((m_updateCounter % 5) == 0); // less frequent than aircraft
|
||||
if (this->countAirportsInRangeInView() < 1 || (visible && counter))
|
||||
{
|
||||
ui->tvp_AirportsInRange->updateContainerMaybeAsync(sGui->getIContextSimulator()->getAirportsInRange());
|
||||
}
|
||||
}
|
||||
|
||||
m_updateCounter++;
|
||||
}
|
||||
|
||||
void CAircraftComponent::onInfoAreaTabBarChanged(int index)
|
||||
|
||||
@@ -85,6 +85,7 @@ namespace BlackGui
|
||||
QScopedPointer<Ui::CAircraftComponent> ui;
|
||||
BlackMisc::CSettingReadOnly<BlackGui::Settings::TViewUpdateSettings> m_settings { this, &CAircraftComponent::onSettingsChanged }; //!< settings changed
|
||||
QTimer m_updateTimer;
|
||||
int m_updateCounter = 0;
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
Reference in New Issue
Block a user