mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-12-23 01:55:48 -05:00
Fix 8333 channels.
This commit is contained in:
parent
bb2655cd51
commit
51ddd77aa3
@ -15,6 +15,8 @@
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include "freqscanneraddrangedialog.h"
|
||||
#include "ui_freqscanneraddrangedialog.h"
|
||||
|
||||
@ -80,8 +82,18 @@ void FreqScannerAddRangeDialog::accept()
|
||||
|
||||
if ((start <= stop) && (step > 0))
|
||||
{
|
||||
for (qint64 f = start; f <= stop; f += step) {
|
||||
m_frequencies.append(f);
|
||||
if (step == 8333)
|
||||
{
|
||||
double fstep = 8333 + 1.0/3.0; // float will give incorrect results
|
||||
for (double f = start; f <= stop; f += fstep) {
|
||||
m_frequencies.append(std::round(f));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (qint64 f = start; f <= stop; f += step) {
|
||||
m_frequencies.append(f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -122,7 +122,7 @@
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>8333.3</string>
|
||||
<string>8333</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
|
Loading…
Reference in New Issue
Block a user