Merge branch 'master' into shuttle

half-duplex
Phil Taylor 2021-08-28 00:24:12 +01:00
commit 52070ddbc4
11 zmienionych plików z 68 dodań i 34 usunięć

6
.gitmodules vendored
Wyświetl plik

@ -1,6 +0,0 @@
[submodule "opus-tools"]
path = opus-tools
url = https://github.com/xiph/opus-tools.git
[submodule "rtaudio"]
path = rtaudio
url = https://github.com/thestk/rtaudio.git

Wyświetl plik

@ -12,7 +12,7 @@ aboutbox::aboutbox(QWidget *parent) :
ui->logoBtn->setIcon(QIcon(":resources/wfview.png"));
ui->logoBtn->setStyleSheet("Text-align:left");
ui->topText->setText("wfview version 1.1");
ui->topText->setText("wfview version 1.2a");
QString head = QString("<html><head></head><body>");
QString copyright = QString("Copyright 2017-2021 Elliott H. Liggett, W6EL. All rights reserved. wfview source code is <a href=\"https://gitlab.com/eliggett/wfview/-/blob/master/LICENSE\">licensed</a> under the GNU GPLv3.");

Wyświetl plik

@ -48,13 +48,24 @@ meter::meter(QWidget *parent) : QWidget(parent)
}
void meter::setMeterType(meterKind type)
void meter::clearMeterOnPTTtoggle()
{
if(type == meterType)
return;
// When a meter changes type, such as the fixed S -- TxPo meter,
// there is automatic clearing. However, some meters do not switch on thier own,
// and thus we are providing this clearing method. We are careful
// not to clear meters that don't make sense to clear (such as Vd and Id)
meterType = type;
// clear average and peak vectors:
if( (meterType == meterALC) || (meterType == meterSWR)
|| (meterType == meterComp) || (meterType == meterTxMod)
|| (meterType == meterCenter ))
{
clearMeter();
}
}
void meter::clearMeter()
{
current = 0;
average = 0;
peak = 0;
@ -70,6 +81,16 @@ void meter::setMeterType(meterKind type)
update();
}
void meter::setMeterType(meterKind type)
{
if(type == meterType)
return;
meterType = type;
// clear average and peak vectors:
this->clearMeter();
}
meterKind meter::getMeterType()
{
return meterType;
@ -140,6 +161,9 @@ void meter::paintEvent(QPaintEvent *)
peakRedLevel = 100;
drawScaleComp(&painter);
break;
case meterNone:
return;
break;
default:
label = "DN";
peakRedLevel = 241;

Wyświetl plik

@ -24,6 +24,8 @@ public slots:
void updateDrawing(int num);
void setLevels(int current, int peak, int average);
void setLevel(int current);
void clearMeterOnPTTtoggle();
void clearMeter();
void setMeterType(meterKind type);
void setMeterShortString(QString);
QString getMeterShortString();
@ -47,8 +49,6 @@ private:
std::vector<unsigned char> avgLevels;
std::vector<unsigned char> peakLevels;
int peakRedLevel=0;
bool drawLabels = true;
int mXstart = 0; // Starting point for S=0.

@ -1 +0,0 @@
Subproject commit ae5d6d59e82ef40300a4dece7897499685f87184

Wyświetl plik

@ -8,6 +8,7 @@
#include <fcntl.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <errno.h>
#endif
// Copyright 2017-2021 Elliott H. Liggett & Phil Taylor

@ -1 +0,0 @@
Subproject commit c9bf99d414cf81d19ef0ddd00212a4a58ccd99c6

Wyświetl plik

@ -736,7 +736,7 @@ udpAudio::udpAudio(QHostAddress local, QHostAddress ip, quint16 audioPort, audio
rxaudio->moveToThread(rxAudioThread);
rxAudioThread->start();
rxAudioThread->start(QThread::TimeCriticalPriority);
connect(this, SIGNAL(setupRxAudio(audioSetup)), rxaudio, SLOT(init(audioSetup)));
@ -754,8 +754,8 @@ udpAudio::udpAudio(QHostAddress local, QHostAddress ip, quint16 audioPort, audio
txaudio->moveToThread(txAudioThread);
txAudioThread->start();
txAudioThread->start(QThread::TimeCriticalPriority);
connect(this, SIGNAL(setupTxAudio(audioSetup)), txaudio, SLOT(init(audioSetup)));
connect(txAudioThread, SIGNAL(finished()), txaudio, SLOT(deleteLater()));

Wyświetl plik

@ -385,7 +385,7 @@ void udpServer::controlReceived()
txAudioThread->setPriority(QThread::TimeCriticalPriority);
txaudio->moveToThread(txAudioThread);
txAudioThread->start();
txAudioThread->start(QThread::TimeCriticalPriority);
connect(this, SIGNAL(setupTxAudio(audioSetup)), txaudio, SLOT(init(audioSetup)));
connect(txAudioThread, SIGNAL(finished()), txaudio, SLOT(deleteLater()));
@ -402,11 +402,12 @@ void udpServer::controlReceived()
inAudio.samplerate = current->rxSampleRate;
rxaudio = new audioHandler();
rxAudioThread = new QThread(this);
rxAudioThread->setPriority(QThread::TimeCriticalPriority);
rxaudio->moveToThread(rxAudioThread);
rxAudioThread->start();
rxAudioThread = new QThread(this);
rxaudio->moveToThread(rxAudioThread);
rxAudioThread->start(QThread::TimeCriticalPriority);
connect(this, SIGNAL(setupRxAudio(audioSetup)), rxaudio, SLOT(init(audioSetup)));
connect(rxAudioThread, SIGNAL(finished()), rxaudio, SLOT(deleteLater()));

Wyświetl plik

@ -689,14 +689,11 @@ void wfmain::setupMainUI()
ui->meter2selectionCombo->addItem("Center", meterCenter);
ui->meter2Widget->hide();
#ifdef QT_DEBUG
// Experimental feature:
ui->meter2selectionCombo->show();
ui->meter2selectionCombo->setCurrentIndex((int)prefs.meter2Type);
ui->secondaryMeterSelectionLabel->show();
#else
ui->meter2selectionCombo->hide();
ui->secondaryMeterSelectionLabel->hide();
#endif
// Future ideas:
//ui->meter2selectionCombo->addItem("Transmit Audio", meterTxMod);
@ -1334,6 +1331,7 @@ void wfmain::setDefPrefs()
defPrefs.wftheme = static_cast<int>(QCPColorGradient::gpJet);
defPrefs.confirmExit = true;
defPrefs.confirmPowerOff = true;
defPrefs.meter2Type = meterNone;
udpDefPrefs.ipAddress = QString("");
udpDefPrefs.controlLANPort = 50001;
@ -1367,7 +1365,7 @@ void wfmain::loadSettings()
setWindowState(Qt::WindowActive); // Works around QT bug to returns window+keyboard focus.
prefs.confirmExit = settings->value("ConfirmExit", defPrefs.confirmExit).toBool();
prefs.confirmPowerOff = settings->value("ConfirmPowerOff", defPrefs.confirmPowerOff).toBool();
prefs.meter2Type = static_cast<meterKind>(settings->value("Meter2Type", defPrefs.meter2Type).toInt());
settings->endGroup();
// Load color schemes:
@ -1668,6 +1666,7 @@ void wfmain::saveSettings()
settings->setValue("WFLength", prefs.wflength);
settings->setValue("ConfirmExit", prefs.confirmExit);
settings->setValue("ConfirmPowerOff", prefs.confirmPowerOff);
settings->setValue("Meter2Type", (int)prefs.meter2Type);
settings->endGroup();
// Radio and Comms: C-IV addr, port to use
@ -2526,6 +2525,7 @@ void wfmain::doCmd(commandtype cmddata)
{
bool pttrequest = (*std::static_pointer_cast<bool>(data));
emit setPTT(pttrequest);
ui->meter2Widget->clearMeterOnPTTtoggle();
if(pttrequest)
{
ui->meterSPoWidget->setMeterType(meterPower);
@ -3126,6 +3126,18 @@ void wfmain::receiveRigID(rigCapabilities rigCaps)
// recalculate command timing now that we know the rig better:
calculateTimingParameters();
initPeriodicCommands();
// Set the second meter here as I suspect we need to be connected for it to work?
for (int i = 0; i < ui->meter2selectionCombo->count(); i++)
{
if (static_cast<meterKind>(ui->meter2selectionCombo->itemData(i).toInt()) == prefs.meter2Type)
{
// I thought that setCurrentIndex() would call the activated() function for the combobox
// but it doesn't, so call it manually.
ui->meter2selectionCombo->setCurrentIndex(i);
on_meter2selectionCombo_activated(i);
}
}
}
}
@ -3341,9 +3353,9 @@ void wfmain::receiveSpectrumData(QByteArray spectrum, double startFreq, double e
void wfmain::receiveSpectrumMode(spectrumMode spectMode)
{
for(int i=0; i < ui->spectrumModeCombo->count(); i++)
for (int i = 0; i < ui->spectrumModeCombo->count(); i++)
{
if(static_cast<spectrumMode>(ui->spectrumModeCombo->itemData(i).toInt()) == spectMode)
if (static_cast<spectrumMode>(ui->spectrumModeCombo->itemData(i).toInt()) == spectMode)
{
ui->spectrumModeCombo->blockSignals(true);
ui->spectrumModeCombo->setCurrentIndex(i);
@ -5363,7 +5375,6 @@ void wfmain::on_meter2selectionCombo_activated(int index)
meterKind oldMeterType;
newMeterType = static_cast<meterKind>(ui->meter2selectionCombo->currentData().toInt());
oldMeterType = ui->meter2Widget->getMeterType();
if(newMeterType == oldMeterType)
return;
@ -5375,11 +5386,14 @@ void wfmain::on_meter2selectionCombo_activated(int index)
if(newMeterType==meterNone)
{
ui->meter2Widget->hide();
ui->meter2Widget->setMeterType(newMeterType);
} else {
ui->meter2Widget->show();
ui->meter2Widget->setMeterType(newMeterType);
insertPeriodicCommandUnique(newCmd);
}
prefs.meter2Type = newMeterType;
(void)index;
}

Wyświetl plik

@ -489,6 +489,7 @@ private slots:
void on_rigctldPortTxt_editingFinished();
private:
Ui::wfmain *ui;
void closeEvent(QCloseEvent *event);
@ -716,6 +717,7 @@ private:
int wftheme;
bool confirmExit;
bool confirmPowerOff;
meterKind meter2Type;
// plot scheme
} prefs;