kopia lustrzana https://gitlab.com/eliggett/wfview
Merge branch 'master' into shuttle
commit
52070ddbc4
|
@ -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
|
|
|
@ -12,7 +12,7 @@ aboutbox::aboutbox(QWidget *parent) :
|
||||||
ui->logoBtn->setIcon(QIcon(":resources/wfview.png"));
|
ui->logoBtn->setIcon(QIcon(":resources/wfview.png"));
|
||||||
ui->logoBtn->setStyleSheet("Text-align:left");
|
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 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.");
|
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.");
|
||||||
|
|
34
meter.cpp
34
meter.cpp
|
@ -48,13 +48,24 @@ meter::meter(QWidget *parent) : QWidget(parent)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void meter::setMeterType(meterKind type)
|
void meter::clearMeterOnPTTtoggle()
|
||||||
{
|
{
|
||||||
if(type == meterType)
|
// When a meter changes type, such as the fixed S -- TxPo meter,
|
||||||
return;
|
// 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;
|
current = 0;
|
||||||
average = 0;
|
average = 0;
|
||||||
peak = 0;
|
peak = 0;
|
||||||
|
@ -70,6 +81,16 @@ void meter::setMeterType(meterKind type)
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void meter::setMeterType(meterKind type)
|
||||||
|
{
|
||||||
|
if(type == meterType)
|
||||||
|
return;
|
||||||
|
|
||||||
|
meterType = type;
|
||||||
|
// clear average and peak vectors:
|
||||||
|
this->clearMeter();
|
||||||
|
}
|
||||||
|
|
||||||
meterKind meter::getMeterType()
|
meterKind meter::getMeterType()
|
||||||
{
|
{
|
||||||
return meterType;
|
return meterType;
|
||||||
|
@ -140,6 +161,9 @@ void meter::paintEvent(QPaintEvent *)
|
||||||
peakRedLevel = 100;
|
peakRedLevel = 100;
|
||||||
drawScaleComp(&painter);
|
drawScaleComp(&painter);
|
||||||
break;
|
break;
|
||||||
|
case meterNone:
|
||||||
|
return;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
label = "DN";
|
label = "DN";
|
||||||
peakRedLevel = 241;
|
peakRedLevel = 241;
|
||||||
|
|
4
meter.h
4
meter.h
|
@ -24,6 +24,8 @@ public slots:
|
||||||
void updateDrawing(int num);
|
void updateDrawing(int num);
|
||||||
void setLevels(int current, int peak, int average);
|
void setLevels(int current, int peak, int average);
|
||||||
void setLevel(int current);
|
void setLevel(int current);
|
||||||
|
void clearMeterOnPTTtoggle();
|
||||||
|
void clearMeter();
|
||||||
void setMeterType(meterKind type);
|
void setMeterType(meterKind type);
|
||||||
void setMeterShortString(QString);
|
void setMeterShortString(QString);
|
||||||
QString getMeterShortString();
|
QString getMeterShortString();
|
||||||
|
@ -47,8 +49,6 @@ private:
|
||||||
std::vector<unsigned char> avgLevels;
|
std::vector<unsigned char> avgLevels;
|
||||||
std::vector<unsigned char> peakLevels;
|
std::vector<unsigned char> peakLevels;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int peakRedLevel=0;
|
int peakRedLevel=0;
|
||||||
bool drawLabels = true;
|
bool drawLabels = true;
|
||||||
int mXstart = 0; // Starting point for S=0.
|
int mXstart = 0; // Starting point for S=0.
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit ae5d6d59e82ef40300a4dece7897499685f87184
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <errno.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Copyright 2017-2021 Elliott H. Liggett & Phil Taylor
|
// Copyright 2017-2021 Elliott H. Liggett & Phil Taylor
|
||||||
|
|
1
rtaudio
1
rtaudio
|
@ -1 +0,0 @@
|
||||||
Subproject commit c9bf99d414cf81d19ef0ddd00212a4a58ccd99c6
|
|
|
@ -736,7 +736,7 @@ udpAudio::udpAudio(QHostAddress local, QHostAddress ip, quint16 audioPort, audio
|
||||||
|
|
||||||
rxaudio->moveToThread(rxAudioThread);
|
rxaudio->moveToThread(rxAudioThread);
|
||||||
|
|
||||||
rxAudioThread->start();
|
rxAudioThread->start(QThread::TimeCriticalPriority);
|
||||||
|
|
||||||
connect(this, SIGNAL(setupRxAudio(audioSetup)), rxaudio, SLOT(init(audioSetup)));
|
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);
|
txaudio->moveToThread(txAudioThread);
|
||||||
|
|
||||||
txAudioThread->start();
|
txAudioThread->start(QThread::TimeCriticalPriority);
|
||||||
|
|
||||||
connect(this, SIGNAL(setupTxAudio(audioSetup)), txaudio, SLOT(init(audioSetup)));
|
connect(this, SIGNAL(setupTxAudio(audioSetup)), txaudio, SLOT(init(audioSetup)));
|
||||||
|
|
||||||
connect(txAudioThread, SIGNAL(finished()), txaudio, SLOT(deleteLater()));
|
connect(txAudioThread, SIGNAL(finished()), txaudio, SLOT(deleteLater()));
|
||||||
|
|
|
@ -385,7 +385,7 @@ void udpServer::controlReceived()
|
||||||
txAudioThread->setPriority(QThread::TimeCriticalPriority);
|
txAudioThread->setPriority(QThread::TimeCriticalPriority);
|
||||||
txaudio->moveToThread(txAudioThread);
|
txaudio->moveToThread(txAudioThread);
|
||||||
|
|
||||||
txAudioThread->start();
|
txAudioThread->start(QThread::TimeCriticalPriority);
|
||||||
|
|
||||||
connect(this, SIGNAL(setupTxAudio(audioSetup)), txaudio, SLOT(init(audioSetup)));
|
connect(this, SIGNAL(setupTxAudio(audioSetup)), txaudio, SLOT(init(audioSetup)));
|
||||||
connect(txAudioThread, SIGNAL(finished()), txaudio, SLOT(deleteLater()));
|
connect(txAudioThread, SIGNAL(finished()), txaudio, SLOT(deleteLater()));
|
||||||
|
@ -402,11 +402,12 @@ void udpServer::controlReceived()
|
||||||
inAudio.samplerate = current->rxSampleRate;
|
inAudio.samplerate = current->rxSampleRate;
|
||||||
|
|
||||||
rxaudio = new audioHandler();
|
rxaudio = new audioHandler();
|
||||||
rxAudioThread = new QThread(this);
|
|
||||||
rxAudioThread->setPriority(QThread::TimeCriticalPriority);
|
|
||||||
|
|
||||||
rxaudio->moveToThread(rxAudioThread);
|
rxAudioThread = new QThread(this);
|
||||||
rxAudioThread->start();
|
|
||||||
|
rxaudio->moveToThread(rxAudioThread);
|
||||||
|
|
||||||
|
rxAudioThread->start(QThread::TimeCriticalPriority);
|
||||||
|
|
||||||
connect(this, SIGNAL(setupRxAudio(audioSetup)), rxaudio, SLOT(init(audioSetup)));
|
connect(this, SIGNAL(setupRxAudio(audioSetup)), rxaudio, SLOT(init(audioSetup)));
|
||||||
connect(rxAudioThread, SIGNAL(finished()), rxaudio, SLOT(deleteLater()));
|
connect(rxAudioThread, SIGNAL(finished()), rxaudio, SLOT(deleteLater()));
|
||||||
|
|
34
wfmain.cpp
34
wfmain.cpp
|
@ -689,14 +689,11 @@ void wfmain::setupMainUI()
|
||||||
ui->meter2selectionCombo->addItem("Center", meterCenter);
|
ui->meter2selectionCombo->addItem("Center", meterCenter);
|
||||||
ui->meter2Widget->hide();
|
ui->meter2Widget->hide();
|
||||||
|
|
||||||
#ifdef QT_DEBUG
|
|
||||||
// Experimental feature:
|
|
||||||
ui->meter2selectionCombo->show();
|
ui->meter2selectionCombo->show();
|
||||||
|
ui->meter2selectionCombo->setCurrentIndex((int)prefs.meter2Type);
|
||||||
|
|
||||||
ui->secondaryMeterSelectionLabel->show();
|
ui->secondaryMeterSelectionLabel->show();
|
||||||
#else
|
|
||||||
ui->meter2selectionCombo->hide();
|
|
||||||
ui->secondaryMeterSelectionLabel->hide();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Future ideas:
|
// Future ideas:
|
||||||
//ui->meter2selectionCombo->addItem("Transmit Audio", meterTxMod);
|
//ui->meter2selectionCombo->addItem("Transmit Audio", meterTxMod);
|
||||||
|
@ -1334,6 +1331,7 @@ void wfmain::setDefPrefs()
|
||||||
defPrefs.wftheme = static_cast<int>(QCPColorGradient::gpJet);
|
defPrefs.wftheme = static_cast<int>(QCPColorGradient::gpJet);
|
||||||
defPrefs.confirmExit = true;
|
defPrefs.confirmExit = true;
|
||||||
defPrefs.confirmPowerOff = true;
|
defPrefs.confirmPowerOff = true;
|
||||||
|
defPrefs.meter2Type = meterNone;
|
||||||
|
|
||||||
udpDefPrefs.ipAddress = QString("");
|
udpDefPrefs.ipAddress = QString("");
|
||||||
udpDefPrefs.controlLANPort = 50001;
|
udpDefPrefs.controlLANPort = 50001;
|
||||||
|
@ -1367,7 +1365,7 @@ void wfmain::loadSettings()
|
||||||
setWindowState(Qt::WindowActive); // Works around QT bug to returns window+keyboard focus.
|
setWindowState(Qt::WindowActive); // Works around QT bug to returns window+keyboard focus.
|
||||||
prefs.confirmExit = settings->value("ConfirmExit", defPrefs.confirmExit).toBool();
|
prefs.confirmExit = settings->value("ConfirmExit", defPrefs.confirmExit).toBool();
|
||||||
prefs.confirmPowerOff = settings->value("ConfirmPowerOff", defPrefs.confirmPowerOff).toBool();
|
prefs.confirmPowerOff = settings->value("ConfirmPowerOff", defPrefs.confirmPowerOff).toBool();
|
||||||
|
prefs.meter2Type = static_cast<meterKind>(settings->value("Meter2Type", defPrefs.meter2Type).toInt());
|
||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
|
|
||||||
// Load color schemes:
|
// Load color schemes:
|
||||||
|
@ -1668,6 +1666,7 @@ void wfmain::saveSettings()
|
||||||
settings->setValue("WFLength", prefs.wflength);
|
settings->setValue("WFLength", prefs.wflength);
|
||||||
settings->setValue("ConfirmExit", prefs.confirmExit);
|
settings->setValue("ConfirmExit", prefs.confirmExit);
|
||||||
settings->setValue("ConfirmPowerOff", prefs.confirmPowerOff);
|
settings->setValue("ConfirmPowerOff", prefs.confirmPowerOff);
|
||||||
|
settings->setValue("Meter2Type", (int)prefs.meter2Type);
|
||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
|
|
||||||
// Radio and Comms: C-IV addr, port to use
|
// 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));
|
bool pttrequest = (*std::static_pointer_cast<bool>(data));
|
||||||
emit setPTT(pttrequest);
|
emit setPTT(pttrequest);
|
||||||
|
ui->meter2Widget->clearMeterOnPTTtoggle();
|
||||||
if(pttrequest)
|
if(pttrequest)
|
||||||
{
|
{
|
||||||
ui->meterSPoWidget->setMeterType(meterPower);
|
ui->meterSPoWidget->setMeterType(meterPower);
|
||||||
|
@ -3126,6 +3126,18 @@ void wfmain::receiveRigID(rigCapabilities rigCaps)
|
||||||
// recalculate command timing now that we know the rig better:
|
// recalculate command timing now that we know the rig better:
|
||||||
calculateTimingParameters();
|
calculateTimingParameters();
|
||||||
initPeriodicCommands();
|
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)
|
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->blockSignals(true);
|
||||||
ui->spectrumModeCombo->setCurrentIndex(i);
|
ui->spectrumModeCombo->setCurrentIndex(i);
|
||||||
|
@ -5363,7 +5375,6 @@ void wfmain::on_meter2selectionCombo_activated(int index)
|
||||||
meterKind oldMeterType;
|
meterKind oldMeterType;
|
||||||
newMeterType = static_cast<meterKind>(ui->meter2selectionCombo->currentData().toInt());
|
newMeterType = static_cast<meterKind>(ui->meter2selectionCombo->currentData().toInt());
|
||||||
oldMeterType = ui->meter2Widget->getMeterType();
|
oldMeterType = ui->meter2Widget->getMeterType();
|
||||||
|
|
||||||
if(newMeterType == oldMeterType)
|
if(newMeterType == oldMeterType)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -5375,11 +5386,14 @@ void wfmain::on_meter2selectionCombo_activated(int index)
|
||||||
if(newMeterType==meterNone)
|
if(newMeterType==meterNone)
|
||||||
{
|
{
|
||||||
ui->meter2Widget->hide();
|
ui->meter2Widget->hide();
|
||||||
|
ui->meter2Widget->setMeterType(newMeterType);
|
||||||
} else {
|
} else {
|
||||||
ui->meter2Widget->show();
|
ui->meter2Widget->show();
|
||||||
ui->meter2Widget->setMeterType(newMeterType);
|
ui->meter2Widget->setMeterType(newMeterType);
|
||||||
insertPeriodicCommandUnique(newCmd);
|
insertPeriodicCommandUnique(newCmd);
|
||||||
}
|
}
|
||||||
|
prefs.meter2Type = newMeterType;
|
||||||
|
|
||||||
(void)index;
|
(void)index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2
wfmain.h
2
wfmain.h
|
@ -489,6 +489,7 @@ private slots:
|
||||||
|
|
||||||
void on_rigctldPortTxt_editingFinished();
|
void on_rigctldPortTxt_editingFinished();
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::wfmain *ui;
|
Ui::wfmain *ui;
|
||||||
void closeEvent(QCloseEvent *event);
|
void closeEvent(QCloseEvent *event);
|
||||||
|
@ -716,6 +717,7 @@ private:
|
||||||
int wftheme;
|
int wftheme;
|
||||||
bool confirmExit;
|
bool confirmExit;
|
||||||
bool confirmPowerOff;
|
bool confirmPowerOff;
|
||||||
|
meterKind meter2Type;
|
||||||
// plot scheme
|
// plot scheme
|
||||||
} prefs;
|
} prefs;
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue