1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-22 08:04:49 -05:00

Audio CAT SISO: full implementation

This commit is contained in:
f4exb 2023-06-12 02:09:35 +02:00
parent de79baa0a9
commit ecc08f8337
17 changed files with 1342 additions and 1244 deletions

View File

@ -21,6 +21,7 @@
#include "dsp/samplemofifo.h"
#include "dsp/samplesourcefifo.h"
#include "audio/audiofifo.h"
#include "util/db.h"
#include "audiocatoutputworker.h"
@ -30,6 +31,7 @@ AudioCATOutputWorker::AudioCATOutputWorker(SampleMOFifo* sampleFifo, AudioFifo *
QObject(parent),
m_running(false),
m_samplerate(0),
m_volume(1.0f),
m_throttlems(AUDIOOUTPUT_THROTTLE_MS),
m_maxThrottlems(50),
m_throttleToggle(false),
@ -39,8 +41,9 @@ AudioCATOutputWorker::AudioCATOutputWorker(SampleMOFifo* sampleFifo, AudioFifo *
m_sampleFifo(sampleFifo),
m_audioFifo(fifo)
{
m_audioBuffer.resize(1<<14);
m_audioBuffer.resize(1<<15);
m_audioBufferFill = 0;
setSamplerate(48000);
}
AudioCATOutputWorker::~AudioCATOutputWorker()
@ -105,6 +108,11 @@ void AudioCATOutputWorker::setSamplerate(int samplerate)
}
}
void AudioCATOutputWorker::setVolume(int volume)
{
m_volume = CalcDb::powerFromdB(volume);
}
void AudioCATOutputWorker::tick()
{
if (m_running)
@ -138,8 +146,8 @@ void AudioCATOutputWorker::callbackPart(SampleVector& data, unsigned int iBegin,
{
for (unsigned int i = iBegin; i < iEnd; i++)
{
m_audioBuffer[m_audioBufferFill].l = m_iqMapping == AudioCATSISOSettings::LR ? data[i].m_real : data[i].m_imag;
m_audioBuffer[m_audioBufferFill].r = m_iqMapping == AudioCATSISOSettings::LR ? data[i].m_imag : data[i].m_real;
m_audioBuffer[m_audioBufferFill].l = (m_iqMapping == AudioCATSISOSettings::LR ? data[i].m_real : data[i].m_imag) * m_volume;
m_audioBuffer[m_audioBufferFill].r = (m_iqMapping == AudioCATSISOSettings::LR ? data[i].m_imag : data[i].m_real) * m_volume;
m_audioBufferFill++;
if (m_audioBufferFill >= m_audioBuffer.size())

View File

@ -38,12 +38,14 @@ public:
void startWork();
void stopWork();
void setSamplerate(int samplerate);
void setVolume(int volume);
void setIQMapping(AudioCATSISOSettings::IQMapping iqMapping) {m_iqMapping = iqMapping;}
void connectTimer(const QTimer& timer);
private:
bool m_running;
int m_samplerate;
float m_volume;
int m_throttlems;
int m_maxThrottlems;
QElapsedTimer m_elapsedTimer;

View File

@ -60,6 +60,7 @@ AudioCATSISO::AudioCATSISO(DeviceAPI *deviceAPI) :
m_rxAudioDeviceIndex(-1),
m_txRunning(false),
m_txAudioDeviceIndex(-1),
m_ptt(false),
m_catRunning(false),
m_masterTimer(deviceAPI->getMasterTimer())
{
@ -160,6 +161,7 @@ bool AudioCATSISO::startRx()
QObject::connect(m_catWorkerThread, &QThread::finished, m_catWorkerThread, &QThread::deleteLater);
m_catWorker->setMessageQueueToGUI(getMessageQueueToGUI());
m_catWorker->setMessageQueueToSISO(getInputMessageQueue());
m_catWorkerThread->start();
AudioCATSISOCATWorker::MsgConfigureAudioCATSISOCATWorker *msgToCAT = AudioCATSISOCATWorker::MsgConfigureAudioCATSISOCATWorker::create(
@ -195,6 +197,7 @@ bool AudioCATSISO::startTx()
QObject::connect(m_outputWorkerThread, &QThread::finished, m_outputWorkerThread, &QThread::deleteLater);
m_outputWorker->setSamplerate(m_txSampleRate);
m_outputWorker->setVolume(m_settings.m_txVolume);
m_outputWorker->setIQMapping(m_settings.m_txIQMapping);
m_outputWorker->connectTimer(m_deviceAPI->getMasterTimer());
m_outputWorkerThread->start();
@ -392,7 +395,8 @@ bool AudioCATSISO::handleMessage(const Message& message)
else if (AudioCATSISOSettings::MsgPTT::match(message))
{
AudioCATSISOSettings::MsgPTT& cmd = (AudioCATSISOSettings::MsgPTT&) message;
qDebug("AudioCATSISO::handleMessage: MsgPTT: %s", cmd.getPTT() ? "on" : "off");
m_ptt = cmd.getPTT();
qDebug("AudioCATSISO::handleMessage: MsgPTT: %s", m_ptt ? "on" : "off");
if (m_catRunning)
{
m_catWorker->getInputMessageQueue()->push(&cmd);
@ -417,6 +421,27 @@ bool AudioCATSISO::handleMessage(const Message& message)
return true;
}
}
else if (AudioCATSISOCATWorker::MsgReportFrequency::match(message))
{
AudioCATSISOCATWorker::MsgReportFrequency& report = (AudioCATSISOCATWorker::MsgReportFrequency&) message;
if (m_ptt) // Tx
{
m_settings.m_txCenterFrequency = report.getFrequency();
DSPMIMOSignalNotification *notif = new DSPMIMOSignalNotification(
m_txSampleRate, m_settings.m_txCenterFrequency, false, 0);
m_deviceAPI->getDeviceEngineInputMessageQueue()->push(notif);
}
else // Rx
{
m_settings.m_rxCenterFrequency = report.getFrequency();
DSPMIMOSignalNotification *notif = new DSPMIMOSignalNotification(
m_rxSampleRate, m_settings.m_rxCenterFrequency, true, 0);
m_deviceAPI->getDeviceEngineInputMessageQueue()->push(notif);
}
return true;
}
else
{
return false;
@ -427,6 +452,7 @@ void AudioCATSISO::applySettings(const AudioCATSISOSettings& settings, const QLi
{
bool forwardRxChange = false;
bool forwardTxChange = false;
bool forwardToCAT = false;
qDebug() << "AudioCATSISO::applySettings: "
<< " force:" << force
@ -468,7 +494,10 @@ void AudioCATSISO::applySettings(const AudioCATSISOSettings& settings, const QLi
if (settingsKeys.contains("txVolume") || force)
{
m_audioOutput.setVolume(settings.m_txVolume);
if (m_txRunning) {
m_outputWorker->setVolume(settings.m_txVolume);
}
// m_audioOutput.setVolume(settings.m_txVolume); // doesn't work
qDebug() << "AudioCATSISO::applySettings: set Tx volume to " << settings.m_txVolume;
}
@ -516,13 +545,13 @@ void AudioCATSISO::applySettings(const AudioCATSISOSettings& settings, const QLi
if (settingsKeys.contains("rxCenterFrequency") || force)
{
// TBD with CAT
forwardToCAT = true;
forwardRxChange = true;
}
if (settingsKeys.contains("txCenterFrequency") || force)
{
// TBD with CAT
forwardToCAT = true;
forwardTxChange = true;
}
@ -541,10 +570,16 @@ void AudioCATSISO::applySettings(const AudioCATSISOSettings& settings, const QLi
m_settings.applySettings(settingsKeys, settings);
}
if (forwardToCAT && m_catRunning)
{
AudioCATSISOCATWorker::MsgConfigureAudioCATSISOCATWorker *msg =
AudioCATSISOCATWorker::MsgConfigureAudioCATSISOCATWorker::create(settings, settingsKeys, force);
m_catWorker->getInputMessageQueue()->push(msg);
}
if (forwardRxChange)
{
int sampleRate = m_rxSampleRate / (1<<m_settings.m_log2Decim);
DSPMIMOSignalNotification *notif = new DSPMIMOSignalNotification(sampleRate, settings.m_rxCenterFrequency, true, 0);
DSPMIMOSignalNotification *notif = new DSPMIMOSignalNotification(m_rxSampleRate, settings.m_rxCenterFrequency, true, 0);
m_deviceAPI->getDeviceEngineInputMessageQueue()->push(notif);
}
@ -661,12 +696,6 @@ void AudioCATSISO::webapiUpdateDeviceSettings(
if (deviceSettingsKeys.contains("iqOrder")) {
settings.m_iqOrder = response.getAudioCatsisoSettings()->getIqOrder() != 0;
}
if (deviceSettingsKeys.contains("spectrumStreamIndex")) {
settings.m_spectrumStreamIndex = response.getAudioCatsisoSettings()->getSpectrumStreamIndex();
}
if (deviceSettingsKeys.contains("streamIndex")) {
settings.m_streamIndex = response.getAudioCatsisoSettings()->getStreamIndex();
}
if (deviceSettingsKeys.contains("rxDeviceName")) {
settings.m_rxDeviceName = *response.getAudioCatsisoSettings()->getRxDeviceName();
}
@ -695,12 +724,6 @@ void AudioCATSISO::webapiUpdateDeviceSettings(
if (deviceSettingsKeys.contains("txIQMapping")) {
settings.m_txIQMapping = (AudioCATSISOSettings::IQMapping)response.getAudioCatsisoSettings()->getTxIqMapping();
}
if (deviceSettingsKeys.contains("log2Interp")) {
settings.m_log2Interp = response.getAudioCatsisoSettings()->getLog2Interp();
}
if (deviceSettingsKeys.contains("fcPosTx")) {
settings.m_fcPosTx = (AudioCATSISOSettings::fcPos_t) response.getAudioCatsisoSettings()->getFcPosTx();
}
if (deviceSettingsKeys.contains("txVolume")) {
settings.m_txVolume = response.getAudioCatsisoSettings()->getTxVolume();
}
@ -727,12 +750,6 @@ void AudioCATSISO::webapiUpdateDeviceSettings(
settings.m_catRTSHigh = response.getAudioCatsisoSettings()->getCatRtsHigh() != 0;
}
if (deviceSettingsKeys.contains("streamIndex")) {
settings.m_streamIndex = response.getAudioCatsisoSettings()->getStreamIndex();
}
if (deviceSettingsKeys.contains("spectrumStreamIndex")) {
settings.m_spectrumStreamIndex = response.getAudioCatsisoSettings()->getSpectrumStreamIndex();
}
if (deviceSettingsKeys.contains("txEnable")) {
settings.m_txEnable = response.getAudioCatsisoSettings()->getTxEnable() != 0;
}
@ -757,8 +774,6 @@ void AudioCATSISO::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& re
response.getAudioCatsisoSettings()->setIqCorrection(settings.m_iqCorrection ? 1 : 0);
response.getAudioCatsisoSettings()->setTransverterDeltaFrequency(settings.m_transverterDeltaFrequency);
response.getAudioCatsisoSettings()->setTransverterMode(settings.m_transverterMode ? 1 : 0);
response.getAudioCatsisoSettings()->setSpectrumStreamIndex(settings.m_spectrumStreamIndex);
response.getAudioCatsisoSettings()->setStreamIndex(settings.m_streamIndex);
response.getAudioCatsisoSettings()->setRxDeviceName(new QString(settings.m_rxDeviceName));
response.getAudioCatsisoSettings()->setRxIqMapping((int)settings.m_rxIQMapping);
response.getAudioCatsisoSettings()->setLog2Decim(settings.m_log2Decim);
@ -769,12 +784,8 @@ void AudioCATSISO::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& re
response.getAudioCatsisoSettings()->setTxDeviceName(new QString(settings.m_txDeviceName));
response.getAudioCatsisoSettings()->setTxIqMapping((int)settings.m_txIQMapping);
response.getAudioCatsisoSettings()->setLog2Interp(settings.m_log2Interp);
response.getAudioCatsisoSettings()->setFcPosTx((int) settings.m_fcPosTx);
response.getAudioCatsisoSettings()->setTxVolume(settings.m_txVolume);
response.getAudioCatsisoSettings()->setStreamIndex(settings.m_streamIndex);
response.getAudioCatsisoSettings()->setSpectrumStreamIndex(settings.m_spectrumStreamIndex);
response.getAudioCatsisoSettings()->setTxEnable(settings.m_txEnable ? 1 : 0);
response.getAudioCatsisoSettings()->setCatSpeedIndex(settings.m_catSpeedIndex);
@ -823,12 +834,6 @@ void AudioCATSISO::webapiReverseSendSettings(const QList<QString>& deviceSetting
if (deviceSettingsKeys.contains("iqOrder")) {
swgAudioCATSISOSettings->setIqOrder(settings.m_iqOrder ? 1 : 0);
}
if (deviceSettingsKeys.contains("spectrumStreamIndex")) {
swgAudioCATSISOSettings->setSpectrumStreamIndex(settings.m_spectrumStreamIndex);
}
if (deviceSettingsKeys.contains("streamIndex")) {
swgAudioCATSISOSettings->setStreamIndex(settings.m_streamIndex);
}
if (deviceSettingsKeys.contains("rxDeviceName") || force) {
swgAudioCATSISOSettings->setRxDeviceName(new QString(settings.m_rxDeviceName));
}
@ -857,22 +862,10 @@ void AudioCATSISO::webapiReverseSendSettings(const QList<QString>& deviceSetting
if (deviceSettingsKeys.contains("txIQMapping")) {
swgAudioCATSISOSettings->setTxIqMapping((int) settings.m_txIQMapping);
}
if (deviceSettingsKeys.contains("log2Interp")) {
swgAudioCATSISOSettings->setLog2Interp(settings.m_log2Interp);
}
if (deviceSettingsKeys.contains("fcPosTx")) {
swgAudioCATSISOSettings->setFcPosTx((int) settings.m_fcPosTx);
}
if (deviceSettingsKeys.contains("txVolume")) {
swgAudioCATSISOSettings->setTxVolume(settings.m_txVolume);
}
if (deviceSettingsKeys.contains("streamIndex")) {
swgAudioCATSISOSettings->setStreamIndex(settings.m_streamIndex);
}
if (deviceSettingsKeys.contains("spectrumStreamIndex")) {
swgAudioCATSISOSettings->setSpectrumStreamIndex(settings.m_spectrumStreamIndex);
}
if (deviceSettingsKeys.contains("txEnable")) {
swgAudioCATSISOSettings->setTxEnable(settings.m_txEnable ? 1 : 0);
}

View File

@ -180,6 +180,7 @@ private:
bool m_txRunning;
int m_txAudioDeviceIndex;
int m_txSampleRate;
bool m_ptt;
bool m_catRunning;
const QTimer& m_masterTimer;
QNetworkAccessManager *m_networkManager;

View File

@ -20,13 +20,18 @@
#include "audiocatsisocatworker.h"
MESSAGE_CLASS_DEFINITION(AudioCATSISOCATWorker::MsgConfigureAudioCATSISOCATWorker, Message)
MESSAGE_CLASS_DEFINITION(AudioCATSISOCATWorker::MsgReportFrequency, Message)
AudioCATSISOCATWorker::AudioCATSISOCATWorker(QObject* parent) :
QObject(parent),
m_inputMessageQueueToGUI(nullptr),
m_inputMessageQueueToSISO(nullptr),
m_running(false),
m_connected(false)
m_connected(false),
m_ptt(false),
m_frequency(0)
{
rig_set_debug(RIG_DEBUG_ERR);
}
AudioCATSISOCATWorker::~AudioCATSISOCATWorker()
@ -60,6 +65,20 @@ void AudioCATSISOCATWorker::applySettings(const AudioCATSISOSettings& settings,
<< " force:" << force
<< settings.getDebugString(settingsKeys, force);
if (settingsKeys.contains("rxCenterFrequency") || force)
{
if (!m_ptt) {
catSetFrequency(settings.m_rxCenterFrequency);
}
}
if (settingsKeys.contains("txCenterFrequency") || force)
{
if (m_ptt) {
catSetFrequency(settings.m_txCenterFrequency);
}
}
if (force) {
m_settings = settings;
} else {
@ -88,6 +107,14 @@ bool AudioCATSISOCATWorker::handleMessage(const Message& message)
return true;
}
else if (AudioCATSISOSettings::MsgPTT::match(message))
{
AudioCATSISOSettings::MsgPTT& cmd = (AudioCATSISOSettings::MsgPTT&) message;
m_ptt = cmd.getPTT();
catPTT(m_ptt);
return true;
}
return false;
}
@ -140,6 +167,8 @@ void AudioCATSISOCATWorker::catConnect()
if (retcode == RIG_OK)
{
m_connected = true;
connect(&m_pollTimer, SIGNAL(timeout()), this, SLOT(pollingTick()));
m_pollTimer.start(m_settings.m_catPollingMs);
msg = AudioCATSISOSettings::MsgCATReportStatus::create(AudioCATSISOSettings::MsgCATReportStatus::StatusConnected);
}
else
@ -157,6 +186,9 @@ void AudioCATSISOCATWorker::catConnect()
void AudioCATSISOCATWorker::catDisconnect()
{
disconnect(&m_pollTimer, SIGNAL(timeout()), this, SLOT(pollingTick()));
m_pollTimer.stop();
m_connected = false;
rig_close(m_rig); /* close port */
rig_cleanup(m_rig); /* if you care about memory */
@ -168,3 +200,101 @@ void AudioCATSISOCATWorker::catDisconnect()
m_inputMessageQueueToGUI->push(msg);
}
}
void AudioCATSISOCATWorker::catPTT(bool ptt)
{
if (!m_connected) {
return;
}
if (m_ptt)
{
if (m_settings.m_txCenterFrequency != m_frequency) {
catSetFrequency(m_settings.m_txCenterFrequency);
}
}
else
{
if (m_settings.m_rxCenterFrequency != m_frequency) {
catSetFrequency(m_settings.m_rxCenterFrequency);
}
}
int retcode = rig_set_ptt(m_rig, RIG_VFO_CURR, ptt ? RIG_PTT_ON : RIG_PTT_OFF);
if (retcode != RIG_OK)
{
if (m_inputMessageQueueToGUI)
{
AudioCATSISOSettings::MsgCATReportStatus *msg = AudioCATSISOSettings::MsgCATReportStatus::create(
AudioCATSISOSettings::MsgCATReportStatus::StatusError
);
m_inputMessageQueueToGUI->push(msg);
}
}
}
void AudioCATSISOCATWorker::catSetFrequency(uint64_t frequency)
{
if (!m_connected) {
return;
}
qDebug("AudioCATSISOCATWorker::catSetFrequency: %lu", frequency);
int retcode = rig_set_freq(m_rig, RIG_VFO_CURR, frequency);
if (retcode != RIG_OK)
{
m_frequency = frequency;
if (m_inputMessageQueueToGUI)
{
AudioCATSISOSettings::MsgCATReportStatus *msg = AudioCATSISOSettings::MsgCATReportStatus::create(
AudioCATSISOSettings::MsgCATReportStatus::StatusError
);
m_inputMessageQueueToGUI->push(msg);
}
}
}
void AudioCATSISOCATWorker::pollingTick()
{
if (!m_connected) {
return;
}
freq_t freq; // double
int retcode = rig_get_freq(m_rig, RIG_VFO_CURR, &freq);
if (retcode == RIG_OK)
{
if (m_frequency != freq)
{
qDebug("AudioCATSISOCATWorker::pollingTick: %lu", m_frequency);
if (m_inputMessageQueueToSISO)
{
MsgReportFrequency *msgFreq = MsgReportFrequency::create(freq);
m_inputMessageQueueToSISO->push(msgFreq);
}
m_frequency = freq;
}
if (m_inputMessageQueueToGUI)
{
AudioCATSISOSettings::MsgCATReportStatus *msgStatus =
AudioCATSISOSettings::MsgCATReportStatus::create(AudioCATSISOSettings::MsgCATReportStatus::StatusConnected);
m_inputMessageQueueToGUI->push(msgStatus);
}
}
else
{
if (m_inputMessageQueueToGUI)
{
AudioCATSISOSettings::MsgCATReportStatus *msgStatus =
AudioCATSISOSettings::MsgCATReportStatus::create(AudioCATSISOSettings::MsgCATReportStatus::StatusError);
m_inputMessageQueueToGUI->push(msgStatus);
}
}
}

View File

@ -21,6 +21,8 @@
#include <hamlib/rig.h>
#include <QObject>
#include <QTimer>
#include "util/message.h"
#include "util/messagequeue.h"
#include "audiocatsisosettings.h"
@ -54,6 +56,25 @@ public:
{ }
};
class MsgReportFrequency : public Message {
MESSAGE_CLASS_DECLARATION
public:
uint64_t getFrequency() const { return m_frequency; }
static MsgReportFrequency* create(uint64_t frequency) {
return new MsgReportFrequency(frequency);
}
protected:
uint64_t m_frequency; //!< Frequency in Hz
MsgReportFrequency(uint64_t frequency) :
Message(),
m_frequency(frequency)
{ }
};
AudioCATSISOCATWorker(QObject* parent = nullptr);
~AudioCATSISOCATWorker();
@ -61,22 +82,30 @@ public:
void stopWork();
MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
void setMessageQueueToGUI(MessageQueue *queue) { m_inputMessageQueueToGUI = queue; }
void setMessageQueueToSISO(MessageQueue *queue) { m_inputMessageQueueToSISO = queue; }
private:
void applySettings(const AudioCATSISOSettings& settings, const QList<QString>& settingsKeys, bool force);
bool handleMessage(const Message& message);
void catConnect();
void catDisconnect();
void catPTT(bool ptt);
void catSetFrequency(uint64_t frequency);
MessageQueue m_inputMessageQueue;
MessageQueue *m_inputMessageQueueToGUI;
MessageQueue *m_inputMessageQueueToSISO;
bool m_running;
bool m_connected;
AudioCATSISOSettings m_settings;
RIG *m_rig;
QTimer m_pollTimer;
bool m_ptt;
uint64_t m_frequency;
private slots:
void handleInputMessages();
void pollingTick();
};

View File

@ -48,6 +48,7 @@ AudioCATSISOGUI::AudioCATSISOGUI(DeviceUISet *deviceUISet, QWidget* parent) :
DeviceGUI(parent),
ui(new Ui::AudioCATSISOGUI),
m_settings(),
m_rxElseTx(true),
m_doApplySettings(true),
m_forceSettings(true),
m_sampleMIMO(nullptr),
@ -74,6 +75,7 @@ AudioCATSISOGUI::AudioCATSISOGUI(DeviceUISet *deviceUISet, QWidget* parent) :
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
ui->centerFrequency->setValueRange(9, 0, m_absMaxFreq);
ui->catStatusIndicator->setStyleSheet("QLabel { background-color:gray; border-radius: 7px; }");
ui->streamLock->setChecked(true);
for (const auto& comPortName : m_sampleMIMO->getComPorts()) {
ui->catDevice->addItem(comPortName);
@ -84,6 +86,7 @@ AudioCATSISOGUI::AudioCATSISOGUI(DeviceUISet *deviceUISet, QWidget* parent) :
}
displaySettings();
updateTxEnable();
connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware()));
connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus()));
@ -118,12 +121,12 @@ void AudioCATSISOGUI::resetToDefaults()
void AudioCATSISOGUI::setCenterFrequency(qint64 centerFrequency)
{
if (m_settings.m_streamIndex == 0)
if (m_rxElseTx)
{
m_settings.m_rxCenterFrequency = centerFrequency;
m_settingsKeys.append("rxCenterFrequency");
}
else if (m_settings.m_streamIndex == 1)
else
{
m_settings.m_txCenterFrequency = centerFrequency;
m_settingsKeys.append("txCenterFrequency");
@ -172,14 +175,14 @@ void AudioCATSISOGUI::on_catConnect_toggled(bool checked)
m_sampleMIMO->getInputMessageQueue()->push(msg);
}
void AudioCATSISOGUI::on_streamIndex_currentIndexChanged(int index)
void AudioCATSISOGUI::on_streamSide_currentIndexChanged(int index)
{
qDebug("AudioCATSISOGUI::on_streamSide_currentIndexChanged: %d", index);
m_rxElseTx = index == 0;
if (ui->streamLock->isChecked())
{
m_settings.m_spectrumStreamIndex = index;
m_settingsKeys.append("spectrumStreamIndex");
if (m_settings.m_spectrumStreamIndex == 0)
if (index == 0)
{
m_deviceUISet->m_spectrum->setDisplayedStream(true, index);
m_deviceUISet->m_deviceAPI->setSpectrumSinkInput(true, 0);
@ -194,25 +197,19 @@ void AudioCATSISOGUI::on_streamIndex_currentIndexChanged(int index)
updateSpectrum();
ui->spectrumSource->blockSignals(true);
ui->spectrumSource->setCurrentIndex(index);
ui->spectrumSource->blockSignals(false);
ui->spectrumSide->blockSignals(true);
ui->spectrumSide->setCurrentIndex(index);
ui->spectrumSide->blockSignals(false);
}
m_settings.m_streamIndex = index;
m_settingsKeys.append("streamIndex");
sendSettings();
displayDecim();
displayFrequency();
displaySampleRate();
}
void AudioCATSISOGUI::on_spectrumSource_currentIndexChanged(int index)
void AudioCATSISOGUI::on_spectrumSide_currentIndexChanged(int index)
{
m_settings.m_spectrumStreamIndex = index;
m_settingsKeys.append("spectrumStreamIndex");
if (m_settings.m_spectrumStreamIndex == 0)
if (index == 0)
{
m_deviceUISet->m_spectrum->setDisplayedStream(true, index);
m_deviceUISet->m_deviceAPI->setSpectrumSinkInput(true, 0);
@ -229,33 +226,29 @@ void AudioCATSISOGUI::on_spectrumSource_currentIndexChanged(int index)
if (ui->streamLock->isChecked())
{
ui->streamIndex->blockSignals(true);
ui->streamIndex->setCurrentIndex(index);
ui->streamIndex->blockSignals(false);
m_settings.m_streamIndex = index;
m_settingsKeys.append("streamIndex");
ui->streamSide->blockSignals(true);
ui->streamSide->setCurrentIndex(index);
ui->streamSide->blockSignals(false);
displayFrequency();
displaySampleRate();
}
sendSettings();
}
void AudioCATSISOGUI::on_streamLock_toggled(bool checked)
{
if (checked && (ui->streamIndex->currentIndex() != ui->spectrumSource->currentIndex())) {
ui->spectrumSource->setCurrentIndex(ui->streamIndex->currentIndex());
if (checked && (ui->streamSide->currentIndex() != ui->spectrumSide->currentIndex())) {
ui->spectrumSide->setCurrentIndex(ui->streamSide->currentIndex());
}
}
void AudioCATSISOGUI::on_centerFrequency_changed(quint64 value)
{
if (m_settings.m_streamIndex == 0)
if (m_rxElseTx)
{
m_settings.m_rxCenterFrequency = value * 1000;
m_settingsKeys.append("rxCenterFrequency");
}
else if (m_settings.m_streamIndex == 1)
else
{
m_settings.m_txCenterFrequency = value * 1000;
m_settingsKeys.append("txCenterFrequency");
@ -266,10 +259,14 @@ void AudioCATSISOGUI::on_centerFrequency_changed(quint64 value)
void AudioCATSISOGUI::on_log2Decim_currentIndexChanged(int index)
{
if (!m_rxElseTx) { // No interpolation
return;
}
m_settings.m_log2Decim = index < 0 ? 0 : index > 3 ? 3 : index;
m_settingsKeys.append("log2Decim");
// displaySampleRate();
displayFcRxTooltip();
m_settingsKeys.append("log2Decim");
sendSettings();
}
@ -290,6 +287,7 @@ void AudioCATSISOGUI::on_iqCorrection_toggled(bool checked)
void AudioCATSISOGUI::on_txEnable_toggled(bool checked)
{
m_settings.m_txEnable = checked;
updateTxEnable();
m_settingsKeys.append("txEnable");
sendSettings();
}
@ -363,8 +361,8 @@ void AudioCATSISOGUI::on_txChannels_currentIndexChanged(int index)
void AudioCATSISOGUI::on_txVolume_valueChanged(int value)
{
m_settings.m_txVolume = value/10.0f;
ui->txVolumeText->setText(QString("%1").arg(m_settings.m_txVolume, 3, 'f', 1));
m_settings.m_txVolume = value;
ui->txVolumeText->setText(tr("%1").arg(m_settings.m_txVolume));
m_settingsKeys.append("txVolume");
sendSettings();
}
@ -407,9 +405,6 @@ void AudioCATSISOGUI::displaySettings()
ui->rxDeviceLabel->setText(m_settings.m_rxDeviceName);
ui->txDeviceLabel->setText(m_settings.m_txDeviceName);
ui->streamIndex->setCurrentIndex(m_settings.m_streamIndex);
ui->spectrumSource->setCurrentIndex(m_settings.m_spectrumStreamIndex);
ui->log2Decim->setCurrentIndex(m_settings.m_log2Decim);
ui->dcBlock->setChecked(m_settings.m_dcBlock);
ui->iqCorrection->setChecked(m_settings.m_iqCorrection);
ui->txEnable->setChecked(m_settings.m_txEnable);
@ -417,17 +412,19 @@ void AudioCATSISOGUI::displaySettings()
ui->rxVolumeText->setText(QString("%1").arg(m_settings.m_rxVolume, 3, 'f', 1));
ui->rxChannels->setCurrentIndex((int)m_settings.m_rxIQMapping);
ui->txVolume->setValue((int)(m_settings.m_txVolume*10.0f));
ui->txVolumeText->setText(QString("%1").arg(m_settings.m_txVolume, 3, 'f', 1));
ui->txVolumeText->setText(tr("%1").arg(m_settings.m_txVolume));
ui->txChannels->setCurrentIndex((int)m_settings.m_txIQMapping);
ui->fcPosRx->setCurrentIndex(m_settings.m_fcPosRx);
blockApplySettings(false);
displayFrequency();
displaySampleRate();
displayDecim();
updateSpectrum();
displayFcRxTooltip();
displayCatDevice();
displayCatType();
blockApplySettings(false);
}
void AudioCATSISOGUI::displayFcRxTooltip()
@ -443,6 +440,7 @@ void AudioCATSISOGUI::displayFcRxTooltip()
void AudioCATSISOGUI::displayCatDevice()
{
blockApplySettings(true);
QMap<QString, int> catDevices;
for (int index = 0; index < ui->catDevice->count(); index++) {
@ -454,10 +452,13 @@ void AudioCATSISOGUI::displayCatDevice()
} else if (ui->catDevice->count() > 0) {
m_settings.m_catDevicePath = ui->catDevice->itemText(0);
}
blockApplySettings(false);
}
void AudioCATSISOGUI::displayCatType()
{
blockApplySettings(true);
QMap<QString, int> catTypes;
for (int index = 0; index < ui->catType->count(); index++) {
@ -472,6 +473,23 @@ void AudioCATSISOGUI::displayCatType()
ui->catType->setCurrentIndex(catTypes[it.value()]);
}
}
blockApplySettings(false);
}
void AudioCATSISOGUI::updateTxEnable()
{
if (!m_settings.m_txEnable) // Rx only
{
ui->streamLock->setChecked(true);
ui->streamSide->setCurrentIndex(0);
ui->spectrumSide->setCurrentIndex(0);
}
ui->ptt->setEnabled(m_settings.m_txEnable);
ui->streamLock->setEnabled(m_settings.m_txEnable);
ui->streamSide->setEnabled(m_settings.m_txEnable);
ui->spectrumSide->setEnabled(m_settings.m_txEnable);
}
void AudioCATSISOGUI::sendSettings()
@ -546,8 +564,10 @@ bool AudioCATSISOGUI::handleMessage(const Message& message)
<< "sourceOrSink:" << sourceOrSink
<< "istream:" << istream
<< "m_rxSampleRate:" << m_rxSampleRate
<< "m_log2Decim:" << m_settings.m_log2Decim
<< "m_txSampleRate:" << m_txSampleRate
<< "frequency:" << frequency;
<< "m_rxCenterFrequency:" << m_settings.m_rxCenterFrequency
<< "m_txCenterFrequency:" << m_settings.m_txCenterFrequency;
displayFrequency();
displaySampleRate();
@ -566,13 +586,6 @@ bool AudioCATSISOGUI::handleMessage(const Message& message)
m_settings.applySettings(cfg.getSettingsKeys(), cfg.getSettings());
}
if ((m_settings.m_spectrumStreamIndex != m_settings.m_streamIndex) && (ui->streamLock->isChecked()))
{
m_settings.m_spectrumStreamIndex = m_settings.m_streamIndex;
m_settingsKeys.append("spectrumStreamIndex");
sendSettings();
}
displaySettings();
return true;
}
@ -614,25 +627,45 @@ void AudioCATSISOGUI::displayFrequency()
{
qint64 centerFrequency;
if (m_settings.m_streamIndex == 0) {
if (m_rxElseTx) {
centerFrequency = m_settings.m_rxCenterFrequency;
} else if (m_settings.m_streamIndex == 1) {
} else {
centerFrequency = m_settings.m_txCenterFrequency;
}
blockApplySettings(true);
ui->centerFrequency->setValueRange(9, 0, 9999999999);
ui->centerFrequency->setValue(centerFrequency / 1000);
blockApplySettings(false);
}
void AudioCATSISOGUI::displaySampleRate()
{
if (m_settings.m_streamIndex == 0) {
ui->deviceRateText->setText(tr("%1k").arg((float) m_rxSampleRate / 1000));
if (m_rxElseTx) {
ui->deviceRateText->setText(tr("%1k").arg((float) (m_rxSampleRate/(1<<m_settings.m_log2Decim)) / 1000));
} else {
ui->deviceRateText->setText(tr("%1k").arg((float) m_txSampleRate / 1000));
}
}
void AudioCATSISOGUI::displayDecim()
{
blockApplySettings(true);
if (m_rxElseTx)
{
ui->log2Decim->setCurrentIndex(m_settings.m_log2Decim);
ui->fcPosRx->setCurrentIndex(m_settings.m_fcPosRx);
}
else
{
ui->log2Decim->setCurrentIndex(0); // no interpolation
ui->fcPosRx->setCurrentIndex(2); // center
}
blockApplySettings(false);
}
void AudioCATSISOGUI::updateCATStatus(AudioCATSISOSettings::MsgCATReportStatus::Status status)
{
if (m_lastCATStatus != status)
@ -663,18 +696,16 @@ void AudioCATSISOGUI::updateSpectrum()
{
qint64 centerFrequency;
if (m_settings.m_spectrumStreamIndex == 0) {
if (m_rxElseTx) {
centerFrequency = m_settings.m_rxCenterFrequency;
} else if (m_settings.m_spectrumStreamIndex == 1) {
centerFrequency = m_settings.m_txCenterFrequency;
} else {
centerFrequency = 0;
centerFrequency = m_settings.m_txCenterFrequency;
}
m_deviceUISet->getSpectrum()->setCenterFrequency(centerFrequency);
if (m_settings.m_spectrumStreamIndex == 0) {
m_deviceUISet->getSpectrum()->setSampleRate(m_rxSampleRate);
if (m_rxElseTx) {
m_deviceUISet->getSpectrum()->setSampleRate(m_rxSampleRate/(1<<m_settings.m_log2Decim));
} else {
m_deviceUISet->getSpectrum()->setSampleRate(m_txSampleRate);
}
@ -711,8 +742,8 @@ void AudioCATSISOGUI::openDeviceSettingsDialog(const QPoint& p)
void AudioCATSISOGUI::makeUIConnections()
{
QObject::connect(ui->streamIndex, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &AudioCATSISOGUI::on_streamIndex_currentIndexChanged);
QObject::connect(ui->spectrumSource, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &AudioCATSISOGUI::on_spectrumSource_currentIndexChanged);
QObject::connect(ui->streamSide, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &AudioCATSISOGUI::on_streamSide_currentIndexChanged);
QObject::connect(ui->spectrumSide, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &AudioCATSISOGUI::on_spectrumSide_currentIndexChanged);
QObject::connect(ui->streamLock, &QToolButton::toggled, this, &AudioCATSISOGUI::on_streamLock_toggled);
QObject::connect(ui->startStop, &ButtonSwitch::toggled, this, &AudioCATSISOGUI::on_startStop_toggled);
QObject::connect(ui->ptt, &ButtonSwitch::toggled, this, &AudioCATSISOGUI::on_ptt_toggled);

View File

@ -51,6 +51,7 @@ private:
AudioCATSISOSettings m_settings;
QList<QString> m_settingsKeys;
bool m_rxElseTx; //!< Which side is being dealt with
int m_rxSampleRate;
int m_txSampleRate;
QTimer m_updateTimer;
@ -70,9 +71,11 @@ private:
void displaySettings();
void displayFrequency();
void displaySampleRate();
void displayDecim();
void displayFcRxTooltip();
void displayCatDevice();
void displayCatType();
void updateTxEnable();
void updateSpectrum();
void updateCATStatus(AudioCATSISOSettings::MsgCATReportStatus::Status status);
void sendSettings();
@ -82,8 +85,8 @@ private:
private slots:
void handleInputMessages();
void on_streamIndex_currentIndexChanged(int index);
void on_spectrumSource_currentIndexChanged(int index);
void on_streamSide_currentIndexChanged(int index);
void on_spectrumSide_currentIndexChanged(int index);
void on_streamLock_toggled(bool checked);
void on_startStop_toggled(bool checked);
void on_ptt_toggled(bool checked);

View File

@ -75,7 +75,7 @@
</widget>
</item>
<item>
<widget class="QComboBox" name="streamIndex">
<widget class="QComboBox" name="streamSide">
<property name="minimumSize">
<size>
<width>60</width>
@ -114,7 +114,7 @@
</widget>
</item>
<item>
<widget class="QComboBox" name="spectrumSource">
<widget class="QComboBox" name="spectrumSide">
<property name="minimumSize">
<size>
<width>60</width>
@ -694,23 +694,35 @@
</size>
</property>
<property name="toolTip">
<string>Tx audio volume. Not supported by all devices</string>
<string>Tx audio volume (dB)</string>
</property>
<property name="minimum">
<number>-40</number>
</property>
<property name="maximum">
<number>10</number>
<number>0</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="value">
<number>10</number>
<number>-10</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="txVolumeText">
<property name="minimumSize">
<size>
<width>22</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>1.0</string>
<string>-10</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>

View File

@ -79,12 +79,8 @@ void AudioCATSISOSettings::resetToDefaults()
m_iqCorrection = false;
m_fcPosRx = FC_POS_CENTER;
m_txDeviceName = "";
m_txVolume = 1.0f;
m_txVolume = -10;
m_txIQMapping = LR;
m_log2Interp = 0;
m_fcPosTx = FC_POS_CENTER;
m_streamIndex = 0;
m_spectrumStreamIndex = 0;
m_txEnable = false;
m_catDevicePath = "";
m_hamlibModel = 1; // Hamlib dummy model
@ -95,6 +91,7 @@ void AudioCATSISOSettings::resetToDefaults()
m_catPTTMethodIndex = 0; // PTT
m_catDTRHigh = true; // High
m_catRTSHigh = true; // High
m_catPollingMs = 5000;
m_useReverseAPI = false;
m_reverseAPIAddress = "127.0.0.1";
m_reverseAPIPort = 8888;
@ -115,10 +112,6 @@ AudioCATSISOSettings::AudioCATSISOSettings(const AudioCATSISOSettings& other)
m_txDeviceName = other.m_txDeviceName;
m_txVolume = other.m_txVolume;
m_txIQMapping = other.m_txIQMapping;
m_log2Interp = other.m_log2Interp;
m_fcPosTx = other.m_fcPosTx;
m_streamIndex = other.m_streamIndex;
m_spectrumStreamIndex = other.m_spectrumStreamIndex;
m_txEnable = other.m_txEnable;
m_catDevicePath = other.m_catDevicePath;
m_hamlibModel = other.m_hamlibModel;
@ -129,6 +122,7 @@ AudioCATSISOSettings::AudioCATSISOSettings(const AudioCATSISOSettings& other)
m_catPTTMethodIndex = other.m_catPTTMethodIndex;
m_catDTRHigh = other.m_catDTRHigh;
m_catRTSHigh = other.m_catRTSHigh;
m_catPollingMs = other.m_catPollingMs;
m_useReverseAPI = other.m_useReverseAPI;
m_reverseAPIAddress = other.m_reverseAPIAddress;
m_reverseAPIPort = other.m_reverseAPIPort;
@ -149,11 +143,9 @@ QByteArray AudioCATSISOSettings::serialize() const
s.writeS32(8, (int) m_fcPosRx);
s.writeString(21, m_txDeviceName);
s.writeU64(22, m_rxCenterFrequency);
s.writeFloat(23, m_txVolume);
s.writeU64(22, m_txCenterFrequency);
s.writeS32(23, m_txVolume);
s.writeS32(24, (int)m_txIQMapping);
s.writeU32(25, m_log2Decim);
s.writeS32(26, (int) m_fcPosTx);
s.writeString(31, m_catDevicePath);
s.writeU32(32, m_hamlibModel);
@ -164,13 +156,12 @@ QByteArray AudioCATSISOSettings::serialize() const
s.writeS32(37, m_catPTTMethodIndex);
s.writeBool(38, m_catDTRHigh);
s.writeBool(39, m_catRTSHigh);
s.writeU32(40, m_catPollingMs);
s.writeBool(51, m_useReverseAPI);
s.writeString(52, m_reverseAPIAddress);
s.writeU32(53, m_reverseAPIPort);
s.writeU32(54, m_reverseAPIDeviceIndex);
s.writeS32(55, m_streamIndex);
s.writeS32(56, m_spectrumStreamIndex);
s.writeBool(57, m_txEnable);
return s.final();
@ -203,11 +194,8 @@ bool AudioCATSISOSettings::deserialize(const QByteArray& data)
d.readString(21, &m_txDeviceName, "");
d.readU64(22, &m_txCenterFrequency, 14200000);
d.readFloat(23, &m_txVolume, 1.0f);
d.readS32(23, &m_txVolume, -10);
d.readS32(24,(int *)&m_txIQMapping, IQMapping::LR);
d.readU32(25, &m_log2Interp, 0);
d.readS32(26, &intval, 2);
m_fcPosTx = (fcPos_t) intval;
d.readString(31, &m_catDevicePath, "");
d.readU32(32, &m_hamlibModel, 1);
@ -218,6 +206,7 @@ bool AudioCATSISOSettings::deserialize(const QByteArray& data)
d.readS32(37, &m_catPTTMethodIndex, 0);
d.readBool(38, &m_catDTRHigh, true);
d.readBool(39, &m_catRTSHigh, true);
d.readU32(40, &m_catPollingMs, 500);
d.readBool(51, &m_useReverseAPI, false);
d.readString(52, &m_reverseAPIAddress, "127.0.0.1");
@ -232,8 +221,6 @@ bool AudioCATSISOSettings::deserialize(const QByteArray& data)
d.readU32(54, &uintval, 0);
m_reverseAPIDeviceIndex = uintval > 99 ? 99 : uintval;
d.readS32(55, &m_streamIndex, 0);
d.readS32(56, &m_spectrumStreamIndex, 0);
d.readBool(57, &m_txEnable, false);
return true;
@ -284,19 +271,7 @@ void AudioCATSISOSettings::applySettings(const QStringList& settingsKeys, const
if (settingsKeys.contains("txIQMapping")) {
m_txIQMapping = settings.m_txIQMapping;
}
if (settingsKeys.contains("log2Interp")) {
m_log2Interp = settings.m_log2Interp;
}
if (settingsKeys.contains("fcPosTx")) {
m_fcPosTx = settings.m_fcPosTx;
}
if (settingsKeys.contains("streamIndex")) {
m_streamIndex = settings.m_streamIndex;
}
if (settingsKeys.contains("spectrumStreamIndex")) {
m_spectrumStreamIndex = settings.m_spectrumStreamIndex;
}
if (settingsKeys.contains("txEnable")) {
m_txEnable = settings.m_txEnable;
}
@ -327,6 +302,9 @@ void AudioCATSISOSettings::applySettings(const QStringList& settingsKeys, const
if (settingsKeys.contains("catRTSHigh")) {
m_catRTSHigh = settings.m_catRTSHigh;
}
if (settingsKeys.contains("catPollingMs")) {
m_catPollingMs = settings.m_catPollingMs;
}
if (settingsKeys.contains("useReverseAPI")) {
m_useReverseAPI = settings.m_useReverseAPI;
@ -374,25 +352,16 @@ QString AudioCATSISOSettings::getDebugString(const QStringList& settingsKeys, bo
if (settingsKeys.contains("txDeviceName") || force) {
ostr << " m_txDeviceName: " << m_txDeviceName.toStdString();
}
if (settingsKeys.contains("txCenterFrequency") || force) {
ostr << " m_txCenterFrequency: " << m_txCenterFrequency;
}
if (settingsKeys.contains("txVolume") || force) {
ostr << " m_txVolume: " << m_txVolume;
}
if (settingsKeys.contains("txIQMapping") || force) {
ostr << " m_txIQMapping: " << m_txIQMapping;
}
if (settingsKeys.contains("log2Interp") || force) {
ostr << " m_log2Interp: " << m_log2Interp;
}
if (settingsKeys.contains("fcPosTx") || force) {
ostr << " m_fcPosTx: " << m_fcPosTx;
}
if (settingsKeys.contains("streamIndex") || force) {
ostr << " m_streamIndex: " << m_streamIndex;
}
if (settingsKeys.contains("spectrumStreamIndex") || force) {
ostr << " m_spectrumStreamIndex: " << m_spectrumStreamIndex;
}
if (settingsKeys.contains("txEnable") || force) {
ostr << " m_txEnable: " << m_txEnable;
}
@ -423,6 +392,9 @@ QString AudioCATSISOSettings::getDebugString(const QStringList& settingsKeys, bo
if (settingsKeys.contains("catRTSHigh") || force) {
ostr << " m_catRTSHigh: " << m_catRTSHigh;
}
if (settingsKeys.contains("catPollingMs") || force) {
ostr << " m_catPollingMs: " << m_catPollingMs;
}
if (settingsKeys.contains("useReverseAPI") || force) {
ostr << " m_useReverseAPI: " << m_useReverseAPI;

View File

@ -105,8 +105,6 @@ struct AudioCATSISOSettings {
bool m_transverterMode;
qint64 m_transverterDeltaFrequency;
bool m_iqOrder;
int m_streamIndex;
int m_spectrumStreamIndex; //!< spectrum source
bool m_txEnable;
QString m_rxDeviceName; // Including realm, as from getFullDeviceName below
@ -119,9 +117,7 @@ struct AudioCATSISOSettings {
QString m_txDeviceName; // Including realm, as from getFullDeviceName below
IQMapping m_txIQMapping;
unsigned int m_log2Interp;
fcPos_t m_fcPosTx; //!< Not implemented yet
float m_txVolume; //!< Not implemented yet
int m_txVolume; //!< dB
QString m_catDevicePath;
uint32_t m_hamlibModel; //!< Hamlib model number
@ -132,6 +128,7 @@ struct AudioCATSISOSettings {
int m_catPTTMethodIndex;
bool m_catDTRHigh;
bool m_catRTSHigh;
uint32_t m_catPollingMs; //!< CAT polling interval in ms
static const int m_catSpeeds[];
static const int m_catDataBits[];

File diff suppressed because one or more lines are too long

View File

@ -18,12 +18,6 @@ AudioCATSISOSettings:
IQ samples order
* 0 - Q then I (swapped)
* 1 - I then Q (straight)
streamIndex:
type: integer
description: The index of the stream currently in scope
spectrumStreamIndex:
type: integer
description: The index of the stream that is used as source of the main spectrum
txEnable:
type: integer
description: >
@ -75,19 +69,9 @@ AudioCATSISOSettings:
Audio channel to IQ mapping
* 0 - I=L, Q=R
* 1 - I=R, Q=L
log2Interp:
description: Interpolation factor (Tx)
type: integer
fcPosTx:
type: integer
description: >
Interpolated bandpass center frequency position
* 0 - Infradyne
* 1 - Supradyne
* 2 - Centered
txVolume:
type: number
format: float
type: integer
description: Tx volume in dB usually negative
catSpeedIndex:
type: integer
descriptoion: >

View File

@ -18,12 +18,6 @@ AudioCATSISOSettings:
IQ samples order
* 0 - Q then I (swapped)
* 1 - I then Q (straight)
streamIndex:
type: integer
description: The index of the stream currently in scope
spectrumStreamIndex:
type: integer
description: The index of the stream that is used as source of the main spectrum
txEnable:
type: integer
description: >
@ -75,19 +69,9 @@ AudioCATSISOSettings:
Audio channel to IQ mapping
* 0 - I=L, Q=R
* 1 - I=R, Q=L
log2Interp:
description: Interpolation factor (Tx)
type: integer
fcPosTx:
type: integer
description: >
Interpolated bandpass center frequency position
* 0 - Infradyne
* 1 - Supradyne
* 2 - Centered
txVolume:
type: number
format: float
type: integer
description: Tx volume in dB usually negative
catSpeedIndex:
type: integer
descriptoion: >

File diff suppressed because one or more lines are too long

View File

@ -38,10 +38,6 @@ SWGAudioCATSISOSettings::SWGAudioCATSISOSettings() {
m_transverter_delta_frequency_isSet = false;
iq_order = 0;
m_iq_order_isSet = false;
stream_index = 0;
m_stream_index_isSet = false;
spectrum_stream_index = 0;
m_spectrum_stream_index_isSet = false;
tx_enable = 0;
m_tx_enable_isSet = false;
rx_device_name = nullptr;
@ -62,11 +58,7 @@ SWGAudioCATSISOSettings::SWGAudioCATSISOSettings() {
m_tx_device_name_isSet = false;
tx_iq_mapping = 0;
m_tx_iq_mapping_isSet = false;
log2_interp = 0;
m_log2_interp_isSet = false;
fc_pos_tx = 0;
m_fc_pos_tx_isSet = false;
tx_volume = 0.0f;
tx_volume = 0;
m_tx_volume_isSet = false;
cat_speed_index = 0;
m_cat_speed_index_isSet = false;
@ -108,10 +100,6 @@ SWGAudioCATSISOSettings::init() {
m_transverter_delta_frequency_isSet = false;
iq_order = 0;
m_iq_order_isSet = false;
stream_index = 0;
m_stream_index_isSet = false;
spectrum_stream_index = 0;
m_spectrum_stream_index_isSet = false;
tx_enable = 0;
m_tx_enable_isSet = false;
rx_device_name = new QString("");
@ -132,11 +120,7 @@ SWGAudioCATSISOSettings::init() {
m_tx_device_name_isSet = false;
tx_iq_mapping = 0;
m_tx_iq_mapping_isSet = false;
log2_interp = 0;
m_log2_interp_isSet = false;
fc_pos_tx = 0;
m_fc_pos_tx_isSet = false;
tx_volume = 0.0f;
tx_volume = 0;
m_tx_volume_isSet = false;
cat_speed_index = 0;
m_cat_speed_index_isSet = false;
@ -170,8 +154,6 @@ SWGAudioCATSISOSettings::cleanup() {
if(rx_device_name != nullptr) {
delete rx_device_name;
}
@ -194,8 +176,6 @@ SWGAudioCATSISOSettings::cleanup() {
if(reverse_api_address != nullptr) {
delete reverse_api_address;
}
@ -224,10 +204,6 @@ SWGAudioCATSISOSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&iq_order, pJson["iqOrder"], "qint32", "");
::SWGSDRangel::setValue(&stream_index, pJson["streamIndex"], "qint32", "");
::SWGSDRangel::setValue(&spectrum_stream_index, pJson["spectrumStreamIndex"], "qint32", "");
::SWGSDRangel::setValue(&tx_enable, pJson["txEnable"], "qint32", "");
::SWGSDRangel::setValue(&rx_device_name, pJson["rxDeviceName"], "QString", "QString");
@ -248,11 +224,7 @@ SWGAudioCATSISOSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&tx_iq_mapping, pJson["txIQMapping"], "qint32", "");
::SWGSDRangel::setValue(&log2_interp, pJson["log2Interp"], "qint32", "");
::SWGSDRangel::setValue(&fc_pos_tx, pJson["fcPosTx"], "qint32", "");
::SWGSDRangel::setValue(&tx_volume, pJson["txVolume"], "float", "");
::SWGSDRangel::setValue(&tx_volume, pJson["txVolume"], "qint32", "");
::SWGSDRangel::setValue(&cat_speed_index, pJson["catSpeedIndex"], "qint32", "");
@ -307,12 +279,6 @@ SWGAudioCATSISOSettings::asJsonObject() {
if(m_iq_order_isSet){
obj->insert("iqOrder", QJsonValue(iq_order));
}
if(m_stream_index_isSet){
obj->insert("streamIndex", QJsonValue(stream_index));
}
if(m_spectrum_stream_index_isSet){
obj->insert("spectrumStreamIndex", QJsonValue(spectrum_stream_index));
}
if(m_tx_enable_isSet){
obj->insert("txEnable", QJsonValue(tx_enable));
}
@ -343,12 +309,6 @@ SWGAudioCATSISOSettings::asJsonObject() {
if(m_tx_iq_mapping_isSet){
obj->insert("txIQMapping", QJsonValue(tx_iq_mapping));
}
if(m_log2_interp_isSet){
obj->insert("log2Interp", QJsonValue(log2_interp));
}
if(m_fc_pos_tx_isSet){
obj->insert("fcPosTx", QJsonValue(fc_pos_tx));
}
if(m_tx_volume_isSet){
obj->insert("txVolume", QJsonValue(tx_volume));
}
@ -439,26 +399,6 @@ SWGAudioCATSISOSettings::setIqOrder(qint32 iq_order) {
this->m_iq_order_isSet = true;
}
qint32
SWGAudioCATSISOSettings::getStreamIndex() {
return stream_index;
}
void
SWGAudioCATSISOSettings::setStreamIndex(qint32 stream_index) {
this->stream_index = stream_index;
this->m_stream_index_isSet = true;
}
qint32
SWGAudioCATSISOSettings::getSpectrumStreamIndex() {
return spectrum_stream_index;
}
void
SWGAudioCATSISOSettings::setSpectrumStreamIndex(qint32 spectrum_stream_index) {
this->spectrum_stream_index = spectrum_stream_index;
this->m_spectrum_stream_index_isSet = true;
}
qint32
SWGAudioCATSISOSettings::getTxEnable() {
return tx_enable;
@ -560,31 +500,11 @@ SWGAudioCATSISOSettings::setTxIqMapping(qint32 tx_iq_mapping) {
}
qint32
SWGAudioCATSISOSettings::getLog2Interp() {
return log2_interp;
}
void
SWGAudioCATSISOSettings::setLog2Interp(qint32 log2_interp) {
this->log2_interp = log2_interp;
this->m_log2_interp_isSet = true;
}
qint32
SWGAudioCATSISOSettings::getFcPosTx() {
return fc_pos_tx;
}
void
SWGAudioCATSISOSettings::setFcPosTx(qint32 fc_pos_tx) {
this->fc_pos_tx = fc_pos_tx;
this->m_fc_pos_tx_isSet = true;
}
float
SWGAudioCATSISOSettings::getTxVolume() {
return tx_volume;
}
void
SWGAudioCATSISOSettings::setTxVolume(float tx_volume) {
SWGAudioCATSISOSettings::setTxVolume(qint32 tx_volume) {
this->tx_volume = tx_volume;
this->m_tx_volume_isSet = true;
}
@ -719,12 +639,6 @@ SWGAudioCATSISOSettings::isSet(){
if(m_iq_order_isSet){
isObjectUpdated = true; break;
}
if(m_stream_index_isSet){
isObjectUpdated = true; break;
}
if(m_spectrum_stream_index_isSet){
isObjectUpdated = true; break;
}
if(m_tx_enable_isSet){
isObjectUpdated = true; break;
}
@ -755,12 +669,6 @@ SWGAudioCATSISOSettings::isSet(){
if(m_tx_iq_mapping_isSet){
isObjectUpdated = true; break;
}
if(m_log2_interp_isSet){
isObjectUpdated = true; break;
}
if(m_fc_pos_tx_isSet){
isObjectUpdated = true; break;
}
if(m_tx_volume_isSet){
isObjectUpdated = true; break;
}

View File

@ -57,12 +57,6 @@ public:
qint32 getIqOrder();
void setIqOrder(qint32 iq_order);
qint32 getStreamIndex();
void setStreamIndex(qint32 stream_index);
qint32 getSpectrumStreamIndex();
void setSpectrumStreamIndex(qint32 spectrum_stream_index);
qint32 getTxEnable();
void setTxEnable(qint32 tx_enable);
@ -93,14 +87,8 @@ public:
qint32 getTxIqMapping();
void setTxIqMapping(qint32 tx_iq_mapping);
qint32 getLog2Interp();
void setLog2Interp(qint32 log2_interp);
qint32 getFcPosTx();
void setFcPosTx(qint32 fc_pos_tx);
float getTxVolume();
void setTxVolume(float tx_volume);
qint32 getTxVolume();
void setTxVolume(qint32 tx_volume);
qint32 getCatSpeedIndex();
void setCatSpeedIndex(qint32 cat_speed_index);
@ -154,12 +142,6 @@ private:
qint32 iq_order;
bool m_iq_order_isSet;
qint32 stream_index;
bool m_stream_index_isSet;
qint32 spectrum_stream_index;
bool m_spectrum_stream_index_isSet;
qint32 tx_enable;
bool m_tx_enable_isSet;
@ -190,13 +172,7 @@ private:
qint32 tx_iq_mapping;
bool m_tx_iq_mapping_isSet;
qint32 log2_interp;
bool m_log2_interp_isSet;
qint32 fc_pos_tx;
bool m_fc_pos_tx_isSet;
float tx_volume;
qint32 tx_volume;
bool m_tx_volume_isSet;
qint32 cat_speed_index;