COM audio did not tune in (voice room) if channel was already selected at startup

Reason was: hardcoded channel spacing to 8.33kHz

As a result changed to channel spacing based on COM unit, which could also be changed at runtime

* the issue itself was in own aircraft context
* added functions for channel spacing
* changed to COM unit channel spacing (instead of hardcoded spacing)
This commit is contained in:
Klaus Basan
2019-05-01 02:11:02 +02:00
parent 8df7404f2b
commit bcbdaaf1a7
19 changed files with 99 additions and 29 deletions

View File

@@ -96,8 +96,8 @@ namespace BlackMisc
//! Is active frequency within 25kHz channel?
bool isActiveFrequencyWithin50kHzChannel(const PhysicalQuantities::CFrequency &comFrequency) const;
//! Is active frequency within 25kHz channel?
bool isActiveFrequencyWithinChannelSpacing(const PhysicalQuantities::CFrequency &comFrequency, CComSystem::ChannelSpacing channelSpacing) const;
//! Is active frequency within the channel spacing?
bool isActiveFrequencyWithinChannelSpacing(const PhysicalQuantities::CFrequency &comFrequency) const;
//! Set UNICOM frequency as active
void setActiveUnicom();
@@ -105,13 +105,18 @@ namespace BlackMisc
//! Set International Air Distress 121.5MHz
void setActiveInternationalAirDistress();
//! Get channel spacing
ChannelSpacing getChannelSpacing() const { return m_channelSpacing; }
//! Set channel spacing
void setChannelSpacing(ChannelSpacing spacing) { m_channelSpacing = spacing; }
//! COM1 unit
static CComSystem getCom1System(double activeFrequencyMHz, double standbyFrequencyMHz = -1);
//! COM1 unit
static CComSystem getCom1System(const PhysicalQuantities::CFrequency &activeFrequency,
const PhysicalQuantities::CFrequency &standbyFrequency = { 0, PhysicalQuantities::CFrequencyUnit::nullUnit() });
//! COM2 unit
static CComSystem getCom2System(double activeFrequencyMHz, double standbyFrequencyMHz = -1);