19namespace swift::misc::aviation
25 m_frequencyActive = m_frequencyStandby;
26 m_frequencyStandby = a;
32 return m_frequencyActive;
38 return m_frequencyStandby;
44 m_frequencyActive = frequency;
50 m_frequencyStandby = frequency;
56 return m_volumeReceive;
62 return m_volumeTransmit;
70 m_volumeReceive = 100;
78 m_volumeReceive = volume;
87 m_volumeTransmit = 100;
95 m_volumeTransmit = volume;
102 return m_transmitEnabled;
105 template <
class AVIO>
108 return m_receiveEnabled;
111 template <
class AVIO>
114 m_transmitEnabled = enable;
117 template <
class AVIO>
120 m_receiveEnabled = enable;
123 template <
class AVIO>
129 template <
class AVIO>
149 template <
class AVIO>
154 Q_ASSERT_X(
false, Q_FUNC_INFO,
"Wrong index to base template");
160 case IndexActiveFrequency: m_frequencyActive.setPropertyByIndex(index.
copyFrontRemoved(), variant);
break;
161 case IndexStandbyFrequency: m_frequencyStandby.setPropertyByIndex(index.
copyFrontRemoved(), variant);
break;
170 template <
class AVIO>
175 return m_frequencyActive.comparePropertyByIndex(index.
copyFrontRemoved(), compareValue.m_frequencyActive);
180 case IndexActiveFrequency:
181 return m_frequencyActive.comparePropertyByIndex(index.
copyFrontRemoved(), compareValue.m_frequencyActive);
182 case IndexStandbyFrequency:
183 return m_frequencyStandby.comparePropertyByIndex(index.
copyFrontRemoved(), compareValue.m_frequencyStandby);
190 Q_ASSERT_X(
false, Q_FUNC_INFO,
"Compare failed");
194 template <
class AVIO>
197 static_assert(!std::is_polymorphic_v<AVIO>,
"Must not use virtual functions for value classes");
200 template <
class AVIO>
204 : m_name(name), m_frequencyActive(activeFrequency), m_frequencyStandby(standbyFrequency)
206 static_assert(!std::is_polymorphic_v<AVIO>,
"Must not use virtual functions for value classes");
209 template <
class AVIO>
213 s.
append(
" Active: ").
append(m_frequencyActive.valueRoundedWithUnit(3, i18n));
214 s.
append(
" Standby: ").
append(m_frequencyStandby.valueRoundedWithUnit(3, i18n));
218 template <
class AVIO>
225 template <
class AVIO>
232 template <
class AVIO>
239 template <
class AVIO>
246 template <
class AVIO>
253 template <
class AVIO>
260 template <
class AVIO>
267 template <
class AVIO>
Non-owning reference to a CPropertyIndex with a subset of its features.
Q_REQUIRED_RESULT CPropertyIndexRef copyFrontRemoved() const
Copy with first element removed.
CastType frontCasted() const
First element casted to given type, usually the PropertIndex enum.
bool isMyself() const
Myself index, used with nesting.
Base class for COM, NAV, Squawk units.
bool isTransmitEnabled() const
Enabled?
static const QString & NameNav2()
NAV2.
QVariant propertyByIndex(swift::misc::CPropertyIndexRef index) const
Property by index.
void setVolumeReceive(int volume)
Output volume 0.100.
void setFrequencyStandbyKHz(double frequencyKHz)
Set standby frequency.
static const QString & NameCom3()
COM3.
void setPropertyByIndex(swift::misc::CPropertyIndexRef index, const QVariant &variant)
Set property by index.
QString getName() const
Name.
int getVolumeTransmit() const
Input volume 0..100.
void setTransmitEnabled(bool enable)
Enabled?
swift::misc::physical_quantities::CFrequency getFrequencyStandby() const
Standby frequency.
int getVolumeReceive() const
Output volume 0..100.
static const QString & NameNav3()
NAV3.
static const QString & NameCom1()
COM1.
void setVolumeTransmit(int volume)
Input volume 0..100.
static const QString & NameNav1()
NAV1.
bool isReceiveEnabled() const
Enabled?
ColumnIndex
Column indexes.
void setFrequencyStandby(const swift::misc::physical_quantities::CFrequency &frequency)
Set standby frequency.
QString convertToQString(bool i18n=false) const
Cast as QString.
swift::misc::physical_quantities::CFrequency getFrequencyActive() const
Active frequency.
int comparePropertyByIndex(swift::misc::CPropertyIndexRef index, const AVIO &compareValue) const
Compare by property index.
void toggleActiveStandby()
Toggle active and standby frequencies.
CModulator()
Default constructor.
void setFrequencyActive(const swift::misc::physical_quantities::CFrequency &frequency)
Set active frequency.
void setReceiveEnabled(bool enable)
Enabled?
static const QString & NameCom2()
COM2.
void setFrequencyActiveKHz(double frequencyKHz)
Set active frequency.
Specialized class for frequency (hertz, mega hertz, kilo hertz).
static CFrequencyUnit kHz()
Kilohertz.
int compare(T a, T b)
Compare arithmetic values.
QString & append(QChar ch)
QVariant fromValue(T &&value)
bool toBool() const const
int toInt(bool *ok) const const