From 51ddd77aa3aa9c66827b63dc4c575a4ef2fa13a5 Mon Sep 17 00:00:00 2001 From: srcejon Date: Fri, 13 Oct 2023 08:54:11 +0100 Subject: [PATCH] Fix 8333 channels. --- .../freqscanner/freqscanneraddrangedialog.cpp | 16 ++++++++++++++-- .../freqscanner/freqscanneraddrangedialog.ui | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/plugins/channelrx/freqscanner/freqscanneraddrangedialog.cpp b/plugins/channelrx/freqscanner/freqscanneraddrangedialog.cpp index cdf24d2cb..124322fa3 100644 --- a/plugins/channelrx/freqscanner/freqscanneraddrangedialog.cpp +++ b/plugins/channelrx/freqscanner/freqscanneraddrangedialog.cpp @@ -15,6 +15,8 @@ // along with this program. If not, see . // /////////////////////////////////////////////////////////////////////////////////// +#include + #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); + } } } } diff --git a/plugins/channelrx/freqscanner/freqscanneraddrangedialog.ui b/plugins/channelrx/freqscanner/freqscanneraddrangedialog.ui index 73cd0a1aa..98cd619a9 100644 --- a/plugins/channelrx/freqscanner/freqscanneraddrangedialog.ui +++ b/plugins/channelrx/freqscanner/freqscanneraddrangedialog.ui @@ -122,7 +122,7 @@ - 8333.3 + 8333