Ref T275, added param "ignoreSameAsGlobal" in function "setInterpolationAndRenderingSetupsPerCallsign"

This commit is contained in:
Klaus Basan
2018-06-20 00:56:14 +02:00
parent b0c54b4a9f
commit d3796fc65a
9 changed files with 24 additions and 15 deletions

View File

@@ -28,16 +28,22 @@ namespace BlackMisc
return CInterpolationSetupList(setups.values());
}
void IInterpolationSetupProvider::setInterpolationSetupsPerCallsign(const CInterpolationSetupList &setups)
bool IInterpolationSetupProvider::setInterpolationSetupsPerCallsign(const CInterpolationSetupList &setups, bool ignoreSameAsGlobal)
{
const CInterpolationAndRenderingSetupGlobal gs = this->getInterpolationSetupGlobal();
SetupsPerCallsign setupsPerCs;
for (const CInterpolationAndRenderingSetupPerCallsign &setup : setups)
{
if (ignoreSameAsGlobal && setup.isEqualToGlobal(gs)) { continue; }
setupsPerCs.insert(setup.getCallsign(), setup);
}
QWriteLocker l(&m_lockSetup);
m_setups = setupsPerCs;
{
QWriteLocker l(&m_lockSetup);
if (m_setups.isEmpty() && setupsPerCs.isEmpty()) { return false; }
m_setups = setupsPerCs;
}
return true;
}
CInterpolationAndRenderingSetupGlobal IInterpolationSetupProvider::getInterpolationSetupGlobal() const
@@ -91,7 +97,8 @@ namespace BlackMisc
{
if (removeGlobalSetup)
{
if (setup.isEqualToGlobal(this->getInterpolationSetupGlobal()))
const CInterpolationAndRenderingSetupGlobal gs = this->getInterpolationSetupGlobal();
if (setup.isEqualToGlobal(gs))
{
QWriteLocker l(&m_lockSetup);
m_setups.remove(callsign);

View File

@@ -40,7 +40,7 @@ namespace BlackMisc
//! Set all setups per callsign
//! \threadsafe
virtual void setInterpolationSetupsPerCallsign(const CInterpolationSetupList &setups);
virtual bool setInterpolationSetupsPerCallsign(const CInterpolationSetupList &setups, bool ignoreSameAsGlobal = true);
//! The global setup
//! \threadsafe

View File

@@ -143,7 +143,7 @@ namespace BlackMisc
QString ISimulationEnvironmentProvider::getElevationsFoundMissedInfo() const
{
static const QString info("%1/%2 %3");
static const QString info("%1/%2 %3%");
const QPair<int, int> foundMissed = this->getElevationsFoundMissed();
const int f = foundMissed.first;
const int m = foundMissed.second;