diff --git a/prefs.h b/prefs.h index 9b60d24..3f855d0 100644 --- a/prefs.h +++ b/prefs.h @@ -44,6 +44,7 @@ struct preferences { // Controls: bool enablePTT; bool niceTS; + bool automaticSidebandSwitching = true; // LAN: bool enableLAN; diff --git a/sidebandchooser.h b/sidebandchooser.h index c3c2872..93d6b2a 100644 --- a/sidebandchooser.h +++ b/sidebandchooser.h @@ -16,11 +16,11 @@ public: { return modeLSB; } - if( (f.Hz >= 5000000) || (f.Hz < 5600000) ) + if( (f.Hz >= 5000000) && (f.Hz < 5600000) ) { return modeUSB; } - if( (f.Hz >= 5600000) || (f.Hz < 10000000) ) + if( (f.Hz >= 5600000) && (f.Hz < 10000000) ) { return modeLSB; } diff --git a/wfmain.cpp b/wfmain.cpp index 6cf45de..9a0a9d6 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -1256,6 +1256,14 @@ void wfmain::setUIToPrefs() ui->wfthemeCombo->setCurrentIndex(ui->wfthemeCombo->findData(prefs.wftheme)); colorMap->setGradient(static_cast(prefs.wftheme)); + ui->tuningFloorZerosChk->blockSignals(true); + ui->tuningFloorZerosChk->setChecked(prefs.niceTS); + ui->tuningFloorZerosChk->blockSignals(false); + + ui->autoSSBchk->blockSignals(true); + ui->autoSSBchk->setChecked(prefs.automaticSidebandSwitching); + ui->autoSSBchk->blockSignals(false); + ui->useCIVasRigIDChk->blockSignals(true); ui->useCIVasRigIDChk->setChecked(prefs.CIVisRadioModel); ui->useCIVasRigIDChk->blockSignals(false); @@ -1780,7 +1788,7 @@ void wfmain::loadSettings() prefs.enablePTT = settings->value("EnablePTT", defPrefs.enablePTT).toBool(); ui->pttEnableChk->setChecked(prefs.enablePTT); prefs.niceTS = settings->value("NiceTS", defPrefs.niceTS).toBool(); - + prefs.automaticSidebandSwitching = settings->value("automaticSidebandSwitching", defPrefs.automaticSidebandSwitching).toBool(); settings->endGroup(); settings->beginGroup("LAN"); @@ -2514,6 +2522,7 @@ void wfmain::saveSettings() settings->beginGroup("Controls"); settings->setValue("EnablePTT", prefs.enablePTT); settings->setValue("NiceTS", prefs.niceTS); + settings->setValue("automaticSidebandSwitching", prefs.automaticSidebandSwitching); settings->endGroup(); settings->beginGroup("LAN"); @@ -4903,9 +4912,11 @@ void wfmain::on_goFreqBtn_clicked() m.reg = (unsigned char) m.mk; m.filter = ui->modeFilterCombo->currentData().toInt(); - qDebug(logSystem()) << "current mode: " << currentMode << "new mode:" << m.mk; - if(m.mk != currentMode) + if((m.mk != currentMode) && !usingDataMode && prefs.automaticSidebandSwitching) + { issueCmd(cmdSetMode, m); + currentMode = m.mk; + } f.MHzDouble = (float)f.Hz / 1E6; freq = f; @@ -8194,3 +8205,8 @@ void wfmain::connectionHandler(bool connect) } } } + +void wfmain::on_autoSSBchk_clicked(bool checked) +{ + prefs.automaticSidebandSwitching = checked; +} diff --git a/wfmain.h b/wfmain.h index 3e7175b..4a3ff86 100644 --- a/wfmain.h +++ b/wfmain.h @@ -714,6 +714,8 @@ private slots: void on_pollTimeMsSpin_valueChanged(int arg1); + void on_autoSSBchk_clicked(bool checked); + private: Ui::wfmain *ui; void closeEvent(QCloseEvent *event); diff --git a/wfmain.ui b/wfmain.ui index 02f8db1..6578ae3 100644 --- a/wfmain.ui +++ b/wfmain.ui @@ -1798,6 +1798,7 @@ DejaVu Sans Mono 14 + 75 true @@ -2222,7 +2223,7 @@ - 6 + 1 @@ -2914,6 +2915,22 @@ + + + + When using SSB, automatically switch to the standard sideband for a given band. + + + Auto SSB Switching + + + When using SSB, automatically switch to the standard sideband for a given band. + + + Auto SSB + + + @@ -3382,8 +3399,8 @@ 0 0 - 579 - 224 + 858 + 287 @@ -5128,7 +5145,7 @@ 10 470 801 - 22 + 24 @@ -5332,6 +5349,7 @@ + 50 false @@ -5351,7 +5369,7 @@ 0 0 1082 - 22 + 21 @@ -5378,8 +5396,8 @@ - +