mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-02 15:15:39 +08:00
Ref T397, fixed "disable" for fast positions
This commit is contained in:
@@ -125,7 +125,17 @@ namespace BlackCore
|
|||||||
QTimer::singleShot(0, m_network, [ = ]
|
QTimer::singleShot(0, m_network, [ = ]
|
||||||
{
|
{
|
||||||
if (!myself) { return; }
|
if (!myself) { return; }
|
||||||
if (m_network) { m_network->addInterimPositionReceiver(callsign); }
|
if (m_network)
|
||||||
|
{
|
||||||
|
if (enableFastPositonUpdates)
|
||||||
|
{
|
||||||
|
m_network->addInterimPositionReceiver(callsign);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_network->removeInterimPositionReceiver(callsign);
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
|
|||||||
@@ -357,20 +357,32 @@ namespace BlackCore
|
|||||||
*/
|
*/
|
||||||
virtual void setInterimPositionReceivers(const BlackMisc::Aviation::CCallsignSet &receiver) = 0;
|
virtual void setInterimPositionReceivers(const BlackMisc::Aviation::CCallsignSet &receiver) = 0;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Get the group of callsigns receiving regular interim position updates.
|
||||||
|
*/
|
||||||
|
virtual const BlackMisc::Aviation::CCallsignSet &getInterimPositionReceivers() const = 0;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Add callsign receiving regular interim position updates.
|
* Add callsign receiving regular interim position updates.
|
||||||
*/
|
*/
|
||||||
virtual void addInterimPositionReceiver(const BlackMisc::Aviation::CCallsign &receiver)
|
void addInterimPositionReceiver(const BlackMisc::Aviation::CCallsign &receiver)
|
||||||
{
|
{
|
||||||
BlackMisc::Aviation::CCallsignSet set = this->getInterimPositionReceivers();
|
BlackMisc::Aviation::CCallsignSet set = this->getInterimPositionReceivers();
|
||||||
|
if (set.contains(receiver)) { return; } // already in set
|
||||||
set.push_back(receiver);
|
set.push_back(receiver);
|
||||||
this->setInterimPositionReceivers(set);
|
this->setInterimPositionReceivers(set);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Get the group of callsigns receiving regular interim position updates.
|
* Remove callsign receiving regular interim position updates.
|
||||||
*/
|
*/
|
||||||
virtual const BlackMisc::Aviation::CCallsignSet &getInterimPositionReceivers() const = 0;
|
void removeInterimPositionReceiver(const BlackMisc::Aviation::CCallsign &receiver)
|
||||||
|
{
|
||||||
|
BlackMisc::Aviation::CCallsignSet set = this->getInterimPositionReceivers();
|
||||||
|
if (!set.contains(receiver)) { return; } // nothing to remove
|
||||||
|
set.remove(receiver);
|
||||||
|
this->setInterimPositionReceivers(set);
|
||||||
|
}
|
||||||
|
|
||||||
//! @}
|
//! @}
|
||||||
////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
Reference in New Issue
Block a user