Ref T683, use slow updates in FS9 for thins not to be updated every cycle

This commit is contained in:
Klaus Basan
2019-06-13 01:53:09 +02:00
committed by Mat Sutcliffe
parent 0360704b0b
commit fa6101d02b
2 changed files with 13 additions and 2 deletions

View File

@@ -386,6 +386,9 @@ namespace BlackMisc
//! Get model string //! Get model string
const QString &getModelString() const { return m_models[CurrentModel].getModelString(); } const QString &getModelString() const { return m_models[CurrentModel].getModelString(); }
//! Get CG from model
const PhysicalQuantities::CLength &getCG() const { return m_models[CurrentModel].getCG(); }
//! Set model string //! Set model string
void setModelString(const QString &modelString); void setModelString(const QString &modelString);

View File

@@ -396,9 +396,17 @@ namespace BlackSimPlugin
requestWeatherGrid(weatherGrid, { this, &CSimulatorFs9::injectWeatherGrid }); requestWeatherGrid(weatherGrid, { this, &CSimulatorFs9::injectWeatherGrid });
} }
} }
} } // weather
reverseLookupAndUpdateOwnAircraftModel(simDataOwnAircraft.getModelString()); // slow updates
if (m_ownAircraftUpdateCycles % 25 == 0)
{
this->reverseLookupAndUpdateOwnAircraftModel(simDataOwnAircraft.getModelString());
const CLength cg = simDataOwnAircraft.getCG();
if (!cg.isNull()) { this->updateOwnCG(cg); }
} // slow updates
m_ownAircraftUpdateCycles++;
} }
void CSimulatorFs9::disconnectAllClients() void CSimulatorFs9::disconnectAllClients()