From c490502f0153deb892b0efd6b81139d24e13aa79 Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Sat, 6 Mar 2021 22:28:13 -0800 Subject: [PATCH] bit of planning --- wfmain.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wfmain.cpp b/wfmain.cpp index 98aa3d7..2e76dfb 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -1228,7 +1228,6 @@ void wfmain::setTuningSteps() void wfmain::on_tuningStepCombo_currentIndexChanged(int index) { - qDebug() << __func__ << ": changing tuning step to index: " << index << " with value: " << ui->tuningStepCombo->itemData(index).toFloat(); tsWfScroll = ui->tuningStepCombo->itemData(index).toFloat(); tsKnobMHz = ui->tuningStepCombo->itemData(index).toFloat(); } @@ -2520,7 +2519,11 @@ void wfmain::on_freqDial_valueChanged(int value) if(ui->tuningFloorZerosChk->isChecked()) { - newFreqMhz = (double)round(newFreqMhz*10000) / 10000.0; + // 1000000 = 1 Hz + // 100000 = 10 Hz + // It will round but not nicely. This is clearly the wrong way to do this. + double fudge = 1000000 / ( stepSize*1E6); + newFreqMhz = (double)round(newFreqMhz*fudge) / fudge; } this->knobFreqMhz = newFreqMhz; // the frequency we think we should be on.