mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 05:26:45 +08:00
Ref T275, added param "ignoreSameAsGlobal" in function "setInterpolationAndRenderingSetupsPerCallsign"
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user