From 596607e95ae09a42e1a7ebf2f33e90a057d8d4b0 Mon Sep 17 00:00:00 2001 From: Roeland Jansen Date: Fri, 13 Jan 2023 13:41:00 +0100 Subject: [PATCH 01/10] amended CHANGELOG and WHATSNEW --- CHANGELOG | 24 ++++++++++++++++++++++++ WHATSNEW | 1 + 2 files changed, 25 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index b4086d7..71e8501 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,27 @@ +commit 5c210f0699baf6c861dc87491747089b9f69f69f +Author: Phil Taylor +Date: Fri Jan 13 12:26:11 2023 +0000 + + Fix invalid filter width being sent to rig by rigctld. + +commit 996c8132515a14472fa50de41ff7a0d55edb6299 +Author: Phil Taylor +Date: Fri Jan 13 10:55:59 2023 +0000 + + Fix another minor issue with wfview.pro + +commit 8f5016a2f4e377eb7a7488f5bc49870b0526cb56 +Author: Phil Taylor +Date: Fri Jan 13 10:44:11 2023 +0000 + + Fix problem if USB_CONTROLLER isn't enabled + +commit f86a721a05e2517f32a9a345ee8eba58606adb49 +Author: Roeland Jansen +Date: Fri Jan 13 10:57:00 2023 +0100 + + cleanup + commit 7052dbf6efa4405f801030dede2b58e13d0ebda4 Author: Roeland Jansen Date: Fri Jan 13 10:53:51 2023 +0100 diff --git a/WHATSNEW b/WHATSNEW index caebbed..10cda4e 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -51,6 +51,7 @@ The following highlights are in this 1.51-release ince v1.50: Fix for QTAudio when using QT6 and above. +1.57 Merged current shuttle code in. Note that it does not work yet and is commented out in the build process + Fix invalid filter width being sent to rig by rigctld. From b468c514df891312af7102654ac98d48c90ef5a5 Mon Sep 17 00:00:00 2001 From: Roeland Jansen Date: Sat, 14 Jan 2023 19:59:04 +0100 Subject: [PATCH 02/10] added var filterwidth --- CHANGELOG | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ WHATSNEW | 2 +- 2 files changed, 98 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 71e8501..c148188 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,100 @@ +commit c221fb4a04006884e0fec8e16108828049c7eff1 +Merge: 596607e c3ba36e +Author: Roeland Jansen +Date: Sat Jan 14 19:58:02 2023 +0100 + + Merge branch 'filterwidth' + +commit c3ba36ebfdda9d2ef6b2d29274480e026cd3d0a9 +Author: Phil Taylor +Date: Sat Jan 14 11:23:19 2023 +0000 + + More mac stuff + +commit d1ec010e68f2961ef9c60fe891dbce638b930113 +Author: Phil Taylor +Date: Sat Jan 14 00:40:28 2023 +0000 + + more mac fixes + +commit e2f464620794f5b09bc5778eb87b7b1d1518020a +Author: Phil Taylor +Date: Sat Jan 14 00:35:27 2023 +0000 + + See if this fixes issue with mac compiling? + +commit 19818dc3b3f30b2efaa6d5bab5d8af5150d398fd +Author: Phil Taylor +Date: Sat Jan 14 00:21:55 2023 +0000 + + Fix for fix of mac build! + +commit 58f86f029bed3096ba5b2f3178a69b50cc81f871 +Author: Phil Taylor +Date: Sat Jan 14 00:17:53 2023 +0000 + + Fix for mac compile + +commit b285b81d721bd0df9240cad3c6166d293f1405e9 +Author: Phil Taylor +Date: Fri Jan 13 21:07:55 2023 +0000 + + Rename to IF filter width to match documentation + +commit 8f98696bec315f9ad0a2c74322097dd04b63f340 +Author: Phil Taylor +Date: Fri Jan 13 21:06:50 2023 +0000 + + Change wording + +commit 4f4cd5146c0aecb846f8d1ad53b94563ded4773e +Author: Phil Taylor +Date: Fri Jan 13 21:04:10 2023 +0000 + + Display current passband on status bar + +commit cac454cbf64b87056f3e3c6501d9c110220e05e1 +Author: Phil Taylor +Date: Fri Jan 13 20:53:51 2023 +0000 + + More tidying of code + +commit 3e46b5a42d18d8c8040014d81567765fef4667f9 +Author: Phil Taylor +Date: Fri Jan 13 19:40:38 2023 +0000 + + More tidying + +commit 41e5e4b1c30768865ac2046296fda288be1acbab +Author: Phil Taylor +Date: Fri Jan 13 19:28:34 2023 +0000 + + Another fix + +commit d48bdfa6e227963aa8fa20da63aa4b5d921de8ca +Author: Phil Taylor +Date: Fri Jan 13 19:19:04 2023 +0000 + + Fix parentheses warning from GCC + +commit 4ee87411577bca983d26f84b1d2d03560eae3ac1 +Author: Phil Taylor +Date: Fri Jan 13 18:50:06 2023 +0000 + + Few fixes to passband dragging + +commit efb953a8c9f68e2be5558621411310aca9e52032 +Author: Phil Taylor +Date: Fri Jan 13 18:14:11 2023 +0000 + + Allow on-screen adjustment of filter width + +commit 596607e95ae09a42e1a7ebf2f33e90a057d8d4b0 +Author: Roeland Jansen +Date: Fri Jan 13 13:41:00 2023 +0100 + + amended CHANGELOG and WHATSNEW + commit 5c210f0699baf6c861dc87491747089b9f69f69f Author: Phil Taylor Date: Fri Jan 13 12:26:11 2023 +0000 diff --git a/WHATSNEW b/WHATSNEW index 10cda4e..86c8814 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -52,7 +52,7 @@ The following highlights are in this 1.51-release ince v1.50: +1.57 Merged current shuttle code in. Note that it does not work yet and is commented out in the build process Fix invalid filter width being sent to rig by rigctld. - + Ability to drag the passband for a variable filter width From 9c0aea01026c41827cb953a8cc1f1b7795528fe6 Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Tue, 17 Jan 2023 20:53:34 -0800 Subject: [PATCH 03/10] Changed Show More button to also raise the transceiver adjustments window. Added "reset PBT" button to the transceiver adjustments window. --- transceiveradjustments.cpp | 11 ++++++++++- transceiveradjustments.h | 2 ++ transceiveradjustments.ui | 29 ++++++++++++++++++++++++++++- wfmain.cpp | 8 ++++++++ 4 files changed, 48 insertions(+), 2 deletions(-) diff --git a/transceiveradjustments.cpp b/transceiveradjustments.cpp index 8298bb8..c95d1e0 100644 --- a/transceiveradjustments.cpp +++ b/transceiveradjustments.cpp @@ -24,7 +24,7 @@ transceiverAdjustments::transceiverAdjustments(QWidget *parent) : this->window()->resize(QSizePolicy::Minimum, QSizePolicy::Minimum); #endif - + this->setWindowTitle("TransceiverAdjustments"); } transceiverAdjustments::~transceiverAdjustments() @@ -103,3 +103,12 @@ void transceiverAdjustments::updateTPBFOuter(unsigned char level) ui->TPBFOuterSlider->setValue(level); ui->TPBFOuterSlider->blockSignals(false); } + +void transceiverAdjustments::on_resetPBTbtn_clicked() +{ + ui->TPBFInnerSlider->setValue(128); + ui->TPBFOuterSlider->setValue(128); + ui->IFShiftSlider->blockSignals(true); + ui->IFShiftSlider->setValue(128); + ui->IFShiftSlider->blockSignals(false); +} diff --git a/transceiveradjustments.h b/transceiveradjustments.h index 2f5ecd6..eeaa1c0 100644 --- a/transceiveradjustments.h +++ b/transceiveradjustments.h @@ -40,6 +40,8 @@ private slots: void on_TPBFOuterSlider_valueChanged(int value); + void on_resetPBTbtn_clicked(); + private: Ui::transceiverAdjustments *ui; rigCapabilities rigCaps; diff --git a/transceiveradjustments.ui b/transceiveradjustments.ui index 62debf0..6126b21 100644 --- a/transceiveradjustments.ui +++ b/transceiveradjustments.ui @@ -7,7 +7,7 @@ 0 0 832 - 337 + 342 @@ -463,6 +463,33 @@ + + + + 0 + + + + + Reset PBT + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + diff --git a/wfmain.cpp b/wfmain.cpp index 1cd6317..832b70a 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -6770,7 +6770,15 @@ void wfmain::on_waterfallFormatCombo_activated(int index) void wfmain::on_moreControlsBtn_clicked() { + if(trxadj->isMinimized()) + { + trxadj->raise(); + trxadj->activateWindow(); + return; + } trxadj->show(); + trxadj->raise(); + trxadj->activateWindow(); } void wfmain::on_useCIVasRigIDChk_clicked(bool checked) From f820d289b2b92a0ebe28176773c85a6468f553eb Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Tue, 17 Jan 2023 21:09:54 -0800 Subject: [PATCH 04/10] Re-arranged the preference structure to match how we save the preferences. --- prefs.h | 38 ++++++++++++++++++++++++++------------ wfmain.cpp | 10 +++++++++- 2 files changed, 35 insertions(+), 13 deletions(-) diff --git a/prefs.h b/prefs.h index 4309e33..9b2a669 100644 --- a/prefs.h +++ b/prefs.h @@ -6,7 +6,13 @@ #include "wfviewtypes.h" struct preferences { + // Program: QString version; + int majorVersion = 0; + int minorVersion = 0; + QString gitShort; + + // Interface: bool useFullScreen; bool useSystemTheme; bool drawPeaks; @@ -14,31 +20,40 @@ struct preferences { int underlayBufferSize = 64; bool wfAntiAlias; bool wfInterpolate; + int wftheme; + int plotFloor; + int plotCeiling; QString stylesheetPath; + unsigned int wflength; + bool confirmExit; + bool confirmPowerOff; + meterKind meter2Type; + bool clickDragTuningEnable; + + // Radio: unsigned char radioCIVAddr; bool CIVisRadioModel; bool forceRTSasPTT; + int polling_ms; QString serialPortRadio; quint32 serialPortBaud; - int polling_ms; + QString virtualSerialPort; + unsigned char localAFgain; + audioType audioSystem; + + // Controls: bool enablePTT; bool niceTS; + + // LAN: bool enableLAN; bool enableRigCtlD; quint16 rigCtlPort; int currentColorPresetNumber = 0; - QString virtualSerialPort; - unsigned char localAFgain; - unsigned int wflength; - int wftheme; - int plotFloor; - int plotCeiling; - bool confirmExit; - bool confirmPowerOff; - meterKind meter2Type; quint16 tcpPort; quint8 waterfallFormat; - audioType audioSystem; + + // Cluster: bool clusterUdpEnable; bool clusterTcpEnable; int clusterUdpPort; @@ -46,7 +61,6 @@ struct preferences { QString clusterTcpUserName; QString clusterTcpPassword; int clusterTimeout; - bool clickDragTuningEnable; bool clusterSkimmerSpotsEnable; }; diff --git a/wfmain.cpp b/wfmain.cpp index 832b70a..ef3aaf6 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -2439,8 +2439,16 @@ void wfmain::saveSettings() qInfo(logSystem()) << "Saving settings to " << settings->fileName(); // Basic things to load: + QString versionstr = QString(WFVIEW_VERSION); + QString majorVersion = versionstr.split(".").at(0); + QString minorVersion = versionstr.split(".").at(1); + + settings->beginGroup("Program"); - settings->setValue("version", QString(WFVIEW_VERSION)); + settings->setValue("version", versionstr); + settings->setValue("majorVersion", int(majorVersion.toInt()); + settings->setValue("minorVersion", int(minorVersion.toInt()); + settings->setValue("gitShort", QString(GITSHORT)); settings->endGroup(); // UI: (full screen, dark theme, draw peaks, colors, etc) From fc753ffd39357f49035fc14a30b299227208ead4 Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Tue, 17 Jan 2023 21:13:16 -0800 Subject: [PATCH 05/10] cleanup of prefs --- prefs.h | 4 ++-- wfmain.cpp | 15 ++++++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/prefs.h b/prefs.h index 9b2a669..9b60d24 100644 --- a/prefs.h +++ b/prefs.h @@ -60,8 +60,8 @@ struct preferences { QString clusterTcpServerName; QString clusterTcpUserName; QString clusterTcpPassword; - int clusterTimeout; - bool clusterSkimmerSpotsEnable; + int clusterTimeout; // used? + bool clusterSkimmerSpotsEnable; // where is this used? }; #endif // PREFS_H diff --git a/wfmain.cpp b/wfmain.cpp index ef3aaf6..454ddd6 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -2439,15 +2439,20 @@ void wfmain::saveSettings() qInfo(logSystem()) << "Saving settings to " << settings->fileName(); // Basic things to load: - QString versionstr = QString(WFVIEW_VERSION); - QString majorVersion = versionstr.split(".").at(0); - QString minorVersion = versionstr.split(".").at(1); + QString versionstr = QString(WFVIEW_VERSION); + QString majorVersion = "-1"; + QString minorVersion = "-1"; + if(versionstr.contains(".") && (versionstr.split(".").length() == 2)) + { + majorVersion = versionstr.split(".").at(0); + minorVersion = versionstr.split(".").at(1); + } settings->beginGroup("Program"); settings->setValue("version", versionstr); - settings->setValue("majorVersion", int(majorVersion.toInt()); - settings->setValue("minorVersion", int(minorVersion.toInt()); + settings->setValue("majorVersion", int(majorVersion.toInt())); + settings->setValue("minorVersion", int(minorVersion.toInt())); settings->setValue("gitShort", QString(GITSHORT)); settings->endGroup(); From 05295acc6f87d7555a1f2352d0f5b5833019859c Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Tue, 17 Jan 2023 21:43:58 -0800 Subject: [PATCH 06/10] Added version mismatch warning messages. --- wfmain.cpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/wfmain.cpp b/wfmain.cpp index 454ddd6..a5c9555 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -1118,8 +1118,6 @@ void wfmain::getSettingsFilePath(QString settingsFile) path = path + "/"; file = info.fileName(); } - - qInfo(logSystem()) << "Loading settings from:" << path + file; settings = new QSettings(path + file, QSettings::Format::IniFormat); } } @@ -1594,7 +1592,25 @@ void wfmain::loadSettings() { qInfo(logSystem()) << "Loading settings from " << settings->fileName(); - // Basic things to load: + QString currentVersionString = QString(WFVIEW_VERSION); + float currentVersionFloat = currentVersionString.toFloat(); + + settings->beginGroup("Program"); + QString priorVersionString = settings->value("version", "unset").toString(); + float priorVersionFloat = priorVersionString.toFloat(); + if(currentVersionString != priorVersionString) + { + qWarning(logSystem()) << "Settings previously saved under version " << priorVersionString << ", you should review your settings and press SaveSettings."; + } + if(priorVersionFloat > currentVersionFloat) + { + qWarning(logSystem()).noquote().nospace() << "It looks like the previous version of wfview (" << priorVersionString << ") was newer than this version (" << currentVersionString << ")"; + } + prefs.version = priorVersionString; + prefs.majorVersion = settings->value("majorVersion", defPrefs.majorVersion).toInt(); + prefs.minorVersion = settings->value("minorVersion", defPrefs.minorVersion).toInt(); + settings->endGroup(); + // UI: (full screen, dark theme, draw peaks, colors, etc) settings->beginGroup("Interface"); prefs.useFullScreen = settings->value("UseFullScreen", defPrefs.useFullScreen).toBool(); From 0c27bf72084971ee8bb0166984fa64ebcfc26dad Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Tue, 17 Jan 2023 21:49:17 -0800 Subject: [PATCH 07/10] This is a stylistic thing that I saw which I could not let go. --- wfmain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wfmain.cpp b/wfmain.cpp index a5c9555..c2e1522 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -1600,7 +1600,7 @@ void wfmain::loadSettings() float priorVersionFloat = priorVersionString.toFloat(); if(currentVersionString != priorVersionString) { - qWarning(logSystem()) << "Settings previously saved under version " << priorVersionString << ", you should review your settings and press SaveSettings."; + qWarning(logSystem()) << "Settings previously saved under version " << priorVersionString << ", you should review your settings and press SaveSettings."; } if(priorVersionFloat > currentVersionFloat) { From e9e042fad8adf43038d97016dbdce776732b27a1 Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Wed, 18 Jan 2023 22:27:06 -0800 Subject: [PATCH 08/10] Change mode selection code to use the command queue (as it should have). Beginnings of automatic sideband options. --- freqmemory.h | 32 +------------------------------- sidebandchooser.cpp | 0 sidebandchooser.h | 39 +++++++++++++++++++++++++++++++++++++++ wfmain.cpp | 15 ++++++++++++--- wfmain.h | 1 + wfview.pro | 1 + wfviewtypes.h | 30 ++++++++++++++++++++++++++++++ 7 files changed, 84 insertions(+), 34 deletions(-) create mode 100644 sidebandchooser.cpp create mode 100644 sidebandchooser.h diff --git a/freqmemory.h b/freqmemory.h index 0067158..58f8c7e 100644 --- a/freqmemory.h +++ b/freqmemory.h @@ -2,37 +2,7 @@ #define FREQMEMORY_H #include #include - -// 0 1 2 3 4 -//modes << "LSB" << "USB" << "AM" << "CW" << "RTTY"; -// 5 6 7 8 9 -// modes << "FM" << "CW-R" << "RTTY-R" << "LSB-D" << "USB-D"; - -enum mode_kind { - modeLSB=0x00, - modeUSB=0x01, - modeAM=0x02, - modeCW=0x03, - modeRTTY=0x04, - modeFM=0x05, - modeCW_R=0x07, - modeRTTY_R=0x08, - modePSK = 0x12, - modePSK_R = 0x13, - modeLSB_D=0x80, - modeUSB_D=0x81, - modeDV=0x17, - modeDD=0x27, - modeWFM, - modeS_AMD, - modeS_AML, - modeS_AMU, - modeP25, - modedPMR, - modeNXDN_VN, - modeNXDN_N, - modeDCR -}; +#include "wfviewtypes.h" struct mode_info { mode_kind mk; diff --git a/sidebandchooser.cpp b/sidebandchooser.cpp new file mode 100644 index 0000000..e69de29 diff --git a/sidebandchooser.h b/sidebandchooser.h new file mode 100644 index 0000000..c3c2872 --- /dev/null +++ b/sidebandchooser.h @@ -0,0 +1,39 @@ +#ifndef SIDEBANDCHOOSER_H +#define SIDEBANDCHOOSER_H + +#include "wfviewtypes.h" + +class sidebandChooser +{ +public: + sidebandChooser(); + + static inline mode_kind getMode(freqt f, mode_kind currentMode = modeUSB) { + + if((currentMode == modeLSB) || (currentMode == modeUSB) ) + { + if(f.Hz < 5000000) + { + return modeLSB; + } + if( (f.Hz >= 5000000) || (f.Hz < 5600000) ) + { + return modeUSB; + } + if( (f.Hz >= 5600000) || (f.Hz < 10000000) ) + { + return modeLSB; + } + + return modeUSB; + } else { + return currentMode; + } + } + + +private: + +}; + +#endif // SIDEBANDCHOOSER_H diff --git a/wfmain.cpp b/wfmain.cpp index c2e1522..f7b9c01 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -4885,18 +4885,23 @@ void wfmain::on_goFreqBtn_clicked() if(ok) { f.Hz = freqDbl*1E6; - issueCmd(cmdSetFreq, f); } } else { KHz = ui->freqMhzLineEdit->text().toInt(&ok); if(ok) { f.Hz = KHz*1E3; - issueCmd(cmdSetFreq, f); } } if(ok) { + mode_info m; + issueCmd(cmdSetFreq, f); + m.mk = sidebandChooser::getMode(f, currentMode); + qDebug(logSystem()) << "current mode: " << currentMode << "new mode:" << m.mk; + if(m.mk != currentMode) + issueCmd(cmdSetMode, m); + f.MHzDouble = (float)f.Hz / 1E6; freq = f; setUIFreq(); @@ -5055,7 +5060,11 @@ void wfmain::changeMode(mode_kind mode) void wfmain::changeMode(mode_kind mode, bool dataOn) { int filter = ui->modeFilterCombo->currentData().toInt(); - emit setMode((unsigned char)mode, (unsigned char)filter); + mode_info m; + m.filter = (unsigned char) filter; + m.reg = (unsigned char) mode; + issueCmd(cmdSetMode, m); + //emit setMode((unsigned char)mode, (unsigned char)filter); currentMode = mode; diff --git a/wfmain.h b/wfmain.h index 3db01a1..3e7175b 100644 --- a/wfmain.h +++ b/wfmain.h @@ -44,6 +44,7 @@ #include "loggingwindow.h" #include "cluster.h" #include "audiodevices.h" +#include "sidebandchooser.h" #include #include diff --git a/wfview.pro b/wfview.pro index b041382..94b7d66 100644 --- a/wfview.pro +++ b/wfview.pro @@ -237,6 +237,7 @@ HEADERS += wfmain.h \ rigcommander.h \ freqmemory.h \ rigidentities.h \ + sidebandchooser.h \ udpbase.h \ udphandler.h \ udpcivdata.h \ diff --git a/wfviewtypes.h b/wfviewtypes.h index 4df1add..db229f8 100644 --- a/wfviewtypes.h +++ b/wfviewtypes.h @@ -1,6 +1,10 @@ #ifndef WFVIEWTYPES_H #define WFVIEWTYPES_H +#include +#include +#include + enum underlay_t { underlayNone, underlayPeakHold, underlayPeakBuffer, underlayAverageBuffer }; enum meterKind { @@ -28,6 +32,32 @@ enum spectrumMode { spectModeUnknown=0xff }; +enum mode_kind { + modeLSB=0x00, + modeUSB=0x01, + modeAM=0x02, + modeCW=0x03, + modeRTTY=0x04, + modeFM=0x05, + modeCW_R=0x07, + modeRTTY_R=0x08, + modePSK = 0x12, + modePSK_R = 0x13, + modeLSB_D=0x80, + modeUSB_D=0x81, + modeDV=0x17, + modeDD=0x27, + modeWFM, + modeS_AMD, + modeS_AML, + modeS_AMU, + modeP25, + modedPMR, + modeNXDN_VN, + modeNXDN_N, + modeDCR +}; + struct freqt { quint64 Hz; double MHzDouble; From b99249692fe855f5ee9f8875bb80db50c8d19584 Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Wed, 18 Jan 2023 22:50:18 -0800 Subject: [PATCH 09/10] Cleaned up some old mode selection code. --- wfmain.cpp | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/wfmain.cpp b/wfmain.cpp index f7b9c01..6cf45de 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -4811,26 +4811,28 @@ void wfmain::receiveMode(unsigned char mode, unsigned char filter) found = true; } } - currentModeIndex = mode; - currentModeInfo.mk = (mode_kind)mode; - currentModeInfo.filter = filter; + } else { - qInfo(logSystem()) << __func__ << "Invalid mode " << mode << " received. "; + qCritical(logSystem()) << __func__ << "Invalid mode " << mode << " received. "; } if(!found) { - qInfo(logSystem()) << __func__ << "Received mode " << mode << " but could not match to any index within the modeSelectCombo. "; + qWarning(logSystem()) << __func__ << "Received mode " << mode << " but could not match to any index within the modeSelectCombo. "; + return; } + currentModeIndex = mode; + currentModeInfo.mk = (mode_kind)mode; + currentMode = (mode_kind)mode; + currentModeInfo.filter = filter; + if( (filter) && (filter < 4)){ ui->modeFilterCombo->blockSignals(true); ui->modeFilterCombo->setCurrentIndex(filter-1); ui->modeFilterCombo->blockSignals(false); } - (void)filter; - // Note: we need to know if the DATA mode is active to reach mode-D // some kind of queued query: if (rigCaps.hasDataModes && rigCaps.hasTransmit) @@ -4898,6 +4900,9 @@ void wfmain::on_goFreqBtn_clicked() mode_info m; issueCmd(cmdSetFreq, f); m.mk = sidebandChooser::getMode(f, currentMode); + 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) issueCmd(cmdSetMode, m); @@ -5064,17 +5069,16 @@ void wfmain::changeMode(mode_kind mode, bool dataOn) m.filter = (unsigned char) filter; m.reg = (unsigned char) mode; issueCmd(cmdSetMode, m); - //emit setMode((unsigned char)mode, (unsigned char)filter); currentMode = mode; - if(dataOn) + if(dataOn && (!usingDataMode)) { issueDelayedCommand(cmdSetDataModeOn); ui->dataModeBtn->blockSignals(true); ui->dataModeBtn->setChecked(true); ui->dataModeBtn->blockSignals(false); - } else { + } else if ((!dataOn) && usingDataMode) { issueDelayedCommand(cmdSetDataModeOff); ui->dataModeBtn->blockSignals(true); ui->dataModeBtn->setChecked(false); @@ -5116,7 +5120,6 @@ void wfmain::on_modeSelectCombo_activated(int index) issueCmd(cmdSetMode, mode); currentModeInfo = mode; - //emit setMode(newMode, filterSelection); } } @@ -5788,6 +5791,7 @@ void wfmain::on_modeFilterCombo_activated(int index) { int filterSelection = ui->modeFilterCombo->itemData(index).toInt(); + mode_info m; if(filterSelection == 99) { // TODO: @@ -5802,8 +5806,13 @@ void wfmain::on_modeFilterCombo_activated(int index) if(ui->dataModeBtn->isChecked()) { emit setDataMode(true, (unsigned char)filterSelection); + issueDelayedCommand(cmdSetDataModeOn); } else { - emit setMode(newMode, (unsigned char)filterSelection); + m.filter = (unsigned char)filterSelection; + m.mk = (mode_kind)newMode; + m.reg = newMode; + issueCmd(cmdSetMode, m); + //emit setMode(newMode, (unsigned char)filterSelection); } } From 71326cd3851ba1019665fa327345263d36a9493b Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Wed, 18 Jan 2023 23:17:28 -0800 Subject: [PATCH 10/10] Added preference for automatic sideband. --- prefs.h | 1 + sidebandchooser.h | 4 ++-- wfmain.cpp | 22 +++++++++++++++++++--- wfmain.h | 2 ++ wfmain.ui | 30 ++++++++++++++++++++++++------ 5 files changed, 48 insertions(+), 11 deletions(-) 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 @@ - +