Ref T111, allow to set cockpit by passing another simulated aircraft

This commit is contained in:
Klaus Basan
2017-08-08 02:32:20 +02:00
committed by Mathew Sutcliffe
parent 66773d7593
commit ea6cf20587
2 changed files with 12 additions and 1 deletions

View File

@@ -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;
}

View File

@@ -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);