mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-21 04:45:31 +08:00
refs #814, fixed wrong default values for update times causing CPU overload
* use 10s as conservative default value * check in assert if update time is correct
This commit is contained in:
@@ -159,7 +159,8 @@ namespace BlackGui
|
|||||||
void CAircraftComponent::ps_settingsChanged()
|
void CAircraftComponent::ps_settingsChanged()
|
||||||
{
|
{
|
||||||
const CViewUpdateSettings settings = this->m_settings.get();
|
const CViewUpdateSettings settings = this->m_settings.get();
|
||||||
this->m_updateTimer.setInterval(settings.getAircraftUpdateTime().toMs());
|
const int ms = settings.getAircraftUpdateTime().toMs();
|
||||||
|
this->m_updateTimer.setInterval(ms);
|
||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -310,7 +310,8 @@ namespace BlackGui
|
|||||||
void CAtcStationComponent::ps_settingsChanged()
|
void CAtcStationComponent::ps_settingsChanged()
|
||||||
{
|
{
|
||||||
const CViewUpdateSettings settings = this->m_settings.get();
|
const CViewUpdateSettings settings = this->m_settings.get();
|
||||||
this->m_updateTimer.setInterval(settings.getAtcUpdateTime().toMs());
|
const int ms = settings.getAtcUpdateTime().toMs();
|
||||||
|
this->m_updateTimer.setInterval(ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAtcStationComponent::ps_airportsRead()
|
void CAtcStationComponent::ps_airportsRead()
|
||||||
|
|||||||
@@ -454,7 +454,8 @@ namespace BlackGui
|
|||||||
void CMappingComponent::ps_settingsChanged()
|
void CMappingComponent::ps_settingsChanged()
|
||||||
{
|
{
|
||||||
const CViewUpdateSettings settings = this->m_settings.get();
|
const CViewUpdateSettings settings = this->m_settings.get();
|
||||||
this->m_updateTimer.setInterval(settings.getRenderingUpdateTime().toMs());
|
const int ms = settings.getRenderingUpdateTime().toMs();
|
||||||
|
this->m_updateTimer.setInterval(ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMappingComponent::ps_connectionStatusChanged(BlackCore::INetwork::ConnectionStatus from, BlackCore::INetwork::ConnectionStatus to)
|
void CMappingComponent::ps_connectionStatusChanged(BlackCore::INetwork::ConnectionStatus from, BlackCore::INetwork::ConnectionStatus to)
|
||||||
|
|||||||
@@ -25,10 +25,10 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CViewUpdateSettings::reset()
|
void CViewUpdateSettings::reset()
|
||||||
{
|
{
|
||||||
this->m_updateAircraft = CTime(5.0, CTimeUnit::s());
|
this->m_updateAircraft = CTime(10.0, CTimeUnit::s());
|
||||||
this->m_updateAtc = CTime(5.0, CTimeUnit::s());
|
this->m_updateAtc = CTime(10.0, CTimeUnit::s());
|
||||||
this->m_updateRendering = CTime(5.0, CTimeUnit::s());
|
this->m_updateRendering = CTime(10.0, CTimeUnit::s());
|
||||||
this->m_updateUser = CTime(5.0, CTimeUnit::s());
|
this->m_updateUser = CTime(10.0, CTimeUnit::s());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CViewUpdateSettings::isValid() const
|
bool CViewUpdateSettings::isValid() const
|
||||||
|
|||||||
@@ -83,10 +83,10 @@ namespace BlackGui
|
|||||||
void setPropertyByIndex(const BlackMisc::CPropertyIndex &index, const BlackMisc::CVariant &variant);
|
void setPropertyByIndex(const BlackMisc::CPropertyIndex &index, const BlackMisc::CVariant &variant);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BlackMisc::PhysicalQuantities::CTime m_updateAtc;
|
BlackMisc::PhysicalQuantities::CTime m_updateAtc {10.0, BlackMisc::PhysicalQuantities::CTimeUnit::s()};
|
||||||
BlackMisc::PhysicalQuantities::CTime m_updateAircraft;
|
BlackMisc::PhysicalQuantities::CTime m_updateAircraft {10.0, BlackMisc::PhysicalQuantities::CTimeUnit::s()};
|
||||||
BlackMisc::PhysicalQuantities::CTime m_updateRendering;
|
BlackMisc::PhysicalQuantities::CTime m_updateRendering {10.0, BlackMisc::PhysicalQuantities::CTimeUnit::s()};
|
||||||
BlackMisc::PhysicalQuantities::CTime m_updateUser;
|
BlackMisc::PhysicalQuantities::CTime m_updateUser {10.0, BlackMisc::PhysicalQuantities::CTimeUnit::s()};
|
||||||
|
|
||||||
BLACK_METACLASS(
|
BLACK_METACLASS(
|
||||||
CViewUpdateSettings,
|
CViewUpdateSettings,
|
||||||
|
|||||||
@@ -71,7 +71,8 @@ namespace BlackMisc
|
|||||||
TypeVPilotRuleBased //!< based on a vPilot rule
|
TypeVPilotRuleBased //!< based on a vPilot rule
|
||||||
};
|
};
|
||||||
|
|
||||||
//! Mode
|
//! Mode, decides if a model is supposed to be used in the model set for model matching
|
||||||
|
//! or not. The combined type "All" is meant for search operations.
|
||||||
enum ModelMode
|
enum ModelMode
|
||||||
{
|
{
|
||||||
Undefined = 0,
|
Undefined = 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user