mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 21:15:33 +08:00
Removed validation by exception (no longer what we use) from com/xpdr
This commit is contained in:
@@ -25,26 +25,12 @@ namespace BlackMisc
|
||||
CComSystem::isValidMilitaryFrequency(this->getFrequencyStandby()));
|
||||
}
|
||||
|
||||
/*
|
||||
* Validate
|
||||
*/
|
||||
bool CComSystem::validate(bool strict) const
|
||||
{
|
||||
if (this->isDefaultValue()) return true;
|
||||
bool valid = this->validValues();
|
||||
if (!strict) return valid;
|
||||
Q_ASSERT_X(valid, "CComSystem::validate", "illegal values");
|
||||
if (!valid) throw std::range_error("Illegal values in CComSystem::validate");
|
||||
return true;
|
||||
}
|
||||
|
||||
void CComSystem::setFrequencyActiveMHz(double frequencyMHz)
|
||||
{
|
||||
CFrequency f(frequencyMHz, CFrequencyUnit::MHz());
|
||||
if (f == this->getFrequencyActive()) return; // save all the comparisons / rounding
|
||||
CComSystem::roundToChannelSpacing(f, this->m_channelSpacing);
|
||||
this->CModulator::setFrequencyActive(f);
|
||||
this->validate(true);
|
||||
}
|
||||
|
||||
void CComSystem::setFrequencyStandbyMHz(double frequencyMHz)
|
||||
@@ -53,7 +39,6 @@ namespace BlackMisc
|
||||
if (f == this->getFrequencyStandby()) return; // save all the comparisons / rounding
|
||||
CComSystem::roundToChannelSpacing(f, this->m_channelSpacing);
|
||||
CModulator::setFrequencyStandby(f);
|
||||
this->validate(true);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user