Merge branch 'audio-enhance' into QT6.2

half-duplex
Phil Taylor 2021-11-18 12:23:27 +00:00
commit 395469daf3
27 zmienionych plików z 1811 dodań i 516 usunięć

128
CHANGELOG
Wyświetl plik

@ -1,5 +1,133 @@
# CHANGELOG
- 20211022
Don't block until audio buffer has space
Bit of tidying
- 20211020
Tidy-up server shutdown
Trying to find cause of lockup when client disappears
- 20211006
Send TX/Freq changes multiple times with rigctld
bumped to 1.2d hopefully last testversion before 1.20
- 202109022
Remove duplicate setPriority()
Fix typo
Add keepalive for linux/mac pty
Fix alignment of rigname in taskbar
Only send RX antenna byte to rig when it has an RX antenna option in rigCaps
- 20210907
Make rigctld state work for USB connected rigs
- 20210831
added 25 kHz step for tuning
- 20210829
Experimental support for split mode in rigctld
Ignore control levels that we don't currently support
Add better detection of ci-v transceive disable
- 20210827
Add saving of meter2 state
- 20210823
Set audio thread priority in the correct place!
Now with dual meters for everyone!
- 20210820
Clear Center readout as well.
Fixed issue where the "none" selection didn't work quite right. Also
fixed the T/R meter switching to clear out invalid readings.
Set audio threads to be realtime priority
- 20210817
dual meter support/WHATSNEW
Current scale tic marks on both sides now!
More meter work, fixed some scales and added labels.
Better meter fonts
- 20210815
Fix for left over CIV client on server
Improve detection of unsupported codec.
- 20210814
Fix for Opus TX audio
txrate logging wrong
More warning removal!
More commenting in rigctld.h
Is this going to fix 8 bit audio?
Comment unused structs from rigctld
All audio codecs now work in both directions!
Update audiohandler.cpp
more 8bit fixes!
ulaw encoding test
8 bit encoding fix
Another issue with 8 bit audio
Try again to remove debugging!
Revert "Remove extra opus debugging" This reverts commit da53f5371bbeb35b10cbb831b83b74e1bdd771f9.
Remove extra opus debugging
Move opus init
Add some debugging for decoder
Use radio samplerate for opus
Remove big/little endian conversion
More Opus fixes
Update audiohandler.cpp
Try to fix Opus 2-channel
- 20210809
Add constants to make parsing (hopefully) easier

Wyświetl plik

@ -7,4 +7,13 @@ The following highlights are in this 1.x-release:
added "do not ask again" for switching off rig and exiting wfview
added opus as audio transport
dual meter support
rigctl basic split support
rigctl prevents switching off civ transceive
added 25 kHz step
as a temporary measure sending multiple TX/FREQ change commands to the rig
when we use rigctld.
people should use "fake it" in wsjtx as the split code is not reliable.
tidied up udp server function for better reliability

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.2a");
ui->topText->setText("wfview version 1.2d");
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

@ -8,6 +8,10 @@
#include "logcategories.h"
#include "ulaw.h"
#if defined(Q_OS_WIN) && defined(PORTAUDIO)
#include <objbase.h>
#endif
audioHandler::audioHandler(QObject* parent)
{
@ -29,6 +33,8 @@ audioHandler::~audioHandler()
}
delete audio;
#elif defined(PORTAUDIO)
Pa_StopStream(audio);
Pa_CloseStream(audio);
#else
stop();
#endif
@ -81,7 +87,7 @@ bool audioHandler::init(audioSetup setupIn)
setup.bits = 16;
}
ringBuf = new wilt::Ring<audioPacket>(100); // Should be customizable.
ringBuf = new wilt::Ring<audioPacket>(setupIn.latency / 8 + 1); // Should be customizable.
tempBuf.sent = 0;
@ -124,14 +130,9 @@ bool audioHandler::init(audioSetup setupIn)
if (info.probed)
{
// if "preferred" sample rate is 44100, try 48K instead
if (info.preferredSampleRate == (unsigned int)44100) {
qDebug(logAudio()) << "Preferred sample rate 44100, trying 48000";
this->nativeSampleRate = 48000;
}
else {
this->nativeSampleRate = info.preferredSampleRate;
}
// Always use the "preferred" sample rate
// We can always resample if needed
this->nativeSampleRate = info.preferredSampleRate;
// Per channel chunk size.
this->chunkSize = (this->nativeSampleRate / 50);
@ -189,6 +190,85 @@ bool audioHandler::init(audioSetup setupIn)
#elif defined(PORTAUDIO)
PaError err;
#ifdef Q_OS_WIN
CoInitialize(0);
#endif
memset(&aParams, 0,sizeof(PaStreamParameters));
if (setup.port > 0) {
aParams.device = setup.port;
}
else if (setup.isinput) {
aParams.device = Pa_GetDefaultInputDevice();
}
else {
aParams.device = Pa_GetDefaultOutputDevice();
}
info = Pa_GetDeviceInfo(aParams.device);
aParams.channelCount = 2;
aParams.hostApiSpecificStreamInfo = NULL;
aParams.sampleFormat = paInt16;
if (setup.isinput) {
aParams.suggestedLatency = info->defaultLowInputLatency;
}
else {
aParams.suggestedLatency = info->defaultLowOutputLatency;
}
aParams.hostApiSpecificStreamInfo = NULL;
// Always use the "preferred" sample rate (unless it is 44100)
// We can always resample if needed
if (info->defaultSampleRate == 44100) {
this->nativeSampleRate = 48000;
}
else {
this->nativeSampleRate = info->defaultSampleRate;
}
// Per channel chunk size.
this->chunkSize = (this->nativeSampleRate / 50);
qInfo(logAudio()) << (setup.isinput ? "Input" : "Output") << info->name << "(" << aParams.device << ") successfully probed";
if (setup.isinput) {
devChannels = info->maxInputChannels;
}
else {
devChannels = info->maxOutputChannels;
}
if (devChannels > 2) {
devChannels = 2;
}
aParams.channelCount = devChannels;
qInfo(logAudio()) << " Channels:" << devChannels;
qInfo(logAudio()) << " chunkSize: " << chunkSize;
qInfo(logAudio()) << " sampleRate: " << nativeSampleRate;
if (setup.isinput) {
err=Pa_OpenStream(&audio, &aParams, 0, this->nativeSampleRate, this->chunkSize, paNoFlag, &audioHandler::staticWrite, (void*)this);
}
else {
err=Pa_OpenStream(&audio, 0, &aParams, this->nativeSampleRate, this->chunkSize, paNoFlag, &audioHandler::staticRead, (void*)this);
}
if (err == paNoError) {
err = Pa_StartStream(audio);
}
if (err == paNoError) {
isInitialized = true;
qInfo(logAudio()) << (setup.isinput ? "Input" : "Output") << "device successfully opened";
}
else {
qInfo(logAudio()) << (setup.isinput ? "Input" : "Output") << "failed to open device" << Pa_GetErrorText(err);
}
#else
#if QT_VERSION < 0x060000
@ -283,9 +363,12 @@ format.setSampleSize(16);
qInfo(logAudio()) << "Creating opus decoder: " << opus_strerror(opus_err);
}
}
wf_resampler_get_ratio(resampler, &ratioNum, &ratioDen);
qInfo(logAudio()) << (setup.isinput ? "Input" : "Output") << "wf_resampler_init() returned: " << resample_error << " ratioNum" << ratioNum << " ratioDen" << ratioDen;
unsigned int ratioNum;
unsigned int ratioDen;
wf_resampler_get_ratio(resampler, &ratioNum, &ratioDen);
resampleRatio = static_cast<double>(ratioDen) / ratioNum;
qInfo(logAudio()) << (setup.isinput ? "Input" : "Output") << "wf_resampler_init() returned: " << resample_error << " resampleRatio: " << resampleRatio;
qInfo(logAudio()) << (setup.isinput ? "Input" : "Output") << "thread id" << QThread::currentThreadId();
@ -309,7 +392,7 @@ void audioHandler::start()
}
if (setup.isinput) {
#ifdef Q_OS_MACX
#ifndef Q_OS_WIN
this->open(QIODevice::WriteOnly);
#else
this->open(QIODevice::WriteOnly | QIODevice::Unbuffered);
@ -317,7 +400,7 @@ void audioHandler::start()
audioInput->start(this);
}
else {
#ifdef Q_OS_MACX
#ifndef Q_OS_WIN
this->open(QIODevice::ReadOnly);
#else
this->open(QIODevice::ReadOnly | QIODevice::Unbuffered);
@ -344,7 +427,8 @@ void audioHandler::setVolume(unsigned char volume)
/// <param name="maxlen"></param>
/// <returns></returns>
#if defined(RTAUDIO)
int audioHandler::readData(void* outputBuffer, void* inputBuffer, unsigned int nFrames, double streamTime, RtAudioStreamStatus status)
int audioHandler::readData(void* outputBuffer, void* inputBuffer,
unsigned int nFrames, double streamTime, RtAudioStreamStatus status)
{
Q_UNUSED(inputBuffer);
Q_UNUSED(streamTime);
@ -353,6 +437,15 @@ int audioHandler::readData(void* outputBuffer, void* inputBuffer, unsigned int n
int nBytes = nFrames * devChannels * 2; // This is ALWAYS 2 bytes per sample and 2 channels
quint8* buffer = (quint8*)outputBuffer;
#elif defined(PORTAUDIO)
int audioHandler::readData(const void* inputBuffer, void* outputBuffer,
unsigned long nFrames, const PaStreamCallbackTimeInfo * streamTime, PaStreamCallbackFlags status)
{
Q_UNUSED(inputBuffer);
Q_UNUSED(streamTime);
Q_UNUSED(status);
int nBytes = nFrames * devChannels * 2; // This is ALWAYS 2 bytes per sample and 2 channels
quint8* buffer = (quint8*)outputBuffer;
#else
qint64 audioHandler::readData(char* buffer, qint64 nBytes)
{
@ -371,7 +464,7 @@ qint64 audioHandler::readData(char* buffer, qint64 nBytes)
audioPacket packet;
if (!ringBuf->try_read(packet))
{
qDebug() << "No more data available but buffer is not full! sentlen:" << sentlen << " nBytes:" << nBytes ;
qDebug(logAudio()) << "No more data available but buffer is not full! sentlen:" << sentlen << " nBytes:" << nBytes ;
break;
}
currentLatency = packet.time.msecsTo(QTime::currentTime());
@ -392,8 +485,8 @@ qint64 audioHandler::readData(char* buffer, qint64 nBytes)
//qDebug(logAudio()) << "Adding partial:" << send;
}
while (currentLatency > setup.latency) {
qInfo(logAudio()) << (setup.isinput ? "Input" : "Output") << "Packet " << hex << packet.seq <<
if (currentLatency > setup.latency) {
qDebug(logAudio()) << (setup.isinput ? "Input" : "Output") << "Packet " << hex << packet.seq <<
" arrived too late (increase output latency!) " <<
packet.time.msecsTo(QTime::currentTime()) << "ms";
lastSeq = packet.seq;
@ -414,12 +507,14 @@ qint64 audioHandler::readData(char* buffer, qint64 nBytes)
break;
}
/*
if (packet.seq <= lastSeq) {
qDebug(logAudio()) << (setup.isinput ? "Input" : "Output") << "Duplicate/early audio packet: " << hex << lastSeq << " got " << hex << packet.seq;
}
else if (packet.seq != lastSeq + 1) {
qDebug(logAudio()) << (setup.isinput ? "Input" : "Output") << "Missing audio packet(s) from: " << hex << lastSeq + 1 << " to " << hex << packet.seq - 1;
}
*/
lastSeq = packet.seq;
}
}
@ -432,13 +527,15 @@ qint64 audioHandler::readData(char* buffer, qint64 nBytes)
#if defined(RTAUDIO)
return 0;
#elif defined(PORTAUDIO)
return 0;
#else
return nBytes;
#endif
}
#if defined(RTAUDIO)
int audioHandler::writeData(void* outputBuffer, void* inputBuffer, unsigned int nFrames, double streamTime, RtAudioStreamStatus status)
int audioHandler::writeData(void* outputBuffer, void* inputBuffer,
unsigned int nFrames, double streamTime, RtAudioStreamStatus status)
{
Q_UNUSED(outputBuffer);
Q_UNUSED(streamTime);
@ -446,6 +543,15 @@ int audioHandler::writeData(void* outputBuffer, void* inputBuffer, unsigned int
int nBytes = nFrames * devChannels * 2; // This is ALWAYS 2 bytes per sample and 2 channels
const char* data = (const char*)inputBuffer;
#elif defined(PORTAUDIO)
int audioHandler::writeData(const void* inputBuffer, void* outputBuffer,
unsigned long nFrames, const PaStreamCallbackTimeInfo * streamTime,
PaStreamCallbackFlags status)
{
Q_UNUSED(outputBuffer);
Q_UNUSED(streamTime);
Q_UNUSED(status);
int nBytes = nFrames * devChannels * 2; // This is ALWAYS 2 bytes per sample and 2 channels
const char* data = (const char*)inputBuffer;
#else
qint64 audioHandler::writeData(const char* data, qint64 nBytes)
{
@ -467,13 +573,13 @@ qint64 audioHandler::writeData(const char* data, qint64 nBytes)
tempBuf.sent = tempBuf.sent + send;
}
else {
ringBuf->write(tempBuf);
/*
//ringBuf->write(tempBuf);
if (!ringBuf->try_write(tempBuf))
{
qDebug(logAudio()) << "outgoing audio buffer full!";
break;
} */
}
tempBuf.data.clear();
tempBuf.sent = 0;
}
@ -483,12 +589,12 @@ qint64 audioHandler::writeData(const char* data, qint64 nBytes)
#if defined(RTAUDIO)
return 0;
#elif defined(PORTAUDIO)
return 0;
#else
return nBytes;
#endif
}
void audioHandler::incomingAudio(audioPacket inPacket)
{
// No point buffering audio until stream is actually running.
@ -507,8 +613,13 @@ void audioHandler::incomingAudio(audioPacket inPacket)
/* Decode the frame. */
QByteArray outPacket((setup.samplerate / 50) * sizeof(qint16) * setup.radioChan, (char)0xff); // Preset the output buffer size.
qint16* out = (qint16*)outPacket.data();
int nSamples = opus_decode(decoder, in, inPacket.data.size(), out, (setup.samplerate / 50), 0);
int nSamples = opus_packet_get_nb_samples(in, inPacket.data.size(),setup.samplerate);
if (nSamples != setup.samplerate / 50)
{
qInfo(logAudio()) << "Opus nSamples=" << nSamples << " expected:" << (setup.samplerate / 50);
return;
}
nSamples = opus_decode(decoder, in, inPacket.data.size(), out, (setup.samplerate / 50), 0);
if (nSamples < 0)
{
@ -582,11 +693,11 @@ void audioHandler::incomingAudio(audioPacket inPacket)
*/
//qDebug(logAudio()) << "Now 16 bit stereo, length" << inPacket.data.length();
if (ratioDen != 1) {
if (resampleRatio != 1.0) {
// We need to resample
// We have a stereo 16bit stream.
quint32 outFrames = ((inPacket.data.length() / 2 / devChannels) * ratioDen);
quint32 outFrames = ((inPacket.data.length() / 2 / devChannels) * resampleRatio);
quint32 inFrames = (inPacket.data.length() / 2 / devChannels);
QByteArray outPacket(outFrames * 4, (char)0xff); // Preset the output buffer size.
@ -607,7 +718,7 @@ void audioHandler::incomingAudio(audioPacket inPacket)
if (!ringBuf->try_write(inPacket))
{
qDebug(logAudio()) << "Buffer full! capacity:" << ringBuf->capacity() << "length" << ringBuf->size();
qDebug(logAudio()) << (setup.isinput ? "Input" : "Output") << "Buffer full! capacity:" << ringBuf->capacity() << "length" << ringBuf->size();
}
return;
}
@ -616,6 +727,8 @@ void audioHandler::changeLatency(const quint16 newSize)
{
qInfo(logAudio()) << (setup.isinput ? "Input" : "Output") << "Changing latency to: " << newSize << " from " << setup.latency;
setup.latency = newSize;
delete ringBuf;
ringBuf = new wilt::Ring<audioPacket>(setup.latency / 8 + 1); // Should be customizable.
}
int audioHandler::getLatency()
@ -634,20 +747,20 @@ void audioHandler::getNextAudioChunk(QByteArray& ret)
{
currentLatency = packet.time.msecsTo(QTime::currentTime());
while (currentLatency > setup.latency) {
if (currentLatency > setup.latency) {
qInfo(logAudio()) << (setup.isinput ? "Input" : "Output") << "Packet " << hex << packet.seq <<
" arrived too late (increase output latency!) " <<
packet.time.msecsTo(QTime::currentTime()) << "ms";
if (!ringBuf->try_read(packet))
break;
currentLatency = packet.time.msecsTo(QTime::currentTime());
dec << packet.time.msecsTo(QTime::currentTime()) << "ms";
// if (!ringBuf->try_read(packet))
// break;
// currentLatency = packet.time.msecsTo(QTime::currentTime());
}
//qDebug(logAudio) << "Chunksize" << this->chunkSize << "Packet size" << packet.data.length();
// Packet will arrive as stereo interleaved 16bit 48K
if (ratioNum != 1)
if (resampleRatio != 1.0)
{
quint32 outFrames = ((packet.data.length() / 2 / devChannels) / ratioNum);
quint32 outFrames = ((packet.data.length() / 2 / devChannels) * resampleRatio);
quint32 inFrames = (packet.data.length() / 2 / devChannels);
QByteArray outPacket((int)outFrames * 2 * devChannels, (char)0xff);

Wyświetl plik

@ -9,10 +9,14 @@
#include <QtMath>
#if defined(RTAUDIO)
#ifdef Q_OS_WIN
#include "RtAudio.h"
#else
#include "rtaudio/RtAudio.h"
#endif
#elif defined (PORTAUDIO)
#include "portaudio.h"
#error "PORTAUDIO is not currently supported"
//#error "PORTAUDIO is not currently supported"
#else
#include <QAudioFormat>
@ -40,6 +44,7 @@ typedef signed short MY_TYPE;
#include <QTimer>
#include <QTime>
#include <QMap>
#include "resampler/speex_resampler.h"
#include "ring/ring.h"
@ -76,9 +81,8 @@ struct audioSetup {
quint8 codec;
bool ulaw;
bool isinput;
#if defined(RTAUDIO)
#if defined(RTAUDIO) || defined(PORTAUDIO)
int port;
#elif defined(PORTAUDIO)
#else
#if QT_VERSION < 0x060000
@ -151,6 +155,21 @@ private:
return static_cast<audioHandler*>(userData)->writeData(outputBuffer, inputBuffer, nFrames, streamTime, status);
}
#elif defined(PORTAUDIO)
int readData(const void* inputBuffer, void* outputBuffer,
unsigned long nFrames,
const PaStreamCallbackTimeInfo* streamTime,
PaStreamCallbackFlags status);
static int staticRead(const void* inputBuffer, void* outputBuffer, unsigned long nFrames, const PaStreamCallbackTimeInfo* streamTime, PaStreamCallbackFlags status, void* userData) {
return ((audioHandler*)userData)->readData(inputBuffer, outputBuffer, nFrames, streamTime, status);
}
int writeData(const void* inputBuffer, void* outputBuffer,
unsigned long nFrames,
const PaStreamCallbackTimeInfo* streamTime,
PaStreamCallbackFlags status);
static int staticWrite(const void* inputBuffer, void* outputBuffer, unsigned long nFrames, const PaStreamCallbackTimeInfo* streamTime, PaStreamCallbackFlags status, void* userData) {
return ((audioHandler*)userData)->writeData(inputBuffer, outputBuffer, nFrames, streamTime, status);
}
#else
qint64 readData(char* data, qint64 nBytes);
@ -168,6 +187,9 @@ private:
RtAudio::StreamOptions options;
RtAudio::DeviceInfo info;
#elif defined(PORTAUDIO)
PaStream* audio = Q_NULLPTR;
PaStreamParameters aParams;
const PaDeviceInfo *info;
#else
QAudioFormat format;
@ -197,8 +219,7 @@ private:
QMap<quint32, audioPacket>audioBuffer;
unsigned int ratioNum;
unsigned int ratioDen;
double resampleRatio;
wilt::Ring<audioPacket> *ringBuf=Q_NULLPTR;

Wyświetl plik

@ -20,6 +20,7 @@ commHandler::commHandler()
baudrate = 115200;
stopbits = 1;
portName = "/dev/ttyUSB0";
this->PTTviaRTS = false;
setupComm(); // basic parameters
openPort();
@ -45,6 +46,7 @@ commHandler::commHandler(QString portName, quint32 baudRate)
baudrate = baudRate;
stopbits = 1;
this->portName = portName;
this->PTTviaRTS = false;
setupComm(); // basic parameters
openPort();
@ -80,6 +82,50 @@ void commHandler::sendDataOut(const QByteArray &writeData)
mutex.lock();
qint64 bytesWritten;
if(PTTviaRTS)
{
// Size: 1 2 3 4 5 6 7 8
//index: 0 1 2 3 4 5 6 7
//Query: FE FE TO FROM 0x1C 0x00 0xFD
//PTT On: FE FE TO FROM 0x1C 0x00 0x01 0xFD
//PTT Off: FE FE TO FROM 0x1C 0x00 0x00 0xFD
if(writeData.endsWith(QByteArrayLiteral("\x1C\x00\xFD")))
{
// Query
//qDebug(logSerial()) << "Looks like PTT Query";
bool pttOn = this->rtsStatus();
QByteArray pttreturncmd = QByteArray("\xFE\xFE");
pttreturncmd.append(writeData.at(3));
pttreturncmd.append(writeData.at(2));
pttreturncmd.append(QByteArray("\x1C\x00", 2));
pttreturncmd.append((char)pttOn);
pttreturncmd.append("\xFD");
//qDebug(logSerial()) << "Sending fake PTT query result: " << (bool)pttOn;
printHex(pttreturncmd, false, true);
emit haveDataFromPort(pttreturncmd);
mutex.unlock();
return;
} else if(writeData.endsWith(QByteArrayLiteral("\x1C\x00\x01\xFD")))
{
// PTT ON
//qDebug(logSerial()) << "Looks like PTT ON";
setRTS(true);
mutex.unlock();
return;
} else if(writeData.endsWith(QByteArrayLiteral("\x1C\x00\x00\xFD")))
{
// PTT OFF
//qDebug(logSerial()) << "Looks like PTT OFF";
setRTS(false);
mutex.unlock();
return;
}
}
bytesWritten = port->write(writeData);
if(bytesWritten != (qint64)writeData.size())
@ -162,6 +208,25 @@ void commHandler::receiveDataIn()
}
}
void commHandler::setRTS(bool rtsOn)
{
bool success = port->setRequestToSend(rtsOn);
if(!success)
{
qInfo(logSerial()) << "Error, could not set RTS on port " << portName;
}
}
bool commHandler::rtsStatus()
{
return port->isRequestToSend();
}
void commHandler::setUseRTSforPTT(bool PTTviaRTS)
{
this->PTTviaRTS = PTTviaRTS;
}
void commHandler::openPort()
{
bool success;

Wyświetl plik

@ -18,9 +18,14 @@ public:
commHandler();
commHandler(QString portName, quint32 baudRate);
bool serialError;
bool rtsStatus();
~commHandler();
public slots:
void setUseRTSforPTT(bool useRTS);
void setRTS(bool rtsOn);
private slots:
void receiveDataIn(); // from physical port
void receiveDataFromUserToRig(const QByteArray &data);
@ -38,6 +43,7 @@ private:
void openPort();
void closePort();
void sendDataOut(const QByteArray &writeData); // out to radio
void debugMe();
void hexPrint();
@ -63,6 +69,8 @@ private:
bool havePt;
QString ptDevSlave;
bool PTTviaRTS = false;
bool isConnected; // port opened
mutable QMutex mutex;
void printHex(const QByteArray &pdata, bool printVert, bool printHoriz);

Wyświetl plik

@ -73,6 +73,9 @@ void pttyHandler::openPort()
// we're good!
qInfo(logSerial()) << "Opened pseudoterminal, slave name :" << ptsname(ptfd);
// Open the slave device to keep alive.
ptKeepAlive = open(ptsname(ptfd), O_RDONLY);
ptReader = new QSocketNotifier(ptfd, QSocketNotifier::Read, this);
connect(ptReader, &QSocketNotifier::activated,
this, &pttyHandler::receiveDataIn);
@ -218,9 +221,8 @@ void pttyHandler::receiveDataIn(int fd) {
civId = (quint8)inPortData[lastFE + 2];
qInfo(logSerial()) << "pty remote CI-V changed:" << hex << (quint8)civId;
}
// filter 1A 05 01 12/27 = C-IV transceive command before forwarding on.
if (inPortData.contains(QByteArrayLiteral("\x1a\x05\x01\x12")) || inPortData.contains(QByteArrayLiteral("\x1a\x05\x01\x27")))
// filter C-IV transceive command before forwarding on.
if (inPortData.contains(rigCaps.transceiveCommand))
{
//qInfo(logSerial()) << "Filtered transceive command";
//printHex(inPortData, false, true);
@ -284,6 +286,10 @@ void pttyHandler::closePort()
{
QFile::remove(portName);
}
if (ptKeepAlive > 0) {
close(ptKeepAlive);
}
#endif
isConnected = false;
}
@ -331,4 +337,10 @@ void pttyHandler::printHex(const QByteArray& pdata, bool printVert, bool printHo
qDebug(logSerial()) << "----- End hex dump -----";
}
void pttyHandler::receiveFoundRigID(rigCapabilities rigCaps) {
this->rigCaps = rigCaps;
qInfo(logSerial) << "Received rigCapabilities for" << rigCaps.modelName;
}

Wyświetl plik

@ -9,6 +9,8 @@
#include <QSocketNotifier>
#include <QtSerialPort/QSerialPort>
#include "rigidentities.h"
// This class abstracts the comm port in a useful way and connects to
// the command creator and command parser.
@ -27,6 +29,7 @@ private slots:
void receiveDataIn(int fd); // from physical port
void receiveDataFromRigToPtty(const QByteArray& data);
void debugThis();
void receiveFoundRigID(rigCapabilities rigCaps);
signals:
void haveTextMessage(QString message); // status, debug only
@ -59,6 +62,7 @@ private:
bool rolledBack;
int ptfd; // pseudo-terminal file desc.
int ptKeepAlive=0; // Used to keep the pty alive after client disconects.
bool havePt;
QString ptDevSlave;
@ -66,8 +70,9 @@ private:
mutable QMutex mutex;
void printHex(const QByteArray& pdata, bool printVert, bool printHoriz);
bool disableTransceive = false;
QSocketNotifier *ptReader = nullptr;
QSocketNotifier *ptReader = Q_NULLPTR;
quint8 civId=0;
rigCapabilities rigCaps;
};
#endif // PTTYHANDLER_H

Wyświetl plik

@ -61,9 +61,9 @@ void rigCommander::commSetup(unsigned char rigCivAddr, QString rigSerialPort, qu
// data from the ptty to the rig:
connect(ptty, SIGNAL(haveDataFromPort(QByteArray)), comm, SLOT(receiveDataFromUserToRig(QByteArray)));
// data from the program to the comm port:
connect(this, SIGNAL(dataForComm(QByteArray)), comm, SLOT(receiveDataFromUserToRig(QByteArray)));
connect(this, SIGNAL(toggleRTS(bool)), comm, SLOT(setRTS(bool)));
// data from the rig to the ptty:
connect(comm, SIGNAL(haveDataFromPort(QByteArray)), ptty, SLOT(receiveDataFromRigToPtty(QByteArray)));
@ -73,7 +73,11 @@ void rigCommander::commSetup(unsigned char rigCivAddr, QString rigSerialPort, qu
connect(this, SIGNAL(getMoreDebug()), comm, SLOT(debugThis()));
connect(this, SIGNAL(getMoreDebug()), ptty, SLOT(debugThis()));
connect(this, SIGNAL(discoveredRigID(rigCapabilities)), ptty, SLOT(receiveFoundRigID(rigCapabilities)));
emit commReady();
sendState(); // Send current rig state to rigctld
}
@ -137,6 +141,8 @@ void rigCommander::commSetup(unsigned char rigCivAddr, udpPreferences prefs, aud
connect(ptty, SIGNAL(haveSerialPortError(QString, QString)), this, SLOT(handleSerialPortError(QString, QString)));
connect(this, SIGNAL(getMoreDebug()), ptty, SLOT(debugThis()));
connect(this, SIGNAL(discoveredRigID(rigCapabilities)), ptty, SLOT(receiveFoundRigID(rigCapabilities)));
emit haveAfGain(rxSetup.localAFgain);
}
@ -231,6 +237,9 @@ void rigCommander::findRigs()
data.append(payloadSuffix);
emit dataForComm(data);
// HACK for testing radios that do not respond to rig ID queries:
//this->model = model736;
//this->determineRigCaps();
return;
}
@ -553,18 +562,24 @@ void rigCommander::getSpectrumMode()
prepDataAndSend(specModePayload);
}
void rigCommander::setFrequency(freqt freq)
void rigCommander::setFrequency(unsigned char vfo, freqt freq)
{
//QByteArray freqPayload = makeFreqPayload(freq);
QByteArray freqPayload = makeFreqPayload(freq);
QByteArray cmdPayload;
cmdPayload.append(freqPayload);
cmdPayload.prepend('\x00');
if (vfo == 0) {
rigState.vfoAFreq = freq;
cmdPayload.prepend('\x00');
}
else
{
rigState.vfoBFreq = freq;
cmdPayload.prepend(vfo);
cmdPayload.prepend('\x25');
}
//printHex(cmdPayload, false, true);
prepDataAndSend(cmdPayload);
rigState.vfoAFreq = freq;
}
QByteArray rigCommander::makeFreqPayload(freqt freq)
@ -978,9 +993,14 @@ void rigCommander::getSatelliteMode()
void rigCommander::getPTT()
{
QByteArray payload;
payload.setRawData("\x1C\x00", 2);
prepDataAndSend(payload);
//if(rigCaps.useRTSforPTT && !usingNativeLAN)
//{
// emit havePTTStatus(comm->rtsStatus());
//} else {
QByteArray payload;
payload.setRawData("\x1C\x00", 2);
prepDataAndSend(payload);
//}
}
void rigCommander::getBandStackReg(char band, char regCode)
@ -1348,6 +1368,20 @@ void rigCommander::parseLevels()
emit haveSql(level);
rigState.squelch = level;
break;
case '\x07':
// Twin BPF Inner, or, IF-Shift level
if(rigCaps.hasTBPF)
emit haveTPBFInner(level);
else
emit haveIFShift(level);
break;
case '\x08':
// Twin BPF Outer
emit haveTPBFOuter(level);
break;
case '\x09':
// CW Pitch - ignore for now
break;
case '\x0A':
// TX RF level
emit haveTxPower(level);
@ -1358,11 +1392,20 @@ void rigCommander::parseLevels()
emit haveMicGain(level);
rigState.micGain = level;
break;
case '\x0C':
// CW Keying Speed - ignore for now
break;
case '\x0D':
// Notch filder setting - ignore for now
break;
case '\x0E':
// compressor level
emit haveCompLevel(level);
rigState.compLevel = level;
break;
case '\x12':
// NB level - ignore for now
break;
case '\x15':
// monitor level
emit haveMonitorLevel(level);
@ -1443,6 +1486,27 @@ void rigCommander::parseLevels()
}
void rigCommander::setIFShift(unsigned char level)
{
QByteArray payload("\x14\x07");
payload.append(bcdEncodeInt(level));
prepDataAndSend(payload);
}
void rigCommander::setTPBFInner(unsigned char level)
{
QByteArray payload("\x14\x07");
payload.append(bcdEncodeInt(level));
prepDataAndSend(payload);
}
void rigCommander::setTPBFOuter(unsigned char level)
{
QByteArray payload("\x14\x08");
payload.append(bcdEncodeInt(level));
prepDataAndSend(payload);
}
void rigCommander::setTxPower(unsigned char power)
{
QByteArray payload("\x14\x0A");
@ -1866,6 +1930,24 @@ void rigCommander::getAfGain()
prepDataAndSend(payload);
}
void rigCommander::getIFShift()
{
QByteArray payload("\x14\x07");
prepDataAndSend(payload);
}
void rigCommander::getTPBFInner()
{
QByteArray payload("\x14\x07");
prepDataAndSend(payload);
}
void rigCommander::getTPBFOuter()
{
QByteArray payload("\x14\x08");
prepDataAndSend(payload);
}
void rigCommander::getSql()
{
QByteArray payload("\x14\x03");
@ -2253,6 +2335,8 @@ void rigCommander::parseRegister21()
longfreq = payloadIn.mid(2,2);
longfreq.append(QByteArray(3,'\x00'));
f = parseFrequency(longfreq, 3);
if(payloadIn.length() < 5)
break;
ritHz = f.Hz*((payloadIn.at(4)=='\x01')?-1:1);
emit haveRitFrequency(ritHz);
break;
@ -2801,6 +2885,9 @@ void rigCommander::determineRigCaps()
rigCaps.hasCTCSS = false;
rigCaps.hasDTCS = false;
rigCaps.hasTBPF = false;
rigCaps.hasIFShift = false;
rigCaps.spectSeqMax = 0;
rigCaps.spectAmpMax = 0;
rigCaps.spectLenMax = 0;
@ -2829,6 +2916,7 @@ void rigCommander::determineRigCaps()
rigCaps.hasTransmit = true;
rigCaps.hasPTTCommand = true;
rigCaps.useRTSforPTT = false;
// Common, reasonable defaults for most supported HF rigs:
rigCaps.bsr[band160m] = 0x01;
@ -2871,6 +2959,7 @@ void rigCommander::determineRigCaps()
rigCaps.hasWiFi = false;
rigCaps.hasATU = true;
rigCaps.hasCTCSS = true;
rigCaps.hasTBPF = true;
rigCaps.attenuators.push_back('\x20');
rigCaps.preamps.push_back('\x01');
rigCaps.preamps.push_back('\x02');
@ -2880,6 +2969,8 @@ void rigCommander::determineRigCaps()
rigCaps.bands.push_back(band630m);
rigCaps.bands.push_back(band2200m);
rigCaps.modes = commonModes;
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x00\x71");
break;
case modelR8600:
rigCaps.modelName = QString("IC-R8600");
@ -2897,6 +2988,7 @@ void rigCommander::determineRigCaps()
rigCaps.hasCTCSS = true;
rigCaps.hasDTCS = true;
rigCaps.hasDV = true;
rigCaps.hasTBPF = true;
rigCaps.attenuators.push_back('\x10');
rigCaps.attenuators.push_back('\x20');
rigCaps.attenuators.push_back('\x30');
@ -2915,6 +3007,7 @@ void rigCommander::determineRigCaps()
createMode(modeNXDN_VN, 0x19, "NXDN-VN"), createMode(modeNXDN_N, 0x20, "NXDN-N"),
createMode(modeDCR, 0x21, "DCR")});
rigCaps.scopeCenterSpans.insert(rigCaps.scopeCenterSpans.end(), {createScopeCenter(cs1M, "±1M"), createScopeCenter(cs2p5M, "±2.5M")});
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x00\x92");
break;
case model9700:
rigCaps.modelName = QString("IC-9700");
@ -2933,6 +3026,7 @@ void rigCommander::determineRigCaps()
rigCaps.hasDV = true;
rigCaps.hasCTCSS = true;
rigCaps.hasDTCS = true;
rigCaps.hasTBPF = true;
rigCaps.attenuators.push_back('\x10');
rigCaps.preamps.push_back('\x01');
rigCaps.bands = standardVU;
@ -2943,6 +3037,7 @@ void rigCommander::determineRigCaps()
rigCaps.modes = commonModes;
rigCaps.modes.insert(rigCaps.modes.end(), {createMode(modeDV, 0x17, "DV"),
createMode(modeDD, 0x22, "DD")});
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x01\x27");
break;
case model910h:
rigCaps.modelName = QString("IC-910H");
@ -2965,6 +3060,7 @@ void rigCommander::determineRigCaps()
rigCaps.bsr[band70cm] = 0x02;
rigCaps.bsr[band2m] = 0x01;
rigCaps.modes = commonModes;
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x00\x58");
break;
case model7600:
rigCaps.modelName = QString("IC-7600");
@ -2979,6 +3075,7 @@ void rigCommander::determineRigCaps()
rigCaps.hasATU = true;
rigCaps.hasCTCSS = false;
rigCaps.hasDTCS = false;
rigCaps.hasTBPF = true;
rigCaps.attenuators.insert(rigCaps.attenuators.end(), {0x00, 0x06, 0x12, 0x18});
rigCaps.preamps.push_back('\x01');
rigCaps.preamps.push_back('\x02');
@ -2989,6 +3086,7 @@ void rigCommander::determineRigCaps()
rigCaps.modes = commonModes;
rigCaps.modes.insert(rigCaps.modes.end(), {createMode(modePSK, 0x12, "PSK"),
createMode(modePSK_R, 0x13, "PSK-R")});
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x00\x97");
break;
case model7610:
rigCaps.modelName = QString("IC-7610");
@ -3004,6 +3102,7 @@ void rigCommander::determineRigCaps()
rigCaps.hasEthernet = true;
rigCaps.hasWiFi = false;
rigCaps.hasCTCSS = true;
rigCaps.hasTBPF = true;
rigCaps.attenuators.insert(rigCaps.attenuators.end(),
{'\x03', '\x06', '\x09', '\x12',\
'\x15', '\x18', '\x21', '\x24',\
@ -3020,6 +3119,7 @@ void rigCommander::determineRigCaps()
rigCaps.bands.push_back(band2200m);
rigCaps.modes = commonModes;
rigCaps.hasRXAntenna = true;
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x01\x12");
break;
case model7850:
rigCaps.modelName = QString("IC-785x");
@ -3037,6 +3137,7 @@ void rigCommander::determineRigCaps()
rigCaps.hasWiFi = false;
rigCaps.hasATU = true;
rigCaps.hasCTCSS = true;
rigCaps.hasTBPF = true;
rigCaps.attenuators.insert(rigCaps.attenuators.end(),
{'\x03', '\x06', '\x09',
'\x12', '\x15', '\x18', '\x21'});
@ -3052,6 +3153,7 @@ void rigCommander::determineRigCaps()
rigCaps.modes.insert(rigCaps.modes.end(), {createMode(modePSK, 0x12, "PSK"),
createMode(modePSK_R, 0x13, "PSK-R")});
rigCaps.hasRXAntenna = true;
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x01\x55");
break;
case model705:
rigCaps.modelName = QString("IC-705");
@ -3070,6 +3172,7 @@ void rigCommander::determineRigCaps()
rigCaps.hasATU = true;
rigCaps.hasCTCSS = true;
rigCaps.hasDTCS = true;
rigCaps.hasTBPF = true;
rigCaps.attenuators.insert(rigCaps.attenuators.end(),{ '\x10' , '\x20'});
rigCaps.preamps.push_back('\x01');
rigCaps.preamps.push_back('\x02');
@ -3088,6 +3191,7 @@ void rigCommander::determineRigCaps()
rigCaps.modes = commonModes;
rigCaps.modes.insert(rigCaps.modes.end(), {createMode(modeWFM, 0x06, "WFM"),
createMode(modeDV, 0x17, "DV")});
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x01\x31");
break;
case model7000:
rigCaps.modelName = QString("IC-7000");
@ -3101,6 +3205,7 @@ void rigCommander::determineRigCaps()
rigCaps.hasATU = true;
rigCaps.hasCTCSS = true;
rigCaps.hasDTCS = true;
rigCaps.hasTBPF = true;
rigCaps.attenuators.push_back('\x12');
rigCaps.preamps.push_back('\x01');
rigCaps.bands = standardHF;
@ -3110,6 +3215,7 @@ void rigCommander::determineRigCaps()
rigCaps.bsr[band70cm] = 0x12;
rigCaps.bsr[bandGen] = 0x13;
rigCaps.modes = commonModes;
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x00\x92");
break;
case model7410:
rigCaps.modelName = QString("IC-7410");
@ -3123,6 +3229,7 @@ void rigCommander::determineRigCaps()
rigCaps.hasATU = true;
rigCaps.hasCTCSS = true;
rigCaps.hasDTCS = true;
rigCaps.hasTBPF = true;
rigCaps.attenuators.push_back('\x20');
rigCaps.preamps.push_back('\x01');
rigCaps.preamps.push_back('\x02');
@ -3131,6 +3238,7 @@ void rigCommander::determineRigCaps()
rigCaps.bands.push_back(bandGen);
rigCaps.bsr[bandGen] = 0x11;
rigCaps.modes = commonModes;
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x00\x40");
break;
case model7100:
rigCaps.modelName = QString("IC-7100");
@ -3145,6 +3253,7 @@ void rigCommander::determineRigCaps()
rigCaps.hasATU = true;
rigCaps.hasCTCSS = true;
rigCaps.hasDTCS = true;
rigCaps.hasTBPF = true;
rigCaps.attenuators.push_back('\x12');
rigCaps.preamps.push_back('\x01');
rigCaps.preamps.push_back('\x02');
@ -3158,6 +3267,7 @@ void rigCommander::determineRigCaps()
rigCaps.modes = commonModes;
rigCaps.modes.insert(rigCaps.modes.end(), {createMode(modeWFM, 0x06, "WFM"),
createMode(modeDV, 0x17, "DV")});
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x00\x95");
break;
case model7200:
rigCaps.modelName = QString("IC-7200");
@ -3172,13 +3282,15 @@ void rigCommander::determineRigCaps()
rigCaps.hasATU = true;
rigCaps.hasCTCSS = true;
rigCaps.hasDTCS = true;
rigCaps.hasTBPF = true;
rigCaps.attenuators.push_back('\x20');
rigCaps.preamps.push_back('\x01');
rigCaps.bands = standardHF;
rigCaps.bands.push_back(bandGen);
rigCaps.bsr[bandGen] = 0x11;
rigCaps.modes = commonModes;
break;
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x03\x48");
break;
case model7700:
rigCaps.modelName = QString("IC-7700");
rigCaps.rigctlModel = 3062;
@ -3190,6 +3302,7 @@ void rigCommander::determineRigCaps()
rigCaps.hasEthernet = true;
rigCaps.hasWiFi = false;
rigCaps.hasCTCSS = true;
rigCaps.hasTBPF = true;
rigCaps.attenuators.insert(rigCaps.attenuators.end(),
{'\x06', '\x12', '\x18'});
rigCaps.preamps.push_back('\x01');
@ -3204,6 +3317,7 @@ void rigCommander::determineRigCaps()
rigCaps.modes = commonModes;
rigCaps.modes.insert(rigCaps.modes.end(), {createMode(modePSK, 0x12, "PSK"),
createMode(modePSK_R, 0x13, "PSK-R")});
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x00\x95");
break;
case model706:
rigCaps.modelName = QString("IC-706");
@ -3216,6 +3330,7 @@ void rigCommander::determineRigCaps()
rigCaps.hasFDcomms = false;
rigCaps.hasATU = true;
rigCaps.hasPTTCommand = false;
rigCaps.useRTSforPTT = true;
rigCaps.hasDataModes = false;
rigCaps.attenuators.push_back('\x20');
rigCaps.bands = standardHF;
@ -3223,6 +3338,7 @@ void rigCommander::determineRigCaps()
rigCaps.bands.push_back(bandGen);
rigCaps.modes = commonModes;
rigCaps.modes.insert(rigCaps.modes.end(), createMode(modeWFM, 0x06, "WFM"));
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x00\x00");
break;
case model718:
rigCaps.modelName = QString("IC-718");
@ -3235,6 +3351,8 @@ void rigCommander::determineRigCaps()
rigCaps.hasFDcomms = false;
rigCaps.hasATU = false;
rigCaps.hasPTTCommand = false;
rigCaps.useRTSforPTT = true;
rigCaps.hasIFShift = true;
rigCaps.hasDataModes = false;
rigCaps.attenuators.push_back('\x20');
rigCaps.preamps.push_back('\x01');
@ -3246,6 +3364,29 @@ void rigCommander::determineRigCaps()
createMode(modeCW, 0x03, "CW"), createMode(modeCW_R, 0x07, "CW-R"),
createMode(modeRTTY, 0x04, "RTTY"), createMode(modeRTTY_R, 0x08, "RTTY-R")
};
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x00\x00");
break;
case model736:
rigCaps.modelName = QString("IC-736");
rigCaps.rigctlModel = 3020;
rigCaps.hasSpectrum = false;
rigCaps.inputs.clear();
rigCaps.hasLan = false;
rigCaps.hasEthernet = false;
rigCaps.hasWiFi = false;
rigCaps.hasFDcomms = false;
rigCaps.hasATU = false;
rigCaps.hasPTTCommand = false;
rigCaps.useRTSforPTT = true;
rigCaps.hasDataModes = false;
rigCaps.hasIFShift = true; // untested
rigCaps.attenuators.push_back('\x20');
rigCaps.preamps.push_back('\x01');
rigCaps.bands = standardHF;
rigCaps.modes = { createMode(modeLSB, 0x00, "LSB"), createMode(modeUSB, 0x01, "USB"),
createMode(modeAM, 0x02, "AM"), createMode(modeFM, 0x05, "FM"),
createMode(modeCW, 0x03, "CW"), createMode(modeCW_R, 0x07, "CW-R"),
};
break;
case model756pro:
rigCaps.modelName = QString("IC-756 Pro");
@ -3257,6 +3398,7 @@ void rigCommander::determineRigCaps()
rigCaps.hasWiFi = false;
rigCaps.hasFDcomms = false;
rigCaps.hasATU = true;
rigCaps.hasTBPF = true;
rigCaps.preamps.push_back('\x01');
rigCaps.preamps.push_back('\x02');
rigCaps.attenuators.insert(rigCaps.attenuators.end(),{ '\x06' , '\x12', '\x18'});
@ -3265,6 +3407,7 @@ void rigCommander::determineRigCaps()
rigCaps.bands.push_back(bandGen);
rigCaps.bsr[bandGen] = 0x11;
rigCaps.modes = commonModes;
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x00\x00");
break;
case model756proii:
rigCaps.modelName = QString("IC-756 Pro II");
@ -3276,6 +3419,7 @@ void rigCommander::determineRigCaps()
rigCaps.hasWiFi = false;
rigCaps.hasFDcomms = false;
rigCaps.hasATU = true;
rigCaps.hasTBPF = true;
rigCaps.preamps.push_back('\x01');
rigCaps.preamps.push_back('\x02');
rigCaps.attenuators.insert(rigCaps.attenuators.end(),{ '\x06' , '\x12', '\x18'});
@ -3284,6 +3428,7 @@ void rigCommander::determineRigCaps()
rigCaps.bands.push_back(bandGen);
rigCaps.bsr[bandGen] = 0x11;
rigCaps.modes = commonModes;
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x00\x00");
break;
case model756proiii:
rigCaps.modelName = QString("IC-756 Pro III");
@ -3295,6 +3440,7 @@ void rigCommander::determineRigCaps()
rigCaps.hasWiFi = false;
rigCaps.hasFDcomms = false;
rigCaps.hasATU = true;
rigCaps.hasTBPF = true;
rigCaps.preamps.push_back('\x01');
rigCaps.preamps.push_back('\x02');
rigCaps.attenuators.insert(rigCaps.attenuators.end(),{ '\x06' , '\x12', '\x18'});
@ -3303,6 +3449,35 @@ void rigCommander::determineRigCaps()
rigCaps.bands.push_back(bandGen);
rigCaps.bsr[bandGen] = 0x11;
rigCaps.modes = commonModes;
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x00\x00");
break;
case model9100:
rigCaps.modelName = QString("IC-9100");
rigCaps.rigctlModel = 3068;
rigCaps.hasSpectrum = false;
rigCaps.inputs.append(inputUSB); // TODO, add commands for this radio's inputs
rigCaps.inputs.append(inputACC);
rigCaps.hasLan = false;
rigCaps.hasEthernet = false;
rigCaps.hasWiFi = false;
rigCaps.hasFDcomms = false;
rigCaps.hasATU = true;
rigCaps.hasDV = true;
rigCaps.hasTBPF = true;
rigCaps.preamps.push_back('\x01');
rigCaps.preamps.push_back('\x02');
rigCaps.attenuators.insert(rigCaps.attenuators.end(),{ '\x20' });
rigCaps.antennas = {0x00, 0x01};
rigCaps.bands = standardHF;
rigCaps.bands.insert(rigCaps.bands.end(), standardVU.begin(), standardVU.end());
rigCaps.bands.push_back(band23cm);
rigCaps.bands.push_back(bandGen);
rigCaps.bsr[band2m] = 0x11;
rigCaps.bsr[band70cm] = 0x12;
rigCaps.bsr[band23cm] = 0x13;
rigCaps.bsr[bandGen] = 0x14;
rigCaps.modes = commonModes;
rigCaps.modes.insert(rigCaps.modes.end(), {createMode(modeDV, 0x17, "DV")});
break;
default:
rigCaps.modelName = QString("IC-0x%1").arg(rigCaps.modelID, 2, 16);
@ -3324,11 +3499,16 @@ void rigCommander::determineRigCaps()
rigCaps.bands.insert(rigCaps.bands.end(), standardVU.begin(), standardVU.end());
rigCaps.bands.insert(rigCaps.bands.end(), {band23cm, band4m, band630m, band2200m, bandGen});
rigCaps.modes = commonModes;
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x00\x00");
qInfo(logRig()) << "Found unknown rig: 0x" << QString("%1").arg(rigCaps.modelID, 2, 16);
break;
}
haveRigCaps = true;
if(!usingNativeLAN)
comm->setUseRTSforPTT(rigCaps.useRTSforPTT);
if(lookingForRig)
{
lookingForRig = false;
@ -3759,7 +3939,9 @@ void rigCommander::setAntenna(unsigned char ant, bool rx)
{
QByteArray payload("\x12");
payload.append(ant);
payload.append((unsigned char)rx); // 0x00 = use for TX and RX
if (rigCaps.hasRXAntenna) {
payload.append((unsigned char)rx); // 0x00 = use for TX and RX
}
prepDataAndSend(payload);
}
@ -3770,6 +3952,29 @@ void rigCommander::getRigID()
prepDataAndSend(payload);
}
void rigCommander::setRigID(unsigned char rigID)
{
// This function overrides radio model detection.
// It can be used for radios without Rig ID commands,
// or to force a specific radio model
qInfo(logRig()) << "Sending rig ID to: (int)" << (int)rigID;
lookingForRig = true;
foundRig = false;
// needed because this is a fake message and thus the value is uninitialized
// this->civAddr comes from how rigCommander is setup and should be accurate.
this->incomingCIVAddr = this->civAddr;
this->model = determineRadioModel(rigID);
rigCaps.modelID = rigID;
rigCaps.model = determineRadioModel(rigID);
determineRigCaps();
}
void rigCommander::changeLatency(const quint16 value)
{
emit haveChangeLatency(value);

Wyświetl plik

@ -171,7 +171,7 @@ public slots:
void getScopeMode();
// Frequency, Mode, BSR:
void setFrequency(freqt freq);
void setFrequency(unsigned char vfo, freqt freq);
void getFrequency();
void setMode(unsigned char mode, unsigned char modeFilter);
void setMode(mode_info);
@ -215,6 +215,9 @@ public slots:
void getRfGain();
void getAfGain();
void getSql();
void getIFShift();
void getTPBFInner();
void getTPBFOuter();
void getTxLevel();
void getMicGain();
void getCompLevel();
@ -232,6 +235,9 @@ public slots:
void setSquelch(unsigned char level);
void setRfGain(unsigned char level);
void setAfGain(unsigned char level);
void setIFShift(unsigned char level);
void setTPBFInner(unsigned char level);
void setTPBFOuter(unsigned char level);
void setTxPower(unsigned char power);
void setMicGain(unsigned char gain);
void setUSBGain(unsigned char gain);
@ -274,6 +280,7 @@ public slots:
// Rig ID and CIV:
void getRigID();
void findRigs();
void setRigID(unsigned char rigID);
void setCIVAddr(unsigned char civAddr);
// Calibration:
@ -316,6 +323,7 @@ signals:
void haveSerialPortError(const QString port, const QString errorText);
void haveStatusUpdate(const QString text);
void dataForComm(const QByteArray &outData);
void toggleRTS(bool rtsOn);
// UDP:
void haveChangeLatency(quint16 value);
@ -356,6 +364,9 @@ signals:
void haveRfGain(unsigned char level);
void haveAfGain(unsigned char level);
void haveSql(unsigned char level);
void haveTPBFInner(unsigned char level);
void haveTPBFOuter(unsigned char level);
void haveIFShift(unsigned char level);
void haveTxPower(unsigned char level);
void haveMicGain(unsigned char level);
void haveCompLevel(unsigned char level);

Wyświetl plik

@ -55,10 +55,11 @@ rigCtlD::~rigCtlD()
qInfo(logRigCtlD()) << "closing rigctld";
}
void rigCtlD::receiveFrequency(freqt freq)
{
emit setFrequency(freq);
}
//void rigCtlD::receiveFrequency(freqt freq)
//{
// emit setFrequency(0, freq);
// emit setFrequency(0, freq);
//}
void rigCtlD::receiveStateInfo(rigStateStruct* state)
{
@ -287,7 +288,7 @@ void rigCtlClient::socketReadyRead()
freqt freq;
bool ok=false;
double newFreq=0.0f;
QString vfo = "VFOA";
unsigned char vfo=0;
if (command.length() == 2)
{
newFreq = command[1].toDouble(&ok);
@ -295,13 +296,20 @@ void rigCtlClient::socketReadyRead()
else if (command.length() == 3) // Includes VFO
{
newFreq = command[2].toDouble(&ok);
vfo = command[1];
if (command[1] == "VFOB")
{
vfo = 1;
}
}
if (ok) {
freq.Hz = static_cast<int>(newFreq);
qDebug(logRigCtlD()) << QString("Set frequency: %1 (%2)").arg(freq.Hz).arg(command[1]);
emit parent->setFrequency(freq);
emit parent->setFrequency(vfo, freq);
emit parent->setFrequency(vfo, freq);
emit parent->setFrequency(vfo, freq);
emit parent->setFrequency(vfo, freq);
emit parent->setFrequency(vfo, freq);
}
}
else if (command[0] == "1" || command[0] == "dump_caps")
@ -343,12 +351,11 @@ void rigCtlClient::socketReadyRead()
{
setCommand = true;
if (rigCaps.hasPTTCommand) {
if (command[1] == "0") {
emit parent->setPTT(false);
}
else {
emit parent->setPTT(true);
}
emit parent->setPTT(bool(command[1].toInt()));
emit parent->setPTT(bool(command[1].toInt()));
emit parent->setPTT(bool(command[1].toInt()));
emit parent->setPTT(bool(command[1].toInt()));
emit parent->setPTT(bool(command[1].toInt()));
}
else
{
@ -465,21 +472,50 @@ void rigCtlClient::socketReadyRead()
}
response.append(resp);
}
else if (command[0] == "I" || command[0] == "set_split_freq")
else if (command.length() > 1 && (command[0] == "I" || command[0] == "set_split_freq"))
{
setCommand = true;
freqt freq;
bool ok = false;
double newFreq = 0.0f;
newFreq = command[1].toDouble(&ok);
if (ok) {
freq.Hz = static_cast<int>(newFreq);
qDebug(logRigCtlD()) << QString("set_split_freq: %1 (%2)").arg(freq.Hz).arg(command[1]);
emit parent->setFrequency(1, freq);
emit parent->setFrequency(1, freq);
emit parent->setFrequency(1, freq);
emit parent->setFrequency(1, freq);
emit parent->setFrequency(1, freq);
}
}
else if (command[0] == "m" || command[0] == "get_mode")
else if (command.length() > 2 && (command[0] == "X" || command[0] == "set_split_mode"))
{
setCommand = true;
}
else if (command.length() > 0 && (command[0] == "x" || command[0] == "get_split_mode"))
{
if (longReply) {
response.append(QString("Mode: %1").arg(getMode(rigState->mode, rigState->datamode)));
response.append(QString("Passband: %1").arg(getFilter(rigState->mode, rigState->filter)));
response.append(QString("TX Mode: %1").arg(getMode(rigState->mode, rigState->datamode)));
response.append(QString("TX Passband: %1").arg(getFilter(rigState->mode, rigState->filter)));
}
else {
response.append(QString("%1").arg(getMode(rigState->mode, rigState->datamode)));
response.append(QString("%1").arg(getFilter(rigState->mode, rigState->filter)));
}
}
else if (command[0] == "m" || command[0] == "get_mode")
{
if (longReply) {
response.append(QString("Mode: %1").arg(getMode(rigState->mode, rigState->datamode)));
response.append(QString("Passband: %1").arg(getFilter(rigState->mode, rigState->filter)));
}
else {
response.append(QString("%1").arg(getMode(rigState->mode, rigState->datamode)));
response.append(QString("%1").arg(getFilter(rigState->mode, rigState->filter)));
}
}
else if (command[0] == "M" || command[0] == "set_mode")
{
// Set mode
@ -506,21 +542,23 @@ void rigCtlClient::socketReadyRead()
emit parent->setMode(getMode(mode), width);
if (mode.mid(0, 3) == "PKT") {
emit parent->setDataMode(true, width);
emit parent->setDataMode(true, width);
}
else {
emit parent->setDataMode(false, width);
emit parent->setDataMode(false, width);
}
}
else if (command[0] == "s" || command[0] == "get_split_vfo")
{
if (longReply) {
response.append(QString("Split: 0"));
response.append(QString("TX VFO: VFOA"));
response.append(QString("Split: 1"));
response.append(QString("TX VFO: VFOB"));
}
else
{
response.append("0");
response.append("VFOA");
response.append("1");
response.append("VFOb");
}
}
@ -973,8 +1011,8 @@ void rigCtlClient::socketReadyRead()
}
else if (command.length() > 1 && (command[0] == '\x87' || command[0] == "set_powerstat"))
{
setCommand = true;
if (command[1] == "0")
setCommand = true;
if (command[1] == "0")
{
emit parent->sendPowerOff();
}
@ -1370,4 +1408,4 @@ int rigCtlClient::getCalibratedValue(unsigned char meter,cal_table_t cal) {
/ (cal.table[i].raw - cal.table[i - 1].raw);
return cal.table[i].val - interp;
}
}

Wyświetl plik

@ -336,7 +336,7 @@ signals:
void onStarted();
void onStopped();
void sendData(QString data);
void setFrequency(freqt freq);
void setFrequency(unsigned char vfo, freqt freq);
void setPTT(bool state);
void setMode(unsigned char mode, unsigned char modeFilter);
void setDataMode(bool dataOn, unsigned char modeFilter);
@ -369,7 +369,7 @@ public slots:
virtual void incomingConnection(qintptr socketDescriptor);
void receiveRigCaps(rigCapabilities caps);
void receiveStateInfo(rigStateStruct* state);
void receiveFrequency(freqt freq);
// void receiveFrequency(freqt freq);
private:
rigStateStruct* rigState = Q_NULLPTR;

Wyświetl plik

@ -55,6 +55,9 @@ model_kind determineRadioModel(unsigned char rigID)
case model718:
rig = model718;
break;
case model736:
rig = model736;
break;
case model910h:
rig = model910h;
break;
@ -67,6 +70,9 @@ model_kind determineRadioModel(unsigned char rigID)
case model756proiii:
rig = model756proiii;
break;
case model9100:
rig = model9100;
break;
default:
rig = modelUnknown;
break;

Wyświetl plik

@ -29,10 +29,12 @@ enum model_kind {
model705 = 0xA4,
model706 = 0x58,
model718 = 0x5E,
model736 = 0x40,
model756pro = 0x5C,
model756proii = 0x64,
model756proiii = 0x6E,
model910h = 0x60,
model9100 = 0x7C,
modelUnknown = 0xFF
};
@ -116,10 +118,13 @@ struct rigCapabilities {
bool hasTransmit;
bool hasPTTCommand;
bool useRTSforPTT;
bool hasAttenuator;
bool hasPreamp;
bool hasAntennaSel;
bool hasDataModes;
bool hasIFShift;
bool hasTBPF;
bool hasRXAntenna;
@ -131,6 +136,8 @@ struct rigCapabilities {
unsigned char bsr[20] = {0};
std::vector <mode_info> modes;
QByteArray transceiveCommand;
};

Wyświetl plik

@ -6,11 +6,100 @@ transceiverAdjustments::transceiverAdjustments(QWidget *parent) :
ui(new Ui::transceiverAdjustments)
{
ui->setupUi(this);
// request level updates
#ifndef QT_DEBUG
ui->transmitterControlsGroupBox->setVisible(false); // no controls available so far
ui->bassRxLabel->setVisible(false);
ui->bassRxSlider->setVisible(false);
ui->trebleRxLabel->setVisible(false);
ui->trebleRxSlider->setVisible(false);
ui->NRRxCheckBox->setVisible(false);
ui->NRRxSlider->setVisible(false);
ui->notchRxChkBox->setVisible(false);
ui->notchRxSlider->setVisible(false);
ui->NBRxChkBox->setVisible(false);
ui->NBRxSlider->setVisible(false);
ui->bandwidthGroupBox->setVisible(false);
this->window()->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
this->window()->resize(QSizePolicy::Minimum, QSizePolicy::Minimum);
#endif
}
transceiverAdjustments::~transceiverAdjustments()
{
rigCaps.inputs.clear();
rigCaps.preamps.clear();
rigCaps.attenuators.clear();
rigCaps.antennas.clear();
delete ui;
}
void transceiverAdjustments::on_IFShiftSlider_valueChanged(int value)
{
if(rigCaps.hasIFShift)
{
emit setIFShift(value);
} else {
unsigned char inner = ui->TPBFInnerSlider->value();
unsigned char outer = ui->TPBFOuterSlider->value();
int shift = value - previousIFShift;
inner = qMax( 0, qMin(255,int (inner + shift)) );
outer =qMax( 0, qMin(255,int (outer + shift)) );
ui->TPBFInnerSlider->setValue(inner);
ui->TPBFOuterSlider->setValue(outer);
previousIFShift = value;
}
}
void transceiverAdjustments::on_TPBFInnerSlider_valueChanged(int value)
{
emit setTPBFInner(value);
}
void transceiverAdjustments::on_TPBFOuterSlider_valueChanged(int value)
{
emit setTPBFOuter(value);
}
void transceiverAdjustments::setRig(rigCapabilities rig)
{
this->rigCaps = rig;
if(!rigCaps.hasIFShift)
updateIFShift(128);
//ui->IFShiftSlider->setVisible(rigCaps.hasIFShift);
//ui->IFShiftLabel->setVisible(rigCaps.hasIFShift);
ui->TPBFInnerSlider->setVisible(rigCaps.hasTBPF);
ui->TPBFInnerLabel->setVisible(rigCaps.hasTBPF);
ui->TPBFOuterSlider->setVisible(rigCaps.hasTBPF);
ui->TPBFInnerLabel->setVisible(rigCaps.hasTBPF);
haveRigCaps = true;
}
// These are accessed by wfmain when we receive new values from rigCommander:
void transceiverAdjustments::updateIFShift(unsigned char level)
{
ui->IFShiftSlider->blockSignals(true);
ui->IFShiftSlider->setValue(level);
ui->IFShiftSlider->blockSignals(false);
}
void transceiverAdjustments::updateTPBFInner(unsigned char level)
{
ui->TPBFInnerSlider->blockSignals(true);
ui->TPBFInnerSlider->setValue(level);
ui->TPBFInnerSlider->blockSignals(false);
}
void transceiverAdjustments::updateTPBFOuter(unsigned char level)
{
ui->TPBFOuterSlider->blockSignals(true);
ui->TPBFOuterSlider->setValue(level);
ui->TPBFOuterSlider->blockSignals(false);
}

Wyświetl plik

@ -1,7 +1,13 @@
#ifndef TRANSCEIVERADJUSTMENTS_H
#define TRANSCEIVERADJUSTMENTS_H
#include <QtGlobal>
#include <QWidget>
#include "rigidentities.h"
namespace Ui {
class transceiverAdjustments;
@ -15,8 +21,30 @@ public:
explicit transceiverAdjustments(QWidget *parent = 0);
~transceiverAdjustments();
signals:
void setIFShift(unsigned char level);
void setTPBFInner(unsigned char level);
void setTPBFOuter(unsigned char level);
public slots:
void setRig(rigCapabilities rig);
void updateIFShift(unsigned char level);
void updateTPBFInner(unsigned char level);
void updateTPBFOuter(unsigned char level);
private slots:
void on_IFShiftSlider_valueChanged(int value);
void on_TPBFInnerSlider_valueChanged(int value);
void on_TPBFOuterSlider_valueChanged(int value);
private:
Ui::transceiverAdjustments *ui;
rigCapabilities rigCaps;
bool haveRigCaps = false;
int previousIFShift = 128;
};
#endif // TRANSCEIVERADJUSTMENTS_H

Wyświetl plik

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>680</width>
<height>339</height>
<width>832</width>
<height>337</height>
</rect>
</property>
<property name="windowTitle">
@ -29,13 +29,13 @@
<number>10</number>
</property>
<item>
<widget class="QGroupBox" name="groupBox">
<widget class="QGroupBox" name="transmitterControlsGroupBox">
<property name="title">
<string>Transmitter</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<layout class="QVBoxLayout" name="compVertLayout">
<property name="leftMargin">
<number>0</number>
</property>
@ -49,14 +49,20 @@
<number>0</number>
</property>
<item>
<widget class="QSlider" name="verticalSlider">
<widget class="QSlider" name="compSlider">
<property name="minimumSize">
<size>
<width>0</width>
<height>230</height>
</size>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox">
<widget class="QCheckBox" name="compChkBox">
<property name="text">
<string>Comp</string>
</property>
@ -65,16 +71,22 @@
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_5">
<layout class="QVBoxLayout" name="bassTxVertLayout">
<item>
<widget class="QSlider" name="verticalSlider_4">
<widget class="QSlider" name="bassTxSlider">
<property name="minimumSize">
<size>
<width>0</width>
<height>230</height>
</size>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_4">
<widget class="QLabel" name="bassTxLabel">
<property name="minimumSize">
<size>
<width>0</width>
@ -89,16 +101,22 @@
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_4">
<layout class="QVBoxLayout" name="trebleTxVertLayout">
<item>
<widget class="QSlider" name="verticalSlider_3">
<widget class="QSlider" name="trebleTxSlider">
<property name="minimumSize">
<size>
<width>0</width>
<height>230</height>
</size>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<widget class="QLabel" name="trebleTxLabel">
<property name="minimumSize">
<size>
<width>0</width>
@ -106,23 +124,29 @@
</size>
</property>
<property name="text">
<string>Trebble</string>
<string>Treble</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_10">
<layout class="QVBoxLayout" name="tbdVertLayout">
<item>
<widget class="QSlider" name="verticalSlider_9">
<widget class="QSlider" name="tbdSlider">
<property name="minimumSize">
<size>
<width>0</width>
<height>230</height>
</size>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_6">
<widget class="QLabel" name="tbdLabel">
<property name="minimumSize">
<size>
<width>0</width>
@ -140,22 +164,28 @@
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<widget class="QGroupBox" name="receiverControlsGroupBox">
<property name="title">
<string>Receiver</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<layout class="QVBoxLayout" name="verticalLayout_8">
<layout class="QVBoxLayout" name="bassRxVertLayout">
<item>
<widget class="QSlider" name="verticalSlider_5">
<widget class="QSlider" name="bassRxSlider">
<property name="minimumSize">
<size>
<width>0</width>
<height>230</height>
</size>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label">
<widget class="QLabel" name="bassRxLabel">
<property name="minimumSize">
<size>
<width>0</width>
@ -170,16 +200,22 @@
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<layout class="QVBoxLayout" name="trebleRxVertLayout">
<item>
<widget class="QSlider" name="verticalSlider_2">
<widget class="QSlider" name="trebleRxSlider">
<property name="minimumSize">
<size>
<width>0</width>
<height>230</height>
</size>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<widget class="QLabel" name="trebleRxLabel">
<property name="minimumSize">
<size>
<width>0</width>
@ -187,23 +223,32 @@
</size>
</property>
<property name="text">
<string>Trebble</string>
<string>Treble</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_9">
<layout class="QVBoxLayout" name="IFShiftVertLayout">
<item>
<widget class="QSlider" name="verticalSlider_8">
<widget class="QSlider" name="IFShiftSlider">
<property name="minimumSize">
<size>
<width>0</width>
<height>230</height>
</size>
</property>
<property name="maximum">
<number>255</number>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_5">
<widget class="QLabel" name="IFShiftLabel">
<property name="text">
<string>IF Shift</string>
</property>
@ -212,16 +257,100 @@
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_7">
<layout class="QVBoxLayout" name="PBFInnerVertLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QSlider" name="verticalSlider_6">
<widget class="QSlider" name="TPBFInnerSlider">
<property name="minimumSize">
<size>
<width>0</width>
<height>230</height>
</size>
</property>
<property name="maximum">
<number>255</number>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_2">
<widget class="QLabel" name="TPBFInnerLabel">
<property name="text">
<string>PBF Inner</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="TPBFOuterVertLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QSlider" name="TPBFOuterSlider">
<property name="minimumSize">
<size>
<width>0</width>
<height>230</height>
</size>
</property>
<property name="maximum">
<number>255</number>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="TPBFOuterLabel">
<property name="text">
<string>PBF Outer</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="NRRxVertLayout">
<item>
<widget class="QSlider" name="NRRxSlider">
<property name="minimumSize">
<size>
<width>0</width>
<height>230</height>
</size>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="NRRxCheckBox">
<property name="text">
<string>NR</string>
</property>
@ -230,16 +359,22 @@
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_6">
<layout class="QVBoxLayout" name="NBRxVertLayout">
<item>
<widget class="QSlider" name="verticalSlider_7">
<widget class="QSlider" name="NBRxSlider">
<property name="minimumSize">
<size>
<width>0</width>
<height>230</height>
</size>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_3">
<widget class="QCheckBox" name="NBRxChkBox">
<property name="text">
<string>NB</string>
</property>
@ -248,16 +383,22 @@
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_11">
<layout class="QVBoxLayout" name="notchRxVertLayout">
<item>
<widget class="QSlider" name="verticalSlider_10">
<widget class="QSlider" name="notchRxSlider">
<property name="minimumSize">
<size>
<width>0</width>
<height>230</height>
</size>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_4">
<widget class="QCheckBox" name="notchRxChkBox">
<property name="text">
<string>Notch</string>
</property>
@ -266,40 +407,40 @@
</layout>
</item>
<item>
<widget class="QGroupBox" name="groupBox_3">
<widget class="QGroupBox" name="bandwidthGroupBox">
<property name="title">
<string>Bandwidth</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_12">
<item>
<widget class="QLabel" name="label_7">
<widget class="QLabel" name="lowBandwidthLabel">
<property name="text">
<string>Low</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox_2"/>
<widget class="QComboBox" name="lowBandwidthCombo"/>
</item>
<item>
<widget class="QLabel" name="label_8">
<widget class="QLabel" name="highBandwidthLabel">
<property name="text">
<string>High</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox"/>
<widget class="QComboBox" name="highBandwidthCombo"/>
</item>
<item>
<widget class="QLabel" name="label_9">
<widget class="QLabel" name="filterBandwidthLabel">
<property name="text">
<string>Filter</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox_3"/>
<widget class="QComboBox" name="filterBandwidthCombo"/>
</item>
<item>
<spacer name="verticalSpacer">

Wyświetl plik

@ -856,36 +856,44 @@ void udpAudio::sendTxAudio()
return;
}
QByteArray audio;
txaudio->getNextAudioChunk(audio);
if (audioMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
txaudio->getNextAudioChunk(audio);
// Now we have the next audio chunk, we can release the mutex.
audioMutex.unlock();
if (audio.length() > 0) {
int counter = 1;
int len = 0;
if (audio.length() > 0) {
int counter = 1;
int len = 0;
while (len < audio.length()) {
QByteArray partial = audio.mid(len, 1364);
audio_packet p;
memset(p.packet, 0x0, sizeof(p)); // We can't be sure it is initialized with 0x00!
p.len = sizeof(p) + partial.length();
p.sentid = myId;
p.rcvdid = remoteId;
if (partial.length() == 0xa0) {
p.ident = 0x9781;
while (len < audio.length()) {
QByteArray partial = audio.mid(len, 1364);
audio_packet p;
memset(p.packet, 0x0, sizeof(p)); // We can't be sure it is initialized with 0x00!
p.len = sizeof(p) + partial.length();
p.sentid = myId;
p.rcvdid = remoteId;
if (partial.length() == 0xa0) {
p.ident = 0x9781;
}
else {
p.ident = 0x0080; // TX audio is always this?
}
p.datalen = (quint16)qToBigEndian((quint16)partial.length());
p.sendseq = (quint16)qToBigEndian((quint16)sendAudioSeq); // THIS IS BIG ENDIAN!
QByteArray tx = QByteArray::fromRawData((const char*)p.packet, sizeof(p));
tx.append(partial);
len = len + partial.length();
//qInfo(logUdp()) << "Sending audio packet length: " << tx.length();
sendTrackedPacket(tx);
sendAudioSeq++;
counter++;
}
else {
p.ident = 0x0080; // TX audio is always this?
}
p.datalen = (quint16)qToBigEndian((quint16)partial.length());
p.sendseq = (quint16)qToBigEndian((quint16)sendAudioSeq); // THIS IS BIG ENDIAN!
QByteArray tx = QByteArray::fromRawData((const char*)p.packet, sizeof(p));
tx.append(partial);
len = len + partial.length();
//qInfo(logUdp()) << "Sending audio packet length: " << tx.length();
sendTrackedPacket(tx);
sendAudioSeq++;
counter++;
}
}
else {
qInfo(logUdpServer()) << "Unable to lock mutex for rxaudio";
}
}
void udpAudio::changeLatency(quint16 value)
@ -945,7 +953,7 @@ void udpAudio::dataReceived()
tempAudio.data = r.mid(0x18);
// Prefer signal/slot to forward audio as it is thread/safe
// Need to do more testing but latency appears fine.
//audioLatency = rxaudio->incomingAudio(tempAudio);
//rxaudio->incomingAudio(tempAudio);
emit haveAudioData(tempAudio);
audioLatency = rxaudio->getLatency();
}

Wyświetl plik

@ -32,6 +32,7 @@
#define AREYOUTHERE_PERIOD 500
#define WATCHDOG_PERIOD 500
#define RETRANSMIT_PERIOD 100
#define LOCK_PERIOD 100
struct udpPreferences {
QString ipAddress;
@ -197,6 +198,8 @@ private:
QTimer* txAudioTimer=Q_NULLPTR;
bool enableTx = true;
QMutex audioMutex;
};

Wyświetl plik

@ -2,6 +2,7 @@
#include "logcategories.h"
#define STALE_CONNECTION 15
#define LOCK_PERIOD 10 // time to attempt to lock Mutex in ms
udpServer::udpServer(SERVERCONFIG config, audioSetup outAudio, audioSetup inAudio) :
config(config),
outAudio(outAudio),
@ -70,81 +71,22 @@ udpServer::~udpServer()
{
qInfo(logUdpServer()) << "Closing udpServer";
connMutex.lock();
foreach(CLIENT * client, controlClients)
{
if (client->idleTimer != Q_NULLPTR)
{
client->idleTimer->stop();
delete client->idleTimer;
}
if (client->pingTimer != Q_NULLPTR) {
client->pingTimer->stop();
delete client->pingTimer;
}
deleteConnection(&controlClients, client);
if (client->retransmitTimer != Q_NULLPTR) {
client->retransmitTimer->stop();
delete client->retransmitTimer;
}
delete client;
controlClients.removeAll(client);
}
foreach(CLIENT * client, civClients)
{
if (client->idleTimer != Q_NULLPTR)
{
client->idleTimer->stop();
delete client->idleTimer;
}
if (client->pingTimer != Q_NULLPTR) {
client->pingTimer->stop();
delete client->pingTimer;
}
if (client->retransmitTimer != Q_NULLPTR) {
client->retransmitTimer->stop();
delete client->retransmitTimer;
}
delete client;
civClients.removeAll(client);
deleteConnection(&civClients, client);
}
foreach(CLIENT * client, audioClients)
{
if (client->idleTimer != Q_NULLPTR)
{
client->idleTimer->stop();
delete client->idleTimer;
}
if (client->pingTimer != Q_NULLPTR) {
client->pingTimer->stop();
delete client->pingTimer;
}
if (client->retransmitTimer != Q_NULLPTR) {
client->retransmitTimer->stop();
delete client->retransmitTimer;
}
delete client;
audioClients.removeAll(client);
}
if (rxAudioTimer != Q_NULLPTR) {
rxAudioTimer->stop();
delete rxAudioTimer;
rxAudioTimer = Q_NULLPTR;
}
if (rxAudioThread != Q_NULLPTR) {
rxAudioThread->quit();
rxAudioThread->wait();
}
if (txAudioThread != Q_NULLPTR) {
txAudioThread->quit();
txAudioThread->wait();
deleteConnection(&audioClients, client);
}
// Now all connections are deleted, close and delete the sockets.
if (udpControl != Q_NULLPTR) {
udpControl->close();
delete udpControl;
@ -157,10 +99,6 @@ udpServer::~udpServer()
udpAudio->close();
delete udpAudio;
}
connMutex.unlock();
}
@ -223,10 +161,15 @@ void udpServer::controlReceived()
current->commonCap = 0x8010;
qInfo(logUdpServer()) << current->ipAddress.toString() << ": New Control connection created";
connMutex.lock();
controlClients.append(current);
connMutex.unlock();
if (connMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
controlClients.append(current);
connMutex.unlock();
}
else {
qInfo(logUdpServer()) << "Unable to lock connMutex()";
}
}
current->lastHeard = QDateTime::currentDateTime();
@ -338,13 +281,11 @@ void udpServer::controlReceived()
if (current->isAuthenticated) {
qInfo(logUdpServer()) << current->ipAddress.toString() << ": User " << current->user.username << " login OK";
sendLoginResponse(current, true);
}
else {
qInfo(logUdpServer()) << current->ipAddress.toString() << ": Incorrect username/password";
sendLoginResponse(current, false);
}
sendLoginResponse(current, current->isAuthenticated);
break;
}
case (CONNINFO_SIZE):
@ -385,6 +326,7 @@ void udpServer::controlReceived()
txaudio = new audioHandler();
txAudioThread = new QThread(this);
txaudio->moveToThread(txAudioThread);
txAudioThread->start(QThread::TimeCriticalPriority);
@ -510,9 +452,15 @@ void udpServer::civReceived()
current->retransmitTimer->start(RETRANSMIT_PERIOD);
qInfo(logUdpServer()) << current->ipAddress.toString() << "(" << current->type << "): New connection created";
connMutex.lock();
civClients.append(current);
connMutex.unlock();
if (connMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
civClients.append(current);
connMutex.unlock();
}
else {
qInfo(logUdpServer()) << "Unable to lock connMutex()";
}
}
@ -656,9 +604,14 @@ void udpServer::audioReceived()
current->retransmitTimer->start(RETRANSMIT_PERIOD);
current->seqPrefix = 0;
qInfo(logUdpServer()) << current->ipAddress.toString() << "(" << current->type << "): New connection created";
connMutex.lock();
audioClients.append(current);
connMutex.unlock();
if (connMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
audioClients.append(current);
connMutex.unlock();
}
else {
qInfo(logUdpServer()) << "Unable to lock connMutex()";
}
}
@ -721,6 +674,8 @@ void udpServer::audioReceived()
tempAudio.data = r.mid(0x18);
//qInfo(logUdpServer()) << "sending tx audio " << in->seq;
emit haveAudioData(tempAudio);
//txaudio->incomingAudio(tempAudio);
}
}
break;
@ -778,9 +733,15 @@ void udpServer::commonReceived(QList<CLIENT*>* l, CLIENT* current, QByteArray r)
// Don't constantly retransmit the same packet, give-up eventually
qInfo(logUdpServer()) << current->ipAddress.toString() << "(" << current->type << "): Sending retransmit of " << hex << match->seqNum;
match->retransmitCount++;
udpMutex.lock();
current->socket->writeDatagram(match->data, current->ipAddress, current->port);
udpMutex.unlock();
if (udpMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
current->socket->writeDatagram(match->data, current->ipAddress, current->port);
udpMutex.unlock();
}
else {
qInfo(logUdpServer()) << "Unable to lock udpMutex()";
}
}
else {
// Just send an idle!
@ -816,9 +777,15 @@ void udpServer::commonReceived(QList<CLIENT*>* l, CLIENT* current, QByteArray r)
// Send "untracked" as it has already been sent once.
qInfo(logUdpServer()) << current->ipAddress.toString() << "(" << current->type << "): Sending retransmit of " << hex << match->seqNum;
match->retransmitCount++;
udpMutex.lock();
current->socket->writeDatagram(match->data, current->ipAddress, current->port);
udpMutex.unlock();
if (udpMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
current->socket->writeDatagram(match->data, current->ipAddress, current->port);
udpMutex.unlock();
}
else {
qInfo(logUdpServer()) << "Unable to lock udpMutex()";
}
match++;
}
}
@ -830,9 +797,15 @@ void udpServer::commonReceived(QList<CLIENT*>* l, CLIENT* current, QByteArray r)
//}
if (current->rxSeqBuf.isEmpty())
{
current->rxMutex.lock();
current->rxSeqBuf.insert(in->seq, QTime::currentTime());
current->rxMutex.unlock();
if (current->rxMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
current->rxSeqBuf.insert(in->seq, QTime::currentTime());
current->rxMutex.unlock();
}
else {
qInfo(logUdpServer()) << "Unable to lock rxMutex()";
}
}
else
{
@ -841,35 +814,58 @@ void udpServer::commonReceived(QList<CLIENT*>* l, CLIENT* current, QByteArray r)
{
qInfo(logUdpServer()) << current->ipAddress.toString() << "(" << current->type << "): ******* seq number may have rolled over ****** previous highest: " << hex << current->rxSeqBuf.lastKey() << " current: " << hex << in->seq;
// Looks like it has rolled over so clear buffer and start again.
current->rxMutex.lock();
current->rxSeqBuf.clear();
current->rxMutex.unlock();
current->missMutex.lock();
current->rxMissing.clear();
current->missMutex.unlock();
if (current->rxMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
current->rxSeqBuf.clear();
current->rxMutex.unlock();
}
else {
qInfo(logUdpServer()) << "Unable to lock rxMutex()";
}
if (current->missMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
current->rxMissing.clear();
current->missMutex.unlock();
}
else {
qInfo(logUdpServer()) << "Unable to lock missMutex()";
}
return;
}
if (!current->rxSeqBuf.contains(in->seq))
{
// Add incoming packet to the received buffer and if it is in the missing buffer, remove it.
current->rxMutex.lock();
if (current->rxSeqBuf.size() > 400)
if (current->rxMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
current->rxSeqBuf.remove(0);
if (current->rxSeqBuf.size() > 400)
{
current->rxSeqBuf.remove(0);
}
current->rxSeqBuf.insert(in->seq, QTime::currentTime());
current->rxMutex.unlock();
}
current->rxSeqBuf.insert(in->seq, QTime::currentTime());
current->rxMutex.unlock();
else {
qInfo(logUdpServer()) << "Unable to lock rxMutex()";
}
} else{
// Check whether this is one of our missing ones!
current->missMutex.lock();
QMap<quint16, int>::iterator s = current->rxMissing.find(in->seq);
if (s != current->rxMissing.end())
if (current->missMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
qInfo(logUdpServer()) << current->ipAddress.toString() << "(" << current->type << "): Missing SEQ has been received! " << hex << in->seq;
s = current->rxMissing.erase(s);
QMap<quint16, int>::iterator s = current->rxMissing.find(in->seq);
if (s != current->rxMissing.end())
{
qInfo(logUdpServer()) << current->ipAddress.toString() << "(" << current->type << "): Missing SEQ has been received! " << hex << in->seq;
s = current->rxMissing.erase(s);
}
current->missMutex.unlock();
}
else {
qInfo(logUdpServer()) << "Unable to lock missMutex()";
}
current->missMutex.unlock();
}
}
}
@ -897,20 +893,37 @@ void udpServer::sendControl(CLIENT* c, quint8 type, quint16 seq)
s.timeSent = QTime::currentTime();
s.retransmitCount = 0;
s.data = QByteArray::fromRawData((const char*)p.packet, sizeof(p));
c->txMutex.lock();
c->txSeqBuf.insert(seq, s);
c->txSeq++;
c->txMutex.unlock();
if (c->txMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
c->txSeqBuf.insert(seq, s);
c->txSeq++;
c->txMutex.unlock();
}
else {
qInfo(logUdpServer()) << "Unable to lock txMutex()";
}
if (udpMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
c->socket->writeDatagram(QByteArray::fromRawData((const char*)p.packet, sizeof(p)), c->ipAddress, c->port);
udpMutex.unlock();
}
else {
qInfo(logUdpServer()) << "Unable to lock udpMutex()";
}
udpMutex.lock();
c->socket->writeDatagram(QByteArray::fromRawData((const char*)p.packet, sizeof(p)), c->ipAddress, c->port);
udpMutex.unlock();
}
else {
p.seq = seq;
udpMutex.lock();
c->socket->writeDatagram(QByteArray::fromRawData((const char*)p.packet, sizeof(p)), c->ipAddress, c->port);
udpMutex.unlock();
if (udpMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
c->socket->writeDatagram(QByteArray::fromRawData((const char*)p.packet, sizeof(p)), c->ipAddress, c->port);
udpMutex.unlock();
}
else {
qInfo(logUdpServer()) << "Unable to lock udpMutex()";
}
}
return;
@ -958,9 +971,14 @@ void udpServer::sendPing(QList<CLIENT*>* l, CLIENT* c, quint16 seq, bool reply)
p.time = pingTime;
p.reply = (char)reply;
udpMutex.lock();
c->socket->writeDatagram(QByteArray::fromRawData((const char*)p.packet, sizeof(p)), c->ipAddress, c->port);
udpMutex.unlock();
if (udpMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
c->socket->writeDatagram(QByteArray::fromRawData((const char*)p.packet, sizeof(p)), c->ipAddress, c->port);
udpMutex.unlock();
}
else {
qInfo(logUdpServer()) << "Unable to lock udpMutex()";
}
return;
}
@ -1000,14 +1018,24 @@ void udpServer::sendLoginResponse(CLIENT* c, bool allowed)
s.timeSent = QTime::currentTime();
s.retransmitCount = 0;
s.data = QByteArray::fromRawData((const char*)p.packet, sizeof(p));
c->txMutex.lock();
c->txSeqBuf.insert(c->txSeq, s);
c->txSeq++;
c->txMutex.unlock();
if (c->txMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
c->txSeqBuf.insert(c->txSeq, s);
c->txSeq++;
c->txMutex.unlock();
}
else {
qInfo(logUdpServer()) << "Unable to lock txMutex()";
}
udpMutex.lock();
c->socket->writeDatagram(QByteArray::fromRawData((const char*)p.packet, sizeof(p)), c->ipAddress, c->port);
udpMutex.unlock();
if (udpMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
c->socket->writeDatagram(QByteArray::fromRawData((const char*)p.packet, sizeof(p)), c->ipAddress, c->port);
udpMutex.unlock();
}
else {
qInfo(logUdpServer()) << "Unable to lock udpMutex()";
}
if (c->idleTimer != Q_NULLPTR)
c->idleTimer->start(100);
@ -1105,18 +1133,29 @@ void udpServer::sendCapabilities(CLIENT* c)
s.timeSent = QTime::currentTime();
s.retransmitCount = 0;
s.data = QByteArray::fromRawData((const char*)p.packet, sizeof(p));
c->txMutex.lock();
if (c->txSeqBuf.size() > 400)
if (c->txMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
c->txSeqBuf.remove(0);
if (c->txSeqBuf.size() > 400)
{
c->txSeqBuf.remove(0);
}
c->txSeqBuf.insert(p.seq, s);
c->txSeq++;
c->txMutex.unlock();
}
else {
qInfo(logUdpServer()) << "Unable to lock txMutex()";
}
if (udpMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
c->socket->writeDatagram(QByteArray::fromRawData((const char*)p.packet, sizeof(p)), c->ipAddress, c->port);
udpMutex.unlock();
}
else {
qInfo(logUdpServer()) << "Unable to lock udpMutex()";
}
c->txSeqBuf.insert(p.seq, s);
c->txSeq++;
c->txMutex.unlock();
udpMutex.lock();
c->socket->writeDatagram(QByteArray::fromRawData((const char*)p.packet, sizeof(p)), c->ipAddress, c->port);
udpMutex.unlock();
if (c->idleTimer != Q_NULLPTR)
c->idleTimer->start(100);
@ -1165,18 +1204,30 @@ void udpServer::sendConnectionInfo(CLIENT* c)
s.retransmitCount = 0;
s.data = QByteArray::fromRawData((const char*)p.packet, sizeof(p));
c->txMutex.lock();
if (c->txSeqBuf.size() > 400)
if (c->txMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
c->txSeqBuf.remove(0);
if (c->txSeqBuf.size() > 400)
{
c->txSeqBuf.remove(0);
}
c->txSeqBuf.insert(p.seq, s);
c->txSeq++;
c->txMutex.unlock();
}
else {
qInfo(logUdpServer()) << "Unable to lock txMutex()";
}
if (udpMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
c->socket->writeDatagram(QByteArray::fromRawData((const char*)p.packet, sizeof(p)), c->ipAddress, c->port);
udpMutex.unlock();
}
else {
qInfo(logUdpServer()) << "Unable to lock udpMutex()";
}
c->txSeqBuf.insert(p.seq, s);
c->txSeq++;
c->txMutex.unlock();
udpMutex.lock();
c->socket->writeDatagram(QByteArray::fromRawData((const char*)p.packet, sizeof(p)), c->ipAddress, c->port);
udpMutex.unlock();
if (c->idleTimer != Q_NULLPTR)
c->idleTimer->start(100);
@ -1211,18 +1262,29 @@ void udpServer::sendTokenResponse(CLIENT* c, quint8 type)
s.retransmitCount = 0;
s.data = QByteArray::fromRawData((const char*)p.packet, sizeof(p));
c->txMutex.lock();
if (c->txSeqBuf.size() > 400)
if (c->txMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
c->txSeqBuf.remove(0);
if (c->txSeqBuf.size() > 400)
{
c->txSeqBuf.remove(0);
}
c->txSeqBuf.insert(p.seq, s);
c->txSeq++;
c->txMutex.unlock();
}
else {
qInfo(logUdpServer()) << "Unable to lock txMutex()";
}
c->txSeqBuf.insert(p.seq, s);
c->txSeq++;
c->txMutex.unlock();
udpMutex.lock();
c->socket->writeDatagram(QByteArray::fromRawData((const char*)p.packet, sizeof(p)), c->ipAddress, c->port);
udpMutex.unlock();
if (udpMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
c->socket->writeDatagram(QByteArray::fromRawData((const char*)p.packet, sizeof(p)), c->ipAddress, c->port);
udpMutex.unlock();
}
else {
qInfo(logUdpServer()) << "Unable to lock udpMutex()";
}
if (c->idleTimer != Q_NULLPTR)
@ -1318,18 +1380,29 @@ void udpServer::sendStatus(CLIENT* c)
s.timeSent = QTime::currentTime();
s.retransmitCount = 0;
s.data = QByteArray::fromRawData((const char*)p.packet, sizeof(p));
c->txMutex.lock();
if (c->txSeqBuf.size() > 400)
if (c->txMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
c->txSeqBuf.remove(0);
if (c->txSeqBuf.size() > 400)
{
c->txSeqBuf.remove(0);
}
c->txSeq++;
c->txSeqBuf.insert(p.seq, s);
c->txMutex.unlock();
}
else {
qInfo(logUdpServer()) << "Unable to lock txMutex()";
}
c->txSeq++;
c->txSeqBuf.insert(p.seq, s);
c->txMutex.unlock();
udpMutex.lock();
c->socket->writeDatagram(QByteArray::fromRawData((const char*)p.packet, sizeof(p)), c->ipAddress, c->port);
udpMutex.unlock();
if (udpMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
c->socket->writeDatagram(QByteArray::fromRawData((const char*)p.packet, sizeof(p)), c->ipAddress, c->port);
udpMutex.unlock();
}
else {
qInfo(logUdpServer()) << "Unable to lock udpMutex()";
}
}
@ -1362,19 +1435,31 @@ void udpServer::dataForServer(QByteArray d)
s.retransmitCount = 0;
s.data = t;
client->txMutex.lock();
if (client->txSeqBuf.size() > 400)
if (client->txMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
client->txSeqBuf.remove(0);
if (client->txSeqBuf.size() > 400)
{
client->txSeqBuf.remove(0);
}
client->txSeqBuf.insert(p.seq, s);
client->txSeq++;
client->innerSeq++;
client->txMutex.unlock();
}
else {
qInfo(logUdpServer()) << "Unable to lock txMutex()";
}
if (udpMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
client->socket->writeDatagram(t, client->ipAddress, client->port);
udpMutex.unlock();
}
else {
qInfo(logUdpServer()) << "Unable to lock udpMutex()";
}
client->txSeqBuf.insert(p.seq, s);
client->txSeq++;
client->innerSeq++;
client->txMutex.unlock();
udpMutex.lock();
client->socket->writeDatagram(t, client->ipAddress, client->port);
udpMutex.unlock();
} else {
qInfo(logUdpServer()) << "Got data for different ID" << hex << (quint8)d[lastFE+1] << ":" << hex << (quint8)d[lastFE+2];
}
@ -1387,14 +1472,22 @@ void udpServer::sendRxAudio()
{
QByteArray audio;
if (rxaudio) {
audio.clear();
rxaudio->getNextAudioChunk(audio);
int len = 0;
while (len < audio.length()) {
audioPacket partial;
partial.data = audio.mid(len, 1364);
receiveAudioData(partial);
len = len + partial.data.length();
if (audioMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
audio.clear();
rxaudio->getNextAudioChunk(audio);
// Now we have the next audio chunk, we can release the mutex.
audioMutex.unlock();
int len = 0;
while (len < audio.length()) {
audioPacket partial;
partial.data = audio.mid(len, 1364);
receiveAudioData(partial);
len = len + partial.data.length();
}
}
else {
qInfo(logUdpServer()) << "Unable to lock mutex for rxaudio";
}
}
}
@ -1424,19 +1517,31 @@ void udpServer::receiveAudioData(const audioPacket& d)
s.timeSent = QTime::currentTime();
s.retransmitCount = 0;
s.data = t;
client->txMutex.lock();
if (client->txSeqBuf.size() > 400)
if (client->txMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
client->txSeqBuf.remove(0);
if (client->txSeqBuf.size() > 400)
{
client->txSeqBuf.remove(0);
}
client->txSeqBuf.insert(p.seq, s);
client->txSeq++;
client->sendAudioSeq++;
client->txMutex.unlock();
}
else {
qInfo(logUdpServer()) << "Unable to lock txMutex()";
}
if (udpMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
client->socket->writeDatagram(t, client->ipAddress, client->port);
udpMutex.unlock();
}
else {
qInfo(logUdpServer()) << "Unable to lock udpMutex()";
}
client->txSeqBuf.insert(p.seq, s);
client->txSeq++;
client->sendAudioSeq++;
client->txMutex.unlock();
udpMutex.lock();
client->socket->writeDatagram(t, client->ipAddress, client->port);
udpMutex.unlock();
}
}
@ -1462,13 +1567,24 @@ void udpServer::sendRetransmitRequest(CLIENT* c)
{
// Too many packets to process, flush buffers and start again!
qDebug(logUdp()) << "Too many missing packets, flushing buffer: " << c->rxSeqBuf.lastKey() << "missing=" << c->rxSeqBuf.lastKey() - c->rxSeqBuf.firstKey() - c->rxSeqBuf.size() + 1;
c->missMutex.lock();
c->rxMissing.clear();
c->missMutex.unlock();
if (c->missMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
c->rxMissing.clear();
c->missMutex.unlock();
}
else {
qInfo(logUdpServer()) << "Unable to lock missMutex()";
}
if (c->rxMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
c->rxSeqBuf.clear();
c->rxMutex.unlock();
}
else {
qInfo(logUdpServer()) << "Unable to lock rxMutex()";
}
c->rxMutex.lock();
c->rxSeqBuf.clear();
c->rxMutex.unlock();
}
else {
// We have at least 1 missing packet!
@ -1482,25 +1598,43 @@ void udpServer::sendRetransmitRequest(CLIENT* c)
// We haven't seen this missing packet before
qDebug(logUdp()) << this->metaObject()->className() << ": Adding to missing buffer (len=" << c->rxMissing.size() << "): " << j;
c->missMutex.lock();
c->rxMissing.insert(j, 0);
c->missMutex.unlock();
c->rxMutex.lock();
if (c->rxSeqBuf.size() > 400)
if (c->missMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
c->rxSeqBuf.remove(0);
c->rxMissing.insert(j, 0);
c->missMutex.unlock();
}
c->rxSeqBuf.insert(j, QTime::currentTime()); // Add this missing packet to the rxbuffer as we now long about it.
c->rxMutex.unlock();
else {
qInfo(logUdpServer()) << "Unable to lock missMutex()";
}
if (c->rxMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
if (c->rxSeqBuf.size() > 400)
{
c->rxSeqBuf.remove(0);
}
c->rxSeqBuf.insert(j, QTime::currentTime()); // Add this missing packet to the rxbuffer as we now long about it.
c->rxMutex.unlock();
}
else {
qInfo(logUdpServer()) << "Unable to lock rxMutex()";
}
}
else {
if (s.value() == 4)
{
// We have tried 4 times to request this packet, time to give up!
c->missMutex.lock();
s = c->rxMissing.erase(s);
c->missMutex.unlock();
if (c->missMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
s = c->rxMissing.erase(s);
c->missMutex.unlock();
}
else {
qInfo(logUdpServer()) << "Unable to lock missMutex()";
}
}
}
@ -1509,49 +1643,65 @@ void udpServer::sendRetransmitRequest(CLIENT* c)
}
}
c->missMutex.lock();
for (auto it = c->rxMissing.begin(); it != c->rxMissing.end(); ++it)
if (c->missMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
if (it.value() < 10)
for (auto it = c->rxMissing.begin(); it != c->rxMissing.end(); ++it)
{
missingSeqs.append(it.key() & 0xff);
missingSeqs.append(it.key() >> 8 & 0xff);
missingSeqs.append(it.key() & 0xff);
missingSeqs.append(it.key() >> 8 & 0xff);
it.value()++;
if (it.value() < 10)
{
missingSeqs.append(it.key() & 0xff);
missingSeqs.append(it.key() >> 8 & 0xff);
missingSeqs.append(it.key() & 0xff);
missingSeqs.append(it.key() >> 8 & 0xff);
it.value()++;
}
}
if (missingSeqs.length() != 0)
{
control_packet p;
memset(p.packet, 0x0, sizeof(p)); // We can't be sure it is initialized with 0x00!
p.type = 0x01;
p.seq = 0x0000;
p.sentid = c->myId;
p.rcvdid = c->remoteId;
if (missingSeqs.length() == 4) // This is just a single missing packet so send using a control.
{
p.seq = (missingSeqs[0] & 0xff) | (quint16)(missingSeqs[1] << 8);
qDebug(logUdp()) << this->metaObject()->className() << ": sending request for missing packet : " << hex << p.seq;
if (udpMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
c->socket->writeDatagram(QByteArray::fromRawData((const char*)p.packet, sizeof(p)), c->ipAddress, c->port);
udpMutex.unlock();
}
else {
qInfo(logUdpServer()) << "Unable to lock udpMutex()";
}
}
else
{
qDebug(logUdp()) << this->metaObject()->className() << ": sending request for multiple missing packets : " << missingSeqs.toHex();
if (udpMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
missingSeqs.insert(0, p.packet, sizeof(p.packet));
c->socket->writeDatagram(missingSeqs, c->ipAddress, c->port);
udpMutex.unlock();
}
else {
qInfo(logUdpServer()) << "Unable to lock udpMutex()";
}
}
}
c->missMutex.unlock();
}
c->missMutex.unlock();
if (missingSeqs.length() != 0)
{
control_packet p;
memset(p.packet, 0x0, sizeof(p)); // We can't be sure it is initialized with 0x00!
p.type = 0x01;
p.seq = 0x0000;
p.sentid = c->myId;
p.rcvdid = c->remoteId;
if (missingSeqs.length() == 4) // This is just a single missing packet so send using a control.
{
p.seq = (missingSeqs[0] & 0xff) | (quint16)(missingSeqs[1] << 8);
qDebug(logUdp()) << this->metaObject()->className() << ": sending request for missing packet : " << hex << p.seq;
udpMutex.lock();
c->socket->writeDatagram(QByteArray::fromRawData((const char*)p.packet, sizeof(p)), c->ipAddress, c->port);
udpMutex.unlock();
}
else
{
qDebug(logUdp()) << this->metaObject()->className() << ": sending request for multiple missing packets : " << missingSeqs.toHex();
udpMutex.lock();
missingSeqs.insert(0, p.packet, sizeof(p.packet));
c->socket->writeDatagram(missingSeqs, c->ipAddress, c->port);
udpMutex.unlock();
}
else {
qInfo(logUdpServer()) << "Unable to lock missMutex()";
}
}
@ -1579,35 +1729,57 @@ void udpServer::deleteConnection(QList<CLIENT*>* l, CLIENT* c)
delete c->retransmitTimer;
}
c->rxMutex.lock();
c->rxSeqBuf.clear();
c->rxMutex.unlock();
c->txMutex.lock();
c->txSeqBuf.clear();
c->txMutex.unlock();
c->missMutex.lock();
c->rxMissing.clear();
c->missMutex.unlock();
connMutex.lock();
QList<CLIENT*>::iterator it = l->begin();
while (it != l->end()) {
CLIENT* client = *it;
if (client != Q_NULLPTR && client == c) {
qInfo(logUdpServer()) << "Found" << client->type << "connection to: " << client->ipAddress.toString() << ":" << QString::number(client->port);
it = l->erase(it);
}
else {
++it;
}
if (c->rxMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
c->rxSeqBuf.clear();
c->rxMutex.unlock();
}
else {
qInfo(logUdpServer()) << "Unable to lock rxMutex()";
}
if (c->txMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
c->txSeqBuf.clear();
c->txMutex.unlock();
}
else {
qInfo(logUdpServer()) << "Unable to lock txMutex()";
}
if (c->missMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
c->rxMissing.clear();
c->missMutex.unlock();
}
else {
qInfo(logUdpServer()) << "Unable to lock missMutex()";
}
if (connMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
{
QList<CLIENT*>::iterator it = l->begin();
while (it != l->end()) {
CLIENT* client = *it;
if (client != Q_NULLPTR && client == c) {
qInfo(logUdpServer()) << "Found" << client->type << "connection to: " << client->ipAddress.toString() << ":" << QString::number(client->port);
it = l->erase(it);
}
else {
++it;
}
}
delete c; // Is this needed or will the erase have done it?
c = Q_NULLPTR;
qInfo(logUdpServer()) << "Current Number of clients connected: " << l->length();
connMutex.unlock();
}
else {
qInfo(logUdpServer()) << "Unable to lock connMutex()";
}
delete c; // Is this needed or will the erase have done it?
c = Q_NULLPTR;
qInfo(logUdpServer()) << "Current Number of clients connected: " << l->length();
connMutex.unlock();
if (l->length() == 0) {

Wyświetl plik

@ -154,6 +154,7 @@ private:
QMutex udpMutex; // Used for critical operations.
QMutex connMutex;
QMutex audioMutex;
QList <CLIENT*> controlClients = QList<CLIENT*>();
QList <CLIENT*> civClients = QList<CLIENT*>();

Wyświetl plik

@ -111,6 +111,11 @@ wfmain::~wfmain()
delete rpt;
delete ui;
delete settings;
#if defined(PORTAUDIO)
Pa_Terminate();
#endif
}
void wfmain::closeEvent(QCloseEvent *event)
@ -278,7 +283,7 @@ void wfmain::rigConnections()
connect(this, SIGNAL(setScopeMode(spectrumMode)), rig, SLOT(setSpectrumMode(spectrumMode)));
connect(this, SIGNAL(getScopeMode()), rig, SLOT(getScopeMode()));
connect(this, SIGNAL(setFrequency(freqt)), rig, SLOT(setFrequency(freqt)));
connect(this, SIGNAL(setFrequency(unsigned char, freqt)), rig, SLOT(setFrequency(unsigned char, freqt)));
connect(this, SIGNAL(setScopeEdge(char)), rig, SLOT(setScopeEdge(char)));
connect(this, SIGNAL(setScopeSpan(char)), rig, SLOT(setScopeSpan(char)));
//connect(this, SIGNAL(getScopeMode()), rig, SLOT(getScopeMode()));
@ -296,6 +301,9 @@ void wfmain::rigConnections()
connect(this, SIGNAL(getRfGain()), rig, SLOT(getRfGain()));
connect(this, SIGNAL(getAfGain()), rig, SLOT(getAfGain()));
connect(this, SIGNAL(getSql()), rig, SLOT(getSql()));
connect(this, SIGNAL(getIfShift()), rig, SLOT(getIFShift()));
connect(this, SIGNAL(getTPBFInner()), rig, SLOT(getTPBFInner()));
connect(this, SIGNAL(getTPBFOuter()), rig, SLOT(getTPBFOuter()));
connect(this, SIGNAL(getTxPower()), rig, SLOT(getTxLevel()));
connect(this, SIGNAL(getMicGain()), rig, SLOT(getMicGain()));
connect(this, SIGNAL(getSpectrumRefLevel()), rig, SLOT(getSpectrumRefLevel()));
@ -306,6 +314,9 @@ void wfmain::rigConnections()
connect(this, SIGNAL(setRfGain(unsigned char)), rig, SLOT(setRfGain(unsigned char)));
connect(this, SIGNAL(setAfGain(unsigned char)), rig, SLOT(setAfGain(unsigned char)));
connect(this, SIGNAL(setSql(unsigned char)), rig, SLOT(setSquelch(unsigned char)));
connect(this, SIGNAL(setIFShift(unsigned char)), rig, SLOT(setIFShift(unsigned char)));
connect(this, SIGNAL(setTPBFInner(unsigned char)), rig, SLOT(setTPBFInner(unsigned char)));
connect(this, SIGNAL(setTPBFOuter(unsigned char)), rig, SLOT(setTPBFOuter(unsigned char)));
connect(this, SIGNAL(setTxPower(unsigned char)), rig, SLOT(setTxPower(unsigned char)));
connect(this, SIGNAL(setMicGain(unsigned char)), rig, SLOT(setMicGain(unsigned char)));
connect(this, SIGNAL(setMonitorLevel(unsigned char)), rig, SLOT(setMonitorLevel(unsigned char)));
@ -318,6 +329,9 @@ void wfmain::rigConnections()
connect(rig, SIGNAL(haveRfGain(unsigned char)), this, SLOT(receiveRfGain(unsigned char)));
connect(rig, SIGNAL(haveAfGain(unsigned char)), this, SLOT(receiveAfGain(unsigned char)));
connect(rig, SIGNAL(haveSql(unsigned char)), this, SLOT(receiveSql(unsigned char)));
connect(rig, SIGNAL(haveIFShift(unsigned char)), trxadj, SLOT(updateIFShift(unsigned char)));
connect(rig, SIGNAL(haveTPBFInner(unsigned char)), trxadj, SLOT(updateTPBFInner(unsigned char)));
connect(rig, SIGNAL(haveTPBFOuter(unsigned char)), trxadj, SLOT(updateTPBFOuter(unsigned char)));
connect(rig, SIGNAL(haveTxPower(unsigned char)), this, SLOT(receiveTxPower(unsigned char)));
connect(rig, SIGNAL(haveMicGain(unsigned char)), this, SLOT(receiveMicGain(unsigned char)));
connect(rig, SIGNAL(haveSpectrumRefLevel(int)), this, SLOT(receiveSpectrumRefLevel(int)));
@ -399,13 +413,14 @@ void wfmain::makeRig()
connect(this, SIGNAL(sendCloseComm()), rig, SLOT(closeComm()));
connect(this, SIGNAL(sendChangeLatency(quint16)), rig, SLOT(changeLatency(quint16)));
connect(this, SIGNAL(getRigCIV()), rig, SLOT(findRigs()));
connect(this, SIGNAL(setRigID(unsigned char)), rig, SLOT(setRigID(unsigned char)));
connect(rig, SIGNAL(discoveredRigID(rigCapabilities)), this, SLOT(receiveFoundRigID(rigCapabilities)));
connect(rig, SIGNAL(commReady()), this, SLOT(receiveCommReady()));
if (rigCtl != Q_NULLPTR) {
connect(rig, SIGNAL(stateInfo(rigStateStruct*)), rigCtl, SLOT(receiveStateInfo(rigStateStruct*)));
connect(this, SIGNAL(requestRigState()), rig, SLOT(sendState()));
connect(rigCtl, SIGNAL(setFrequency(freqt)), rig, SLOT(setFrequency(freqt)));
connect(rigCtl, SIGNAL(setFrequency(unsigned char, freqt)), rig, SLOT(setFrequency(unsigned char, freqt)));
connect(rigCtl, SIGNAL(setMode(unsigned char, unsigned char)), rig, SLOT(setMode(unsigned char, unsigned char)));
connect(rigCtl, SIGNAL(setDataMode(bool, unsigned char)), rig, SLOT(setDataMode(bool, unsigned char)));
connect(rigCtl, SIGNAL(setPTT(bool)), rig, SLOT(setPTT(bool)));
@ -523,8 +538,14 @@ void wfmain::receiveCommReady()
// We still query the rigID to find the model, but at least we know the CIV.
qInfo(logSystem()) << "Skipping automatic CIV, using user-supplied value of " << prefs.radioCIVAddr;
showStatusBarText(QString("Using user-supplied radio CI-V address of 0x%1").arg(prefs.radioCIVAddr, 2, 16));
emit getRigID();
getInitialRigState();
if(prefs.CIVisRadioModel)
{
qInfo(logSystem()) << "Skipping Rig ID query, using user-supplied model from CI-V address: " << prefs.radioCIVAddr;
emit setRigID(prefs.radioCIVAddr);
} else {
emit getRigID();
getInitialRigState();
}
}
}
@ -659,6 +680,7 @@ void wfmain::setupMainUI()
ui->tuningStepCombo->addItem("9 kHz", (unsigned int) 9000); // European medium wave stepsize
ui->tuningStepCombo->addItem("10 kHz", (unsigned int) 10000);
ui->tuningStepCombo->addItem("12.5 kHz", (unsigned int) 12500);
ui->tuningStepCombo->addItem("25 kHz", (unsigned int) 25000);
ui->tuningStepCombo->addItem("100 kHz", (unsigned int) 100000);
ui->tuningStepCombo->addItem("250 kHz", (unsigned int) 250000);
ui->tuningStepCombo->addItem("1 MHz", (unsigned int) 1000000); //for 23 cm and HF
@ -756,9 +778,10 @@ void wfmain::setupMainUI()
ui->statusBar->addPermanentWidget(connectedLed);
rigName = new QLabel(this);
rigName->setAlignment(Qt::AlignRight);
ui->statusBar->addPermanentWidget(rigName);
rigName->setText("NONE");
rigName->setFixedWidth(50);
rigName->setFixedWidth(60);
freq.MHzDouble = 0.0;
freq.Hz = 0;
@ -805,6 +828,20 @@ void wfmain::setupMainUI()
[=](const int &newValue) { statusFromSliderRaw("Waterfall Length", newValue);}
);
connect(this->trxadj, &transceiverAdjustments::setIFShift,
[=](const unsigned char &newValue) { issueCmdUniquePriority(cmdSetIFShift, newValue);}
);
connect(this->trxadj, &transceiverAdjustments::setTPBFInner,
[=](const unsigned char &newValue) { issueCmdUniquePriority(cmdSetTPBFInner, newValue);}
);
connect(this->trxadj, &transceiverAdjustments::setTPBFOuter,
[=](const unsigned char &newValue) { issueCmdUniquePriority(cmdSetTPBFOuter, newValue);}
);
}
void wfmain::updateSizes(int tabIndex)
@ -965,6 +1002,10 @@ void wfmain::setUIToPrefs()
ui->wfthemeCombo->setCurrentIndex(ui->wfthemeCombo->findData(prefs.wftheme));
colorMap->setGradient(static_cast<QCPColorGradient::GradientPreset>(prefs.wftheme));
ui->useCIVasRigIDChk->blockSignals(true);
ui->useCIVasRigIDChk->setChecked(prefs.CIVisRadioModel);
ui->useCIVasRigIDChk->blockSignals(false);
}
void wfmain::setAudioDevicesUI()
@ -1026,6 +1067,35 @@ void wfmain::setAudioDevicesUI()
#elif defined(PORTAUDIO)
// Use PortAudio device enumeration
PaError err;
err = Pa_Initialize();
if (err != paNoError)
{
qInfo(logAudio()) << "ERROR: Cannot initialize Portaudio";
}
qInfo(logAudio()) << "PortAudio version: " << Pa_GetVersionInfo()->versionText;
int numDevices;
numDevices = Pa_GetDeviceCount();
qInfo(logAudio()) << "Pa_CountDevices returned" << numDevices;
const PaDeviceInfo* info;
for (int i = 0; i < numDevices; i++)
{
info = Pa_GetDeviceInfo(i);
if (info->maxInputChannels > 0) {
qInfo(logAudio()) << (i == Pa_GetDefaultInputDevice() ? "*" : " ") << "(" << i << ") Output Device : " << info->name;
ui->audioInputCombo->addItem(info->name, i);
}
if (info->maxOutputChannels > 0) {
qInfo(logAudio()) << (i == Pa_GetDefaultOutputDevice() ? "*" : " ") << "(" << i << ") Input Device : " << info->name;
ui->audioOutputCombo->addItem(info->name, i);
}
}
#else
#if QT_VERSION < 0x060000
@ -1251,6 +1321,7 @@ void wfmain::setDefPrefs()
defPrefs.wfInterpolate = true;
defPrefs.stylesheetPath = QString("qdarkstyle/style.qss");
defPrefs.radioCIVAddr = 0x00; // previously was 0x94 for 7300.
defPrefs.CIVisRadioModel = false;
defPrefs.serialPortRadio = QString("auto");
defPrefs.serialPortBaud = 115200;
defPrefs.enablePTT = false;
@ -1348,6 +1419,9 @@ void wfmain::loadSettings()
ui->rigCIVManualAddrChk->setChecked(false);
ui->rigCIVaddrHexLine->setEnabled(false);
}
prefs.CIVisRadioModel = (bool)settings->value("CIVisRadioModel", defPrefs.CIVisRadioModel).toBool();
prefs.serialPortRadio = settings->value("SerialPortRadio", defPrefs.serialPortRadio).toString();
int serialIndex = ui->serialDeviceListCombo->findText(prefs.serialPortRadio);
if (serialIndex != -1) {
@ -1489,6 +1563,7 @@ void wfmain::loadSettings()
#if defined(RTAUDIO)
rxSetup.port = ui->audioOutputCombo->itemData(audioOutputIndex).toInt();
#elif defined(PORTAUDIO)
rxSetup.port = ui->audioOutputCombo->itemData(audioOutputIndex).toInt();
#else
QVariant v = ui->audioOutputCombo->currentData();
rxSetup.port = v.value<QAudioDevice>();
@ -1505,6 +1580,7 @@ void wfmain::loadSettings()
#if defined(RTAUDIO)
txSetup.port = ui->audioInputCombo->itemData(audioInputIndex).toInt();
#elif defined(PORTAUDIO)
txSetup.port = ui->audioInputCombo->itemData(audioInputIndex).toInt();
#else
QVariant v = ui->audioInputCombo->currentData();
txSetup.port = v.value<QAudioDevice>();
@ -1604,6 +1680,7 @@ void wfmain::saveSettings()
// Radio and Comms: C-IV addr, port to use
settings->beginGroup("Radio");
settings->setValue("RigCIVuInt", prefs.radioCIVAddr);
settings->setValue("CIVisRadioModel", prefs.CIVisRadioModel);
settings->setValue("SerialPortRadio", prefs.serialPortRadio);
settings->setValue("SerialPortBaud", prefs.serialPortBaud);
settings->setValue("VirtualSerialPort", prefs.virtualSerialPort);
@ -2036,7 +2113,7 @@ void wfmain::shortcutMinus()
f.MHzDouble = f.Hz / (double)1E6;
setUIFreq();
//emit setFrequency(f);
//emit setFrequency(0,f);
issueCmd(cmdSetFreq, f);
issueDelayedCommandUnique(cmdGetFreq);
}
@ -2050,7 +2127,7 @@ void wfmain::shortcutPlus()
f.MHzDouble = f.Hz / (double)1E6;
setUIFreq();
//emit setFrequency(f);
//emit setFrequency(0,f);
issueCmd(cmdSetFreq, f);
issueDelayedCommandUnique(cmdGetFreq);
}
@ -2064,7 +2141,7 @@ void wfmain::shortcutShiftMinus()
f.MHzDouble = f.Hz / (double)1E6;
setUIFreq();
//emit setFrequency(f);
//emit setFrequency(0,f);
issueCmd(cmdSetFreq, f);
issueDelayedCommandUnique(cmdGetFreq);
}
@ -2078,7 +2155,7 @@ void wfmain::shortcutShiftPlus()
f.MHzDouble = f.Hz / (double)1E6;
setUIFreq();
//emit setFrequency(f);
//emit setFrequency(0,f);
issueCmd(cmdSetFreq, f);
issueDelayedCommandUnique(cmdGetFreq);
}
@ -2092,7 +2169,7 @@ void wfmain::shortcutControlMinus()
f.MHzDouble = f.Hz / (double)1E6;
setUIFreq();
//emit setFrequency(f);
//emit setFrequency(0,f);
issueCmd(cmdSetFreq, f);
issueDelayedCommandUnique(cmdGetFreq);
}
@ -2106,7 +2183,7 @@ void wfmain::shortcutControlPlus()
f.MHzDouble = f.Hz / (double)1E6;
setUIFreq();
//emit setFrequency(f);
//emit setFrequency(0,f);
issueCmd(cmdSetFreq, f);
issueDelayedCommandUnique(cmdGetFreq);
}
@ -2120,7 +2197,7 @@ void wfmain::shortcutPageUp()
f.MHzDouble = f.Hz / (double)1E6;
setUIFreq();
//emit setFrequency(f);
//emit setFrequency(0,f);
issueCmd(cmdSetFreq, f);
issueDelayedCommandUnique(cmdGetFreq);
}
@ -2134,7 +2211,7 @@ void wfmain::shortcutPageDown()
f.MHzDouble = f.Hz / (double)1E6;
setUIFreq();
//emit setFrequency(f);
//emit setFrequency(0,f);
issueCmd(cmdSetFreq, f);
issueDelayedCommandUnique(cmdGetFreq);
}
@ -2226,6 +2303,14 @@ void wfmain:: getInitialRigState()
issueDelayedCommand(cmdGetRitEnabled);
issueDelayedCommand(cmdGetRitValue);
if(rigCaps.hasIFShift)
issueDelayedCommand(cmdGetIFShift);
if(rigCaps.hasTBPF)
{
issueDelayedCommand(cmdGetTPBFInner);
issueDelayedCommand(cmdGetTPBFOuter);
}
if(rigCaps.hasSpectrum)
{
issueDelayedCommand(cmdGetSpectrumMode);
@ -2375,7 +2460,7 @@ void wfmain::doCmd(commandtype cmddata)
{
lastFreqCmdTime_ms = QDateTime::currentMSecsSinceEpoch();
freqt f = (*std::static_pointer_cast<freqt>(data));
emit setFrequency(f);
emit setFrequency(0,f);
break;
}
case cmdSetMode:
@ -2427,6 +2512,24 @@ void wfmain::doCmd(commandtype cmddata)
emit setSql(sqlLevel);
break;
}
case cmdSetIFShift:
{
unsigned char IFShiftLevel = (*std::static_pointer_cast<unsigned char>(data));
emit setIFShift(IFShiftLevel);
break;
}
case cmdSetTPBFInner:
{
unsigned char innterLevel = (*std::static_pointer_cast<unsigned char>(data));
emit setTPBFInner(innterLevel);
break;
}
case cmdSetTPBFOuter:
{
unsigned char outerLevel = (*std::static_pointer_cast<unsigned char>(data));
emit setTPBFOuter(outerLevel);
break;
}
case cmdSetPTT:
{
bool pttrequest = (*std::static_pointer_cast<bool>(data));
@ -2569,6 +2672,15 @@ void wfmain::doCmd(cmds cmd)
case cmdGetSql:
emit getSql();
break;
case cmdGetIFShift:
emit getIfShift();
break;
case cmdGetTPBFInner:
emit getTPBFInner();
break;
case cmdGetTPBFOuter:
emit getTPBFOuter();
break;
case cmdGetTxPower:
emit getTxPower();
break;
@ -2579,10 +2691,12 @@ void wfmain::doCmd(cmds cmd)
emit getSpectrumRefLevel();
break;
case cmdGetATUStatus:
emit getATUStatus();
if(rigCaps.hasATU)
emit getATUStatus();
break;
case cmdStartATU:
emit startATU();
if(rigCaps.hasATU)
emit startATU();
break;
case cmdGetAttenuator:
emit getAttenuator();
@ -2600,10 +2714,7 @@ void wfmain::doCmd(cmds cmd)
emit setScopeMode(spectModeFixed);
break;
case cmdGetPTT:
if(rigCaps.hasPTTCommand)
{
emit getPTT();
}
emit getPTT();
break;
case cmdGetTxRxMeter:
if(amTransmitting)
@ -2894,6 +3005,7 @@ void wfmain::receiveRigID(rigCapabilities rigCaps)
// Added so that server receives rig capabilities.
emit sendRigCaps(rigCaps);
rpt->setRig(rigCaps);
trxadj->setRig(rigCaps);
// Set the mode combo box up:
@ -3015,6 +3127,7 @@ void wfmain::receiveRigID(rigCapabilities rigCaps)
setBandButtons();
ui->tuneEnableChk->setEnabled(rigCaps.hasATU);
ui->tuneNowBtn->setEnabled(rigCaps.hasATU);
@ -3057,15 +3170,20 @@ void wfmain::initPeriodicCommands()
insertSlowPeriodicCommand(cmdGetFreq, 128);
insertSlowPeriodicCommand(cmdGetMode, 128);
insertSlowPeriodicCommand(cmdGetPTT, 128);
if(rigCaps.hasTransmit)
insertSlowPeriodicCommand(cmdGetPTT, 128);
insertSlowPeriodicCommand(cmdGetTxPower, 128);
insertSlowPeriodicCommand(cmdGetRxGain, 128);
insertSlowPeriodicCommand(cmdGetAttenuator, 128);
insertSlowPeriodicCommand(cmdGetPTT, 128);
insertSlowPeriodicCommand(cmdGetPreamp, 128);
if(rigCaps.hasAttenuator)
insertSlowPeriodicCommand(cmdGetAttenuator, 128);
if(rigCaps.hasTransmit)
insertSlowPeriodicCommand(cmdGetPTT, 128);
if(rigCaps.hasPreamp)
insertSlowPeriodicCommand(cmdGetPreamp, 128);
if (rigCaps.hasRXAntenna) {
insertSlowPeriodicCommand(cmdGetAntenna, 128);
}
insertSlowPeriodicCommand(cmdGetDuplexMode, 128);
}
void wfmain::insertPeriodicCommand(cmds cmd, unsigned char priority)
@ -3286,7 +3404,7 @@ void wfmain::handlePlotDoubleClick(QMouseEvent *me)
freqGo.Hz = roundFrequency(freqGo.Hz, tsWfScrollHz);
freqGo.MHzDouble = (float)freqGo.Hz / 1E6;
//emit setFrequency(freq);
//emit setFrequency(0,freq);
issueCmd(cmdSetFreq, freqGo);
freq = freqGo;
setUIFreq();
@ -3311,7 +3429,7 @@ void wfmain::handleWFDoubleClick(QMouseEvent *me)
freqGo.Hz = roundFrequency(freqGo.Hz, tsWfScrollHz);
freqGo.MHzDouble = (float)freqGo.Hz / 1E6;
//emit setFrequency(freq);
//emit setFrequency(0,freq);
issueCmd(cmdSetFreq, freqGo);
freq = freqGo;
setUIFreq();
@ -3366,7 +3484,7 @@ void wfmain::handleWFScroll(QWheelEvent *we)
f.MHzDouble = f.Hz / (double)1E6;
freq = f;
//emit setFrequency(f);
//emit setFrequency(0,f);
issueCmdUniquePriority(cmdSetFreq, f);
ui->freqLabel->setText(QString("%1").arg(f.MHzDouble, 0, 'f'));
//issueDelayedCommandUnique(cmdGetFreq);
@ -3783,7 +3901,7 @@ void wfmain::on_freqDial_valueChanged(int value)
ui->freqLabel->setText(QString("%1").arg(f.MHzDouble, 0, 'f'));
//emit setFrequency(f);
//emit setFrequency(0,f);
issueCmdUniquePriority(cmdSetFreq, f);
} else {
ui->freqDial->blockSignals(true);
@ -3798,7 +3916,7 @@ void wfmain::receiveBandStackReg(freqt freqGo, char mode, char filter, bool data
// read the band stack and apply by sending out commands
qInfo(logSystem()) << __func__ << "BSR received into main: Freq: " << freqGo.Hz << ", mode: " << (unsigned int)mode << ", filter: " << (unsigned int)filter << ", data mode: " << dataOn;
//emit setFrequency(freq);
//emit setFrequency(0,freq);
issueCmd(cmdSetFreq, freqGo);
setModeVal = (unsigned char) mode;
setFilterVal = (unsigned char) filter;
@ -3868,7 +3986,7 @@ void wfmain::on_band4mbtn_clicked()
f.Hz = (70.200) * 1E6;
}
issueCmd(cmdSetFreq, f);
//emit setFrequency(f);
//emit setFrequency(0,f);
issueDelayedCommandUnique(cmdGetFreq);
ui->tabWidget->setCurrentIndex(0);
}
@ -3935,7 +4053,7 @@ void wfmain::on_band60mbtn_clicked()
freqt f;
f.Hz = (5.3305) * 1E6;
issueCmd(cmdSetFreq, f);
//emit setFrequency(f);
//emit setFrequency(0,f);
issueDelayedCommandUnique(cmdGetFreq);
ui->tabWidget->setCurrentIndex(0);
}
@ -3956,7 +4074,7 @@ void wfmain::on_band630mbtn_clicked()
{
freqt f;
f.Hz = 475 * 1E3;
//emit setFrequency(f);
//emit setFrequency(0,f);
issueCmd(cmdSetFreq, f);
issueDelayedCommandUnique(cmdGetFreq);
ui->tabWidget->setCurrentIndex(0);
@ -3966,7 +4084,7 @@ void wfmain::on_band2200mbtn_clicked()
{
freqt f;
f.Hz = 136 * 1E3;
//emit setFrequency(f);
//emit setFrequency(0,f);
issueCmd(cmdSetFreq, f);
issueDelayedCommandUnique(cmdGetFreq);
ui->tabWidget->setCurrentIndex(0);
@ -4076,6 +4194,21 @@ void wfmain::receiveSql(unsigned char level)
ui->sqlSlider->setValue(level);
}
void wfmain::receiveIFShift(unsigned char level)
{
trxadj->updateIFShift(level);
}
void wfmain::receiveTBPFInner(unsigned char level)
{
trxadj->updateTPBFInner(level);
}
void wfmain::receiveTBPFOuter(unsigned char level)
{
trxadj->updateTPBFOuter(level);
}
void wfmain::on_tuneNowBtn_clicked()
{
issueDelayedCommand(cmdStartATU);
@ -4245,6 +4378,7 @@ void wfmain::on_audioOutputCombo_currentIndexChanged(int value)
#if defined(RTAUDIO)
rxSetup.port = ui->audioOutputCombo->itemData(value).toInt();
#elif defined(PORTAUDIO)
rxSetup.port = ui->audioOutputCombo->itemData(value).toInt();
#else
QVariant v = ui->audioOutputCombo->itemData(value);
rxSetup.port = v.value<QAudioDevice>();
@ -4258,6 +4392,7 @@ void wfmain::on_audioInputCombo_currentIndexChanged(int value)
#if defined(RTAUDIO)
txSetup.port = ui->audioInputCombo->itemData(value).toInt();
#elif defined(PORTAUDIO)
txSetup.port = ui->audioInputCombo->itemData(value).toInt();
#else
QVariant v = ui->audioInputCombo->itemData(value);
txSetup.port = v.value<QAudioDevice>();
@ -4337,6 +4472,20 @@ void wfmain::on_sqlSlider_valueChanged(int value)
issueCmd(cmdSetSql, (unsigned char)value);
//emit setSql((unsigned char)value);
}
// These three are from the transceiver adjustment window:
void wfmain::changeIFShift(unsigned char level)
{
//issueCmd(cmdSetIFShift, level);
issueCmdUniquePriority(cmdSetIFShift, level);
}
void wfmain::changeTPBFInner(unsigned char level)
{
issueCmdUniquePriority(cmdSetTPBFInner, level);
}
void wfmain::changeTPBFOuter(unsigned char level)
{
issueCmdUniquePriority(cmdSetTPBFOuter, level);
}
void wfmain::on_modeFilterCombo_activated(int index)
{
@ -5321,7 +5470,7 @@ void wfmain::on_enableRigctldChk_clicked(bool checked)
if (rig != Q_NULLPTR) {
// We are already connected to a rig.
connect(rig, SIGNAL(stateInfo(rigStateStruct*)), rigCtl, SLOT(receiveStateInfo(rigStateStruct*)));
connect(rigCtl, SIGNAL(setFrequency(freqt)), rig, SLOT(setFrequency(freqt)));
connect(rigCtl, SIGNAL(setFrequency(unsigned char, freqt)), rig, SLOT(setFrequency(unsigned char, freqt)));
connect(rigCtl, SIGNAL(setMode(unsigned char, unsigned char)), rig, SLOT(setMode(unsigned char, unsigned char)));
connect(rigCtl, SIGNAL(setDataMode(bool, unsigned char)), rig, SLOT(setDataMode(bool, unsigned char)));
connect(rigCtl, SIGNAL(setPTT(bool)), rig, SLOT(setPTT(bool)));
@ -5361,10 +5510,22 @@ void wfmain::on_rigctldPortTxt_editingFinished()
}
}
void wfmain::on_moreControlsBtn_clicked()
{
trxadj->show();
}
void wfmain::on_useCIVasRigIDChk_clicked(bool checked)
{
prefs.CIVisRadioModel = checked;
}
// --- DEBUG FUNCTION ---
void wfmain::on_debugBtn_clicked()
{
qInfo(logSystem()) << "Debug button pressed.";
// issueDelayedCommand(cmdGetRigID);
emit getRigCIV();
//trxadj->show();
//setRadioTimeDatePrep();
//wf->setInteraction(QCP::iRangeZoom, true);

Wyświetl plik

@ -51,6 +51,7 @@ public:
signals:
// Basic to rig:
void setCIVAddr(unsigned char newRigCIVAddr);
void setRigID(unsigned char rigID);
// Power
void sendPowerOn();
@ -58,7 +59,7 @@ signals:
// Frequency, mode, band:
void getFrequency();
void setFrequency(freqt freq);
void setFrequency(unsigned char vfo, freqt freq);
void getMode();
void setMode(unsigned char modeIndex, unsigned char modeFilter);
void setMode(mode_info);
@ -85,6 +86,9 @@ signals:
void getRfGain();
void getAfGain();
void getSql();
void getIfShift();
void getTPBFInner();
void getTPBFOuter();
void getTxPower();
void getMicGain();
void getSpectrumRefLevel();
@ -94,6 +98,13 @@ signals:
void setRfGain(unsigned char level);
void setAfGain(unsigned char level);
void setSql(unsigned char level);
void setIFShift(unsigned char level);
void setTPBFInner(unsigned char level);
void setTPBFOuter(unsigned char level);
void setIFShiftWindow(unsigned char level);
void setTPBFInnerWindow(unsigned char level);
void setTPBFOuterWindow(unsigned char level);
void setMicGain(unsigned char);
void setCompLevel(unsigned char);
void setTxPower(unsigned char);
@ -213,6 +224,13 @@ private slots:
void receiveRfGain(unsigned char level);
void receiveAfGain(unsigned char level);
void receiveSql(unsigned char level);
void receiveIFShift(unsigned char level);
void receiveTBPFInner(unsigned char level);
void receiveTBPFOuter(unsigned char level);
// 'change' from data in transceiver controls window:
void changeIFShift(unsigned char level);
void changeTPBFInner(unsigned char level);
void changeTPBFOuter(unsigned char level);
void receiveTxPower(unsigned char power);
void receiveMicGain(unsigned char gain);
void receiveCompLevel(unsigned char compLevel);
@ -479,6 +497,10 @@ private slots:
void setAudioDevicesUI();
void on_moreControlsBtn_clicked();
void on_useCIVasRigIDChk_clicked(bool checked);
private:
Ui::wfmain *ui;
void closeEvent(QCloseEvent *event);
@ -600,13 +622,18 @@ private:
unsigned char setModeVal=0;
unsigned char setFilterVal=0;
enum cmds {cmdNone, cmdGetRigID, cmdGetRigCIV, cmdGetFreq, cmdSetFreq, cmdGetMode, cmdSetMode, cmdGetDataMode, cmdSetModeFilter,
cmdSetDataModeOn, cmdSetDataModeOff, cmdGetRitEnabled, cmdGetRitValue,
enum cmds {cmdNone, cmdGetRigID, cmdGetRigCIV, cmdGetFreq, cmdSetFreq, cmdGetMode, cmdSetMode,
cmdGetDataMode, cmdSetModeFilter, cmdSetDataModeOn, cmdSetDataModeOff, cmdGetRitEnabled, cmdGetRitValue,
cmdSpecOn, cmdSpecOff, cmdDispEnable, cmdDispDisable, cmdGetRxGain, cmdSetRxRfGain, cmdGetAfGain, cmdSetAfGain,
cmdGetSql, cmdSetSql, cmdGetATUStatus, cmdSetATU, cmdStartATU, cmdGetSpectrumMode, cmdGetSpectrumSpan, cmdScopeCenterMode, cmdScopeFixedMode, cmdGetPTT, cmdSetPTT,
cmdGetTxPower, cmdSetTxPower, cmdGetMicGain, cmdSetMicGain, cmdSetModLevel, cmdGetSpectrumRefLevel, cmdGetDuplexMode, cmdGetModInput, cmdGetModDataInput,
cmdGetSql, cmdSetSql, cmdGetIFShift, cmdSetIFShift, cmdGetTPBFInner, cmdSetTPBFInner,
cmdGetTPBFOuter, cmdSetTPBFOuter, cmdGetATUStatus,
cmdSetATU, cmdStartATU, cmdGetSpectrumMode,
cmdGetSpectrumSpan, cmdScopeCenterMode, cmdScopeFixedMode, cmdGetPTT, cmdSetPTT,
cmdGetTxPower, cmdSetTxPower, cmdGetMicGain, cmdSetMicGain, cmdSetModLevel,
cmdGetSpectrumRefLevel, cmdGetDuplexMode, cmdGetModInput, cmdGetModDataInput,
cmdGetCurrentModLevel, cmdStartRegularPolling, cmdStopRegularPolling, cmdQueNormalSpeed,
cmdGetVdMeter, cmdGetIdMeter, cmdGetSMeter, cmdGetCenterMeter, cmdGetPowerMeter, cmdGetSWRMeter, cmdGetALCMeter, cmdGetCompMeter, cmdGetTxRxMeter,
cmdGetVdMeter, cmdGetIdMeter, cmdGetSMeter, cmdGetCenterMeter, cmdGetPowerMeter,
cmdGetSWRMeter, cmdGetALCMeter, cmdGetCompMeter, cmdGetTxRxMeter,
cmdGetTone, cmdGetTSQL, cmdGetDTCS, cmdGetRptAccessMode, cmdGetPreamp, cmdGetAttenuator, cmdGetAntenna,
cmdSetTime, cmdSetDate, cmdSetUTCOffset};
@ -690,6 +717,7 @@ private:
bool wfInterpolate;
QString stylesheetPath;
unsigned char radioCIVAddr;
bool CIVisRadioModel;
QString serialPortRadio;
quint32 serialPortBaud;
bool enablePTT;

Wyświetl plik

@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>934</width>
<width>946</width>
<height>582</height>
</rect>
</property>
@ -465,6 +465,16 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="moreControlsBtn">
<property name="toolTip">
<string>Show additional controls</string>
</property>
<property name="text">
<string>Show More</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
@ -852,6 +862,9 @@
<height>50</height>
</size>
</property>
<property name="toolTip">
<string>Transmit and Receive button</string>
</property>
<property name="text">
<string>Transmit</string>
</property>
@ -885,6 +898,9 @@
</item>
<item>
<widget class="QPushButton" name="rptSetupBtn">
<property name="toolTip">
<string>Show the repeater tone and offset window</string>
</property>
<property name="text">
<string>Repeater</string>
</property>
@ -2357,6 +2373,16 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="useCIVasRigIDChk">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Only check for older radios!&lt;/p&gt;&lt;p&gt;This checkbox forces wfview to trust that the CI-V address is also the model number of the radio. This is only useful for older radios that do not reply to our Rig ID requests (0x19 0x00). Do not check this box unless you have an older radio. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Use as Model too</string>
</property>
</widget>
</item>
<item>
<spacer name="tuneSpacer">
<property name="orientation">
@ -2814,8 +2840,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>934</width>
<height>21</height>
<width>946</width>
<height>22</height>
</rect>
</property>
</widget>

Wyświetl plik

@ -34,6 +34,7 @@ DEFINES += QCUSTOMPLOT_COMPILE_LIBRARY
# These defines are used for the resampler
equals(QT_ARCH, i386): DEFINES += USE_SSE
equals(QT_ARCH, i386): DEFINES += USE_SSE2
equals(QT_ARCH, arm): DEFINES += USE_NEON
DEFINES += OUTSIDE_SPEEX
DEFINES += RANDOM_PREFIX=wf
@ -48,13 +49,29 @@ DEFINES += PREFIX=\\\"$$PREFIX\\\"
# DEFINES += RTAUDIO
# DEFINES += PORTAUDIO
# RTAudio defines
win32:DEFINES += __WINDOWS_WASAPI__
#win32:DEFINES += __WINDOWS_DS__ # Requires DirectSound libraries
linux:DEFINES += __LINUX_ALSA__
#linux:DEFINES += __LINUX_OSS__
#linux:DEFINES += __LINUX_PULSE__
macx:DEFINES += __MACOSX_CORE__
contains(DEFINES, RTAUDIO) {
# RTAudio defines
win32:DEFINES += __WINDOWS_WASAPI__
#win32:DEFINES += __WINDOWS_DS__ # Requires DirectSound libraries
linux:DEFINES += __LINUX_ALSA__
#linux:DEFINES += __LINUX_OSS__
#linux:DEFINES += __LINUX_PULSE__
macx:DEFINES += __MACOSX_CORE__
win32:SOURCES += ../rtaudio/RTAudio.cpp
win32:HEADERS += ../rtaudio/RTAUdio.h
!linux:INCLUDEPATH += ../rtaudio
linux:LIBS += -lpulse -lpulse-simple -lrtaudio -lpthread
}
contains(DEFINES, PORTAUDIO) {
CONFIG(debug, release|debug) {
win32:LIBS += -L../portaudio/msvc/Win32/Debug/ -lportaudio_x86
} else {
win32:LIBS += -L../portaudio/msvc/Win32/Release/ -lportaudio_x86
}
win32:INCLUDEPATH += ../portaudio/include
!win32:LIBS += -lportaudio
}
macx:INCLUDEPATH += /usr/local/include /opt/local/include
macx:LIBS += -L/usr/local/lib -L/opt/local/lib
@ -111,12 +128,9 @@ CONFIG(debug, release|debug) {
win32:LIBS += -L../opus/win32/VS2015/x64/Release/ -lopus
}
#linux:LIBS += -L./ -l$$QCPLIB -lpulse -lpulse-simple -lpthread
linux:LIBS += -L./ -l$$QCPLIB -lopus
macx:LIBS += -framework CoreAudio -framework CoreFoundation -lpthread -lopus
macx:LIBS += -framework CoreAudio -framework CoreFoundation -lpthread -lopus
#win32:SOURCES += rtaudio/RTAudio.cpp
#win32:HEADERS += rtaudio/RTAUdio.h
!linux:SOURCES += ../qcustomplot/qcustomplot.cpp
!linux:HEADERS += ../qcustomplot/qcustomplot.h
!linux:INCLUDEPATH += ../qcustomplot
@ -124,7 +138,6 @@ macx:LIBS += -framework CoreAudio -framework CoreFoundation -lpthread -lopus
!linux:INCLUDEPATH += ../opus/include
INCLUDEPATH += resampler
!linux:INCLUDEPATH += rtaudio
SOURCES += main.cpp\
wfmain.cpp \

Wyświetl plik

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|x64">
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
@ -18,7 +18,7 @@
<WindowsTargetPlatformMinVersion>10.0.19041.0</WindowsTargetPlatformMinVersion>
<QtMsBuild Condition="'$(QtMsBuild)'=='' or !Exists('$(QtMsBuild)\qt.targets')">$(MSBuildProjectDirectory)\QtMsBuild</QtMsBuild></PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<PlatformToolset>v142</PlatformToolset>
<OutputDirectory>release\</OutputDirectory>
<ATLMinimizesCRunTimeLibraryUsage>false</ATLMinimizesCRunTimeLibraryUsage>
@ -27,7 +27,7 @@
<IntermediateDirectory>release\</IntermediateDirectory>
<PrimaryOutput>wfview</PrimaryOutput>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<PlatformToolset>v142</PlatformToolset>
<OutputDirectory>debug\</OutputDirectory>
<ATLMinimizesCRunTimeLibraryUsage>false</ATLMinimizesCRunTimeLibraryUsage>
@ -38,27 +38,26 @@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /><Target Name="QtMsBuildNotFound" BeforeTargets="CustomBuild;ClCompile" Condition="!Exists('$(QtMsBuild)\qt.targets') or !Exists('$(QtMsBuild)\qt.props')"><Message Importance="High" Text="QtMsBuild: could not locate qt.targets, qt.props; project may not build correctly." /></Target>
<ImportGroup Label="ExtensionSettings" />
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<PropertyGroup Label="UserMacros" /><ImportGroup Condition="Exists('$(QtMsBuild)\qt_defaults.props')"><Import Project="$(QtMsBuild)\qt_defaults.props" /></ImportGroup><PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"><OutDir>debug\</OutDir><IntDir>debug\</IntDir><TargetName>wfview</TargetName><IgnoreImportLibrary>true</IgnoreImportLibrary></PropertyGroup><PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"><OutDir>release\</OutDir><IntDir>release\</IntDir><TargetName>wfview</TargetName><IgnoreImportLibrary>true</IgnoreImportLibrary><LinkIncremental>false</LinkIncremental></PropertyGroup><PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"><QtInstall>msvc2019_64_v62</QtInstall><QtModules>core;network;gui;multimedia;widgets;serialport;printsupport</QtModules></PropertyGroup><PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"><QtInstall>msvc2019_64_v62</QtInstall><QtModules>core;network;gui;multimedia;widgets;serialport;printsupport</QtModules></PropertyGroup><ImportGroup Condition="Exists('$(QtMsBuild)\qt.props')"><Import Project="$(QtMsBuild)\qt.props" /></ImportGroup>
<PropertyGroup Label="UserMacros" /><ImportGroup Condition="Exists('$(QtMsBuild)\qt_defaults.props')"><Import Project="$(QtMsBuild)\qt_defaults.props" /></ImportGroup><PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"><OutDir>debug\</OutDir><IntDir>debug\</IntDir><TargetName>wfview</TargetName><IgnoreImportLibrary>true</IgnoreImportLibrary></PropertyGroup><PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"><OutDir>release\</OutDir><IntDir>release\</IntDir><TargetName>wfview</TargetName><IgnoreImportLibrary>true</IgnoreImportLibrary><LinkIncremental>false</LinkIncremental></PropertyGroup><PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"><QtInstall>msvc2019</QtInstall><QtModules>core;network;gui;multimedia;widgets;serialport;printsupport</QtModules></PropertyGroup><PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"><QtInstall>msvc2019</QtInstall><QtModules>core;network;gui;multimedia;widgets;serialport;printsupport</QtModules></PropertyGroup><ImportGroup Condition="Exists('$(QtMsBuild)\qt.props')"><Import Project="$(QtMsBuild)\qt.props" /></ImportGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>.;..\qcustomplot;..\opus\include;resampler;rtaudio;release;/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -permissive- -Zc:__cplusplus -Zc:externConstexpr -utf-8 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions>-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 %(AdditionalOptions)</AdditionalOptions>
<AssemblerListingLocation>release\</AssemblerListingLocation>
<BrowseInformation>false</BrowseInformation>
<DebugInformationFormat>None</DebugInformationFormat>
<DisableSpecificWarnings>4577;4467;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<ExceptionHandling>Sync</ExceptionHandling>
<LanguageStandard>stdcpp17</LanguageStandard>
<ObjectFileName>release\</ObjectFileName>
<Optimization>MaxSpeed</Optimization>
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;WIN64;QT_DEPRECATED_WARNINGS;QCUSTOMPLOT_COMPILE_LIBRARY;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;PREFIX="/usr/local";__WINDOWS_WASAPI__;GITSHORT="edef09c";HOST="wfview.org";UNAME="build";NDEBUG;QT_NO_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;QT_DEPRECATED_WARNINGS;QCUSTOMPLOT_COMPILE_LIBRARY;USE_SSE;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;PREFIX="/usr/local";__WINDOWS_WASAPI__;GITSHORT="66912e1";HOST="wfview.org";UNAME="build";NDEBUG;QT_NO_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessToFile>false</PreprocessToFile>
<ProgramDataBaseFileName></ProgramDataBaseFileName>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@ -67,11 +66,10 @@
<WarningLevel>Level3</WarningLevel>
<MultiProcessorCompilation>true</MultiProcessorCompilation></ClCompile>
<Link>
<AdditionalDependencies>..\opus\win32\VS2015\x64\Release\opus.lib;$(QTDIR)\lib\Qt6Multimedia.lib;$(QTDIR)\lib\Qt6PrintSupport.lib;$(QTDIR)\lib\Qt6Widgets.lib;$(QTDIR)\lib\Qt6Gui.lib;$(QTDIR)\lib\Qt6SerialPort.lib;$(QTDIR)\lib\Qt6Network.lib;$(QTDIR)\lib\Qt6Core.lib;$(QTDIR)\lib\Qt6EntryPoint.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\opus\win32\VS2015\x64\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>..\opus\win32\VS2015\Win32\Release\opus.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\opus\win32\VS2015\Win32\Release;C:\opensslx86\lib;C:\Utils\my_sql\mysql-5.7.25-win32\lib;C:\Utils\postgresqlx86\pgsql\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>"/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" %(AdditionalOptions)</AdditionalOptions>
<DataExecutionPrevention>true</DataExecutionPrevention>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>false</GenerateDebugInformation>
<IgnoreImportLibrary>true</IgnoreImportLibrary>
<LinkIncremental>false</LinkIncremental>
@ -87,22 +85,21 @@
<WarningLevel>0</WarningLevel>
</Midl>
<ResourceCompile>
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;WIN64;QT_DEPRECATED_WARNINGS;QCUSTOMPLOT_COMPILE_LIBRARY;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;PREFIX=\"/usr/local\";__WINDOWS_WASAPI__;GITSHORT=\"edef09c\";HOST=\"wfview.org\";UNAME=\"build\";NDEBUG;QT_NO_DEBUG;QT_MULTIMEDIA_LIB;QT_PRINTSUPPORT_LIB;QT_WIDGETS_LIB;QT_GUI_LIB;QT_SERIALPORT_LIB;QT_NETWORK_LIB;QT_CORE_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;QT_DEPRECATED_WARNINGS;QCUSTOMPLOT_COMPILE_LIBRARY;USE_SSE;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;PREFIX=\"/usr/local\";__WINDOWS_WASAPI__;GITSHORT=\"66912e1\";HOST=\"wfview.org\";UNAME=\"build\";NDEBUG;QT_NO_DEBUG;QT_MULTIMEDIA_LIB;QT_PRINTSUPPORT_LIB;QT_WIDGETS_LIB;QT_GUI_LIB;QT_SERIALPORT_LIB;QT_NETWORK_LIB;QT_CORE_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<QtMoc><CompilerFlavor>msvc</CompilerFlavor><Include>./$(Configuration)/moc_predefs.h</Include><ExecutionDescription>Moc'ing %(Identity)...</ExecutionDescription><DynamicSource>output</DynamicSource><QtMocDir>$(Configuration)</QtMocDir><QtMocFileName>moc_%(Filename).cpp</QtMocFileName></QtMoc><QtRcc><Compression>default</Compression><ExecutionDescription>Rcc'ing %(Identity)...</ExecutionDescription><QtRccDir>$(Configuration)</QtRccDir><QtRccFileName>qrc_%(Filename).cpp</QtRccFileName></QtRcc><QtUic><ExecutionDescription>Uic'ing %(Identity)...</ExecutionDescription><QtUicDir>$(ProjectDir)</QtUicDir><QtUicFileName>ui_%(Filename).h</QtUicFileName></QtUic></ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>.;..\qcustomplot;..\opus\include;resampler;rtaudio;debug;/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -permissive- -Zc:__cplusplus -Zc:externConstexpr -utf-8 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions>-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 %(AdditionalOptions)</AdditionalOptions>
<AssemblerListingLocation>debug\</AssemblerListingLocation>
<BrowseInformation>false</BrowseInformation>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4577;4467;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<ExceptionHandling>Sync</ExceptionHandling>
<LanguageStandard>stdcpp17</LanguageStandard>
<ObjectFileName>debug\</ObjectFileName>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;WIN64;QT_DEPRECATED_WARNINGS;QCUSTOMPLOT_COMPILE_LIBRARY;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;PREFIX="/usr/local";__WINDOWS_WASAPI__;GITSHORT="edef09c";HOST="wfview.org";UNAME="build";%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;QT_DEPRECATED_WARNINGS;QCUSTOMPLOT_COMPILE_LIBRARY;USE_SSE;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;PREFIX="/usr/local";__WINDOWS_WASAPI__;GITSHORT="66912e1";HOST="wfview.org";UNAME="build";%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessToFile>false</PreprocessToFile>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<SuppressStartupBanner>true</SuppressStartupBanner>
@ -110,8 +107,8 @@
<WarningLevel>Level3</WarningLevel>
<MultiProcessorCompilation>true</MultiProcessorCompilation></ClCompile>
<Link>
<AdditionalDependencies>..\opus\win32\VS2015\x64\Debug\opus.lib;$(QTDIR)\lib\Qt6Multimediad.lib;$(QTDIR)\lib\Qt6PrintSupportd.lib;$(QTDIR)\lib\Qt6Widgetsd.lib;$(QTDIR)\lib\Qt6Guid.lib;$(QTDIR)\lib\Qt6SerialPortd.lib;$(QTDIR)\lib\Qt6Networkd.lib;$(QTDIR)\lib\Qt6Cored.lib;$(QTDIR)\lib\Qt6EntryPointd.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\opus\win32\VS2015\x64\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>..\opus\win32\VS2015\Win32\Debug\opus.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\opus\win32\VS2015\Win32\Debug;C:\opensslx86\lib;C:\Utils\my_sql\mysql-5.7.25-win32\lib;C:\Utils\postgresqlx86\pgsql\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>"/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" %(AdditionalOptions)</AdditionalOptions>
<DataExecutionPrevention>true</DataExecutionPrevention>
<GenerateDebugInformation>true</GenerateDebugInformation>
@ -127,7 +124,7 @@
<WarningLevel>0</WarningLevel>
</Midl>
<ResourceCompile>
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;WIN64;QT_DEPRECATED_WARNINGS;QCUSTOMPLOT_COMPILE_LIBRARY;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;PREFIX=\"/usr/local\";__WINDOWS_WASAPI__;GITSHORT=\"edef09c\";HOST=\"wfview.org\";UNAME=\"build\";QT_MULTIMEDIA_LIB;QT_PRINTSUPPORT_LIB;QT_WIDGETS_LIB;QT_GUI_LIB;QT_SERIALPORT_LIB;QT_NETWORK_LIB;QT_CORE_LIB;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;QT_DEPRECATED_WARNINGS;QCUSTOMPLOT_COMPILE_LIBRARY;USE_SSE;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;PREFIX=\"/usr/local\";__WINDOWS_WASAPI__;GITSHORT=\"66912e1\";HOST=\"wfview.org\";UNAME=\"build\";QT_MULTIMEDIA_LIB;QT_PRINTSUPPORT_LIB;QT_WIDGETS_LIB;QT_GUI_LIB;QT_SERIALPORT_LIB;QT_NETWORK_LIB;QT_CORE_LIB;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<QtMoc><CompilerFlavor>msvc</CompilerFlavor><Include>./$(Configuration)/moc_predefs.h</Include><ExecutionDescription>Moc'ing %(Identity)...</ExecutionDescription><DynamicSource>output</DynamicSource><QtMocDir>$(Configuration)</QtMocDir><QtMocFileName>moc_%(Filename).cpp</QtMocFileName></QtMoc><QtRcc><Compression>default</Compression><ExecutionDescription>Rcc'ing %(Identity)...</ExecutionDescription><QtRccDir>$(Configuration)</QtRccDir><QtRccFileName>qrc_%(Filename).cpp</QtRccFileName></QtRcc><QtUic><ExecutionDescription>Uic'ing %(Identity)...</ExecutionDescription><QtUicDir>$(ProjectDir)</QtUicDir><QtUicFileName>ui_%(Filename).h</QtUicFileName></QtUic></ItemDefinitionGroup>
<ItemGroup>
@ -351,19 +348,19 @@
<CustomBuild Include="debug\moc_predefs.h.cbt">
<FileType>Document</FileType>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(QTDIR)\mkspecs\features\data\dummy.cpp;%(AdditionalInputs)</AdditionalInputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">cl -Bx"$(QTDIR)\bin\qmake.exe" -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -permissive- -Zc:__cplusplus -Zc:externConstexpr -faligned-new -Zi -MDd -std:c++17 -utf-8 -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -E $(QTDIR)\mkspecs\features\data\dummy.cpp 2&gt;NUL &gt;debug\moc_predefs.h</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Generate moc_predefs.h</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">debug\moc_predefs.h;%(Outputs)</Outputs>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(QTDIR)\mkspecs\features\data\dummy.cpp;%(AdditionalInputs)</AdditionalInputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">cl -Bx"$(QTDIR)\bin\qmake.exe" -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -faligned-new -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -E $(QTDIR)\mkspecs\features\data\dummy.cpp 2&gt;NUL &gt;debug\moc_predefs.h</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Generate moc_predefs.h</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">debug\moc_predefs.h;%(Outputs)</Outputs>
</CustomBuild>
<CustomBuild Include="release\moc_predefs.h.cbt">
<FileType>Document</FileType>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(QTDIR)\mkspecs\features\data\dummy.cpp;%(AdditionalInputs)</AdditionalInputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">cl -Bx"$(QTDIR)\bin\qmake.exe" -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -permissive- -Zc:__cplusplus -Zc:externConstexpr -fvisibility=hidden -fvisibility-inlines-hidden -faligned-new -O2 -MD -std:c++17 -utf-8 -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -E $(QTDIR)\mkspecs\features\data\dummy.cpp 2&gt;NUL &gt;release\moc_predefs.h</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Generate moc_predefs.h</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">release\moc_predefs.h;%(Outputs)</Outputs>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(QTDIR)\mkspecs\features\data\dummy.cpp;%(AdditionalInputs)</AdditionalInputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">cl -Bx"$(QTDIR)\bin\qmake.exe" -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -fvisibility=hidden -fvisibility-inlines-hidden -faligned-new -O2 -MD -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -E $(QTDIR)\mkspecs\features\data\dummy.cpp 2&gt;NUL &gt;release\moc_predefs.h</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Generate moc_predefs.h</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">release\moc_predefs.h;%(Outputs)</Outputs>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
</CustomBuild>
@ -520,7 +517,7 @@
<InitFuncName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">resources</InitFuncName><InitFuncName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">resources</InitFuncName></QtRcc>
<InitFuncName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">resources</InitFuncName><InitFuncName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">resources</InitFuncName></QtRcc>
<None Include="qdarkstyle\rc\right_arrow.png" />
<None Include="qdarkstyle\rc\right_arrow_disabled.png" />
<None Include="qdarkstyle\rc\sizegrip.png" />
@ -534,7 +531,7 @@
<InitFuncName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">style</InitFuncName><InitFuncName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">style</InitFuncName></QtRcc>
<InitFuncName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">style</InitFuncName><InitFuncName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">style</InitFuncName></QtRcc>
<None Include="qdarkstyle\style.qss" />
<None Include="qdarkstyle\rc\stylesheet-branch-end.png" />
<None Include="qdarkstyle\rc\stylesheet-branch-more.png" />