mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 15:45:46 +08:00
Allow to select COM frequencies from ATC view (context menu)
* added functions in component to select COM frequencies * changed views to contain ObjectType in template * function to obtain selected objects in view base class
This commit is contained in:
@@ -179,6 +179,31 @@ namespace BlackCore
|
||||
return changed;
|
||||
}
|
||||
|
||||
/*
|
||||
* COM frequency
|
||||
*/
|
||||
bool CContextOwnAircraft::updateComFrequency(const CFrequency &frequency, int comUnit, const QString &originator)
|
||||
{
|
||||
CComSystem::ComUnit unit = static_cast<CComSystem::ComUnit>(comUnit);
|
||||
if (unit != CComSystem::Com1 && unit != CComSystem::Com2) { return false; }
|
||||
if (!CComSystem::isValidComFrequency(frequency)) { return false; }
|
||||
CComSystem com1 = this->m_ownAircraft.getCom1System();
|
||||
CComSystem com2 = this->m_ownAircraft.getCom2System();
|
||||
CTransponder xpdr = this->m_ownAircraft.getTransponder();
|
||||
if (unit == CComSystem::Com1)
|
||||
{
|
||||
com1.setFrequencyActive(frequency);
|
||||
}
|
||||
else
|
||||
{
|
||||
com2.setFrequencyActive(frequency);
|
||||
}
|
||||
return updateOwnCockpit(com1, com2, xpdr, originator);
|
||||
}
|
||||
|
||||
/*
|
||||
* Pilot
|
||||
*/
|
||||
bool CContextOwnAircraft::updatePilot(const CUser &pilot, const QString &originator)
|
||||
{
|
||||
if (this->m_ownAircraft.getPilot() == pilot) { return false; }
|
||||
|
||||
Reference in New Issue
Block a user