mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 04:25:35 +08:00
Ref T111, allow to set cockpit by passing another simulated aircraft
This commit is contained in:
committed by
Mathew Sutcliffe
parent
66773d7593
commit
ea6cf20587
@@ -171,16 +171,23 @@ namespace BlackMisc
|
||||
case CComSystem::Com2: return this->getCom2System();
|
||||
default: break;
|
||||
}
|
||||
Q_ASSERT(false);
|
||||
BLACK_VERIFY_X(false, Q_FUNC_INFO, "Wrong unit");
|
||||
return CComSystem(); // avoid warning
|
||||
}
|
||||
|
||||
void CSimulatedAircraft::setCockpit(const CSimulatedAircraft &aircraft)
|
||||
{
|
||||
this->setCockpit(aircraft.getCom1System(), aircraft.getCom2System(), aircraft.getTransponder());
|
||||
this->setSelcal(aircraft.getSelcal());
|
||||
}
|
||||
|
||||
void CSimulatedAircraft::setComSystem(const CComSystem &com, CComSystem::ComUnit unit)
|
||||
{
|
||||
switch (unit)
|
||||
{
|
||||
case CComSystem::Com1: this->setCom1System(com); break;
|
||||
case CComSystem::Com2: this->setCom2System(com); break;
|
||||
default: BLACK_VERIFY_X(false, Q_FUNC_INFO, "Wrong unit"); break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -205,6 +212,7 @@ namespace BlackMisc
|
||||
{
|
||||
case CComSystem::Com1: return this->setCom1ActiveFrequency(frequency);
|
||||
case CComSystem::Com2: return this->setCom2ActiveFrequency(frequency);
|
||||
default: BLACK_VERIFY_X(false, Q_FUNC_INFO, "Wrong unit"); break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -254,6 +254,9 @@ namespace BlackMisc
|
||||
//! SELCAL
|
||||
const BlackMisc::Aviation::CSelcal getSelcal() const { return m_selcal; }
|
||||
|
||||
//! Set COM unit (all values + transponder and SELCAL)
|
||||
void setCockpit(const BlackMisc::Simulation::CSimulatedAircraft &aircraft);
|
||||
|
||||
//! Cockpit data
|
||||
void setCockpit(const BlackMisc::Aviation::CComSystem &com1, const BlackMisc::Aviation::CComSystem &com2, const BlackMisc::Aviation::CTransponder &transponder);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user