1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-09-27 07:16:48 -04:00

Fix 8333 channels.

This commit is contained in:
srcejon 2023-10-13 08:54:11 +01:00
parent bb2655cd51
commit 51ddd77aa3
2 changed files with 15 additions and 3 deletions

View File

@ -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"
@ -79,12 +81,22 @@ void FreqScannerAddRangeDialog::accept()
int step = ui->step->currentText().toInt();
if ((start <= stop) && (step > 0))
{
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);
}
}
}
}
QDialog::accept();
}

View File

@ -122,7 +122,7 @@
</item>
<item>
<property name="text">
<string>8333.3</string>
<string>8333</string>
</property>
</item>
<item>