Merge remote-tracking branch 'origin/efixes' into filterwidth

half-duplex
Phil Taylor 2023-01-19 16:18:29 +00:00
commit c98d7094f9
14 zmienionych plików z 379 dodań i 70 usunięć

121
CHANGELOG
Wyświetl plik

@ -1,3 +1,124 @@
commit c221fb4a04006884e0fec8e16108828049c7eff1
Merge: 596607e c3ba36e
Author: Roeland Jansen <roeland.jansen69@gmail.com>
Date: Sat Jan 14 19:58:02 2023 +0100
Merge branch 'filterwidth'
commit c3ba36ebfdda9d2ef6b2d29274480e026cd3d0a9
Author: Phil Taylor <phil@m0vse.uk>
Date: Sat Jan 14 11:23:19 2023 +0000
More mac stuff
commit d1ec010e68f2961ef9c60fe891dbce638b930113
Author: Phil Taylor <phil@m0vse.uk>
Date: Sat Jan 14 00:40:28 2023 +0000
more mac fixes
commit e2f464620794f5b09bc5778eb87b7b1d1518020a
Author: Phil Taylor <phil@m0vse.uk>
Date: Sat Jan 14 00:35:27 2023 +0000
See if this fixes issue with mac compiling?
commit 19818dc3b3f30b2efaa6d5bab5d8af5150d398fd
Author: Phil Taylor <phil@m0vse.uk>
Date: Sat Jan 14 00:21:55 2023 +0000
Fix for fix of mac build!
commit 58f86f029bed3096ba5b2f3178a69b50cc81f871
Author: Phil Taylor <phil@m0vse.uk>
Date: Sat Jan 14 00:17:53 2023 +0000
Fix for mac compile
commit b285b81d721bd0df9240cad3c6166d293f1405e9
Author: Phil Taylor <phil@m0vse.uk>
Date: Fri Jan 13 21:07:55 2023 +0000
Rename to IF filter width to match documentation
commit 8f98696bec315f9ad0a2c74322097dd04b63f340
Author: Phil Taylor <phil@m0vse.uk>
Date: Fri Jan 13 21:06:50 2023 +0000
Change wording
commit 4f4cd5146c0aecb846f8d1ad53b94563ded4773e
Author: Phil Taylor <phil@m0vse.uk>
Date: Fri Jan 13 21:04:10 2023 +0000
Display current passband on status bar
commit cac454cbf64b87056f3e3c6501d9c110220e05e1
Author: Phil Taylor <phil@m0vse.uk>
Date: Fri Jan 13 20:53:51 2023 +0000
More tidying of code
commit 3e46b5a42d18d8c8040014d81567765fef4667f9
Author: Phil Taylor <phil@m0vse.uk>
Date: Fri Jan 13 19:40:38 2023 +0000
More tidying
commit 41e5e4b1c30768865ac2046296fda288be1acbab
Author: Phil Taylor <phil@m0vse.uk>
Date: Fri Jan 13 19:28:34 2023 +0000
Another fix
commit d48bdfa6e227963aa8fa20da63aa4b5d921de8ca
Author: Phil Taylor <phil@m0vse.uk>
Date: Fri Jan 13 19:19:04 2023 +0000
Fix parentheses warning from GCC
commit 4ee87411577bca983d26f84b1d2d03560eae3ac1
Author: Phil Taylor <phil@m0vse.uk>
Date: Fri Jan 13 18:50:06 2023 +0000
Few fixes to passband dragging
commit efb953a8c9f68e2be5558621411310aca9e52032
Author: Phil Taylor <phil@m0vse.uk>
Date: Fri Jan 13 18:14:11 2023 +0000
Allow on-screen adjustment of filter width
commit 596607e95ae09a42e1a7ebf2f33e90a057d8d4b0
Author: Roeland Jansen <roeland.jansen69@gmail.com>
Date: Fri Jan 13 13:41:00 2023 +0100
amended CHANGELOG and WHATSNEW
commit 5c210f0699baf6c861dc87491747089b9f69f69f
Author: Phil Taylor <phil@m0vse.uk>
Date: Fri Jan 13 12:26:11 2023 +0000
Fix invalid filter width being sent to rig by rigctld.
commit 996c8132515a14472fa50de41ff7a0d55edb6299
Author: Phil Taylor <phil@m0vse.uk>
Date: Fri Jan 13 10:55:59 2023 +0000
Fix another minor issue with wfview.pro
commit 8f5016a2f4e377eb7a7488f5bc49870b0526cb56
Author: Phil Taylor <phil@m0vse.uk>
Date: Fri Jan 13 10:44:11 2023 +0000
Fix problem if USB_CONTROLLER isn't enabled
commit f86a721a05e2517f32a9a345ee8eba58606adb49
Author: Roeland Jansen <roeland.jansen69@gmail.com>
Date: Fri Jan 13 10:57:00 2023 +0100
cleanup
commit 7052dbf6efa4405f801030dede2b58e13d0ebda4
Author: Roeland Jansen <roeland.jansen69@gmail.com>
Date: Fri Jan 13 10:53:51 2023 +0100

Wyświetl plik

@ -51,7 +51,8 @@ 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.
Ability to drag the passband for a variable filter width

Wyświetl plik

@ -2,37 +2,7 @@
#define FREQMEMORY_H
#include <QString>
#include <QDebug>
// 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;

43
prefs.h
Wyświetl plik

@ -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,40 +20,49 @@ 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;
bool automaticSidebandSwitching = true;
// 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;
QString clusterTcpServerName;
QString clusterTcpUserName;
QString clusterTcpPassword;
int clusterTimeout;
bool clickDragTuningEnable;
bool clusterSkimmerSpotsEnable;
int clusterTimeout; // used?
bool clusterSkimmerSpotsEnable; // where is this used?
};
#endif // PREFS_H

Wyświetl plik

39
sidebandchooser.h 100644
Wyświetl plik

@ -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

Wyświetl plik

@ -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);
}

Wyświetl plik

@ -40,6 +40,8 @@ private slots:
void on_TPBFOuterSlider_valueChanged(int value);
void on_resetPBTbtn_clicked();
private:
Ui::transceiverAdjustments *ui;
rigCapabilities rigCaps;

Wyświetl plik

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>832</width>
<height>337</height>
<height>342</height>
</rect>
</property>
<property name="windowTitle">
@ -463,6 +463,33 @@
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="topMargin">
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="resetPBTbtn">
<property name="text">
<string>Reset PBT</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>

Wyświetl plik

@ -1134,8 +1134,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);
}
}
@ -1274,6 +1272,14 @@ void wfmain::setUIToPrefs()
ui->wfthemeCombo->setCurrentIndex(ui->wfthemeCombo->findData(prefs.wftheme));
colorMap->setGradient(static_cast<QCPColorGradient::GradientPreset>(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);
@ -1610,7 +1616,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();
@ -1781,7 +1805,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");
@ -2456,8 +2480,21 @@ void wfmain::saveSettings()
qInfo(logSystem()) << "Saving settings to " << settings->fileName();
// Basic things to load:
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", 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)
@ -2502,6 +2539,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");
@ -5019,22 +5057,26 @@ void wfmain::receiveMode(unsigned char mode, unsigned char 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)
@ -5089,18 +5131,28 @@ 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);
m.reg = (unsigned char) m.mk;
m.filter = ui->modeFilterCombo->currentData().toInt();
if((m.mk != currentMode) && !usingDataMode && prefs.automaticSidebandSwitching)
{
issueCmd(cmdSetMode, m);
currentMode = m.mk;
}
f.MHzDouble = (float)f.Hz / 1E6;
freq = f;
setUIFreq();
@ -5259,17 +5311,20 @@ 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);
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);
@ -5311,7 +5366,6 @@ void wfmain::on_modeSelectCombo_activated(int index)
issueCmd(cmdSetMode, mode);
currentModeInfo = mode;
//emit setMode(newMode, filterSelection);
}
}
@ -5985,6 +6039,7 @@ void wfmain::on_modeFilterCombo_activated(int index)
{
int filterSelection = ui->modeFilterCombo->itemData(index).toInt();
mode_info m;
if(filterSelection == 99)
{
// TODO:
@ -5999,8 +6054,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);
}
}
@ -7024,7 +7084,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)
@ -8403,3 +8471,8 @@ void wfmain::connectionHandler(bool connect)
}
}
}
void wfmain::on_autoSSBchk_clicked(bool checked)
{
prefs.automaticSidebandSwitching = checked;
}

Wyświetl plik

@ -44,6 +44,7 @@
#include "loggingwindow.h"
#include "cluster.h"
#include "audiodevices.h"
#include "sidebandchooser.h"
#include <qcustomplot.h>
#include <qserialportinfo.h>
@ -717,6 +718,8 @@ private slots:
void on_pollTimeMsSpin_valueChanged(int arg1);
void on_autoSSBchk_clicked(bool checked);
private:
Ui::wfmain *ui;
void closeEvent(QCloseEvent *event);

Wyświetl plik

@ -1798,6 +1798,7 @@
<font>
<family>DejaVu Sans Mono</family>
<pointsize>14</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
@ -2222,7 +2223,7 @@
<item>
<widget class="QStackedWidget" name="settingsStack">
<property name="currentIndex">
<number>6</number>
<number>1</number>
</property>
<widget class="QWidget" name="radioAccess">
<layout class="QVBoxLayout" name="verticalLayout_21">
@ -2914,6 +2915,22 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="autoSSBchk">
<property name="toolTip">
<string>When using SSB, automatically switch to the standard sideband for a given band.</string>
</property>
<property name="accessibleName">
<string>Auto SSB Switching</string>
</property>
<property name="accessibleDescription">
<string>When using SSB, automatically switch to the standard sideband for a given band.</string>
</property>
<property name="text">
<string>Auto SSB</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="clickDragTuningEnableChk">
<property name="text">
@ -3382,8 +3399,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>579</width>
<height>224</height>
<width>858</width>
<height>287</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_2">
@ -5128,7 +5145,7 @@
<x>10</x>
<y>470</y>
<width>801</width>
<height>22</height>
<height>24</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_451">
@ -5332,6 +5349,7 @@
<widget class="QPushButton" name="exitBtn">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
@ -5351,7 +5369,7 @@
<x>0</x>
<y>0</y>
<width>1082</width>
<height>22</height>
<height>21</height>
</rect>
</property>
</widget>
@ -5378,8 +5396,8 @@
<resources/>
<connections/>
<buttongroups>
<buttongroup name="underlayButtonGroup"/>
<buttongroup name="pollingButtonGroup"/>
<buttongroup name="underlayButtonGroup"/>
<buttongroup name="buttonGroup"/>
</buttongroups>
</ui>

Wyświetl plik

@ -239,6 +239,7 @@ HEADERS += wfmain.h \
rigcommander.h \
freqmemory.h \
rigidentities.h \
sidebandchooser.h \
udpbase.h \
udphandler.h \
udpcivdata.h \

Wyświetl plik

@ -2,6 +2,10 @@
#ifndef WFVIEWTYPES_H
#define WFVIEWTYPES_H
#include <QString>
#include <QtGlobal>
#include <stdint.h>
enum underlay_t { underlayNone, underlayPeakHold, underlayPeakBuffer, underlayAverageBuffer };
enum meterKind {
@ -29,6 +33,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;