1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 01:39:05 -05:00

Merge branch 'freq_scanner' of https://github.com/srcejon/sdrangel into freq_scanner

This commit is contained in:
srcejon 2024-03-25 10:29:51 +00:00
commit 655295c2c8
9 changed files with 62 additions and 14 deletions

View File

@ -362,7 +362,7 @@ void ChirpChatMod::applySettings(const ChirpChatModSettings& settings, bool forc
if (getMessageQueueToGUI()) if (getMessageQueueToGUI())
{ {
MsgReportPayloadTime *rpt = MsgReportPayloadTime::create(m_currentPayloadTime); MsgReportPayloadTime *rpt = MsgReportPayloadTime::create(m_currentPayloadTime, symbols.size());
getMessageQueueToGUI()->push(rpt); getMessageQueueToGUI()->push(rpt);
} }
} }
@ -1095,7 +1095,7 @@ void ChirpChatMod::udpRx()
if (getMessageQueueToGUI()) if (getMessageQueueToGUI())
{ {
MsgReportPayloadTime *rpt = MsgReportPayloadTime::create(m_currentPayloadTime); MsgReportPayloadTime *rpt = MsgReportPayloadTime::create(m_currentPayloadTime, symbols.size());
getMessageQueueToGUI()->push(rpt); getMessageQueueToGUI()->push(rpt);
} }
} }

View File

@ -74,16 +74,19 @@ public:
public: public:
float getPayloadTimeMs() const { return m_timeMs; } float getPayloadTimeMs() const { return m_timeMs; }
static MsgReportPayloadTime* create(float timeMs) { std::size_t getNbSymbols() const { return m_nbSymbols; }
return new MsgReportPayloadTime(timeMs); static MsgReportPayloadTime* create(float timeMs, std::size_t nbSymbols) {
return new MsgReportPayloadTime(timeMs, nbSymbols);
} }
private: private:
float m_timeMs; //!< time in milliseconds float m_timeMs; //!< time in milliseconds
std::size_t m_nbSymbols; //!< number of symbols
MsgReportPayloadTime(float timeMs) : MsgReportPayloadTime(float timeMs, std::size_t nbSymbols) :
Message(), Message(),
m_timeMs(timeMs) m_timeMs(timeMs),
m_nbSymbols(nbSymbols)
{} {}
}; };

View File

@ -97,6 +97,7 @@ bool ChirpChatModGUI::handleMessage(const Message& message)
fourthsChirps += m_settings.hasSyncWord() ? 8 : 0; fourthsChirps += m_settings.hasSyncWord() ? 8 : 0;
fourthsChirps += m_settings.getNbSFDFourths(); fourthsChirps += m_settings.getNbSFDFourths();
float controlMs = fourthsChirps * fourthsMs; // preamble + sync word + SFD float controlMs = fourthsChirps * fourthsMs; // preamble + sync word + SFD
ui->timeMessageLengthText->setText(tr("%1").arg(rpt.getNbSymbols()));
ui->timePayloadText->setText(tr("%1 ms").arg(QString::number(rpt.getPayloadTimeMs(), 'f', 0))); ui->timePayloadText->setText(tr("%1 ms").arg(QString::number(rpt.getPayloadTimeMs(), 'f', 0)));
ui->timeTotalText->setText(tr("%1 ms").arg(QString::number(rpt.getPayloadTimeMs() + controlMs, 'f', 0))); ui->timeTotalText->setText(tr("%1 ms").arg(QString::number(rpt.getPayloadTimeMs() + controlMs, 'f', 0)));
ui->timeSymbolText->setText(tr("%1 ms").arg(QString::number(4.0*fourthsMs, 'f', 1))); ui->timeSymbolText->setText(tr("%1 ms").arg(QString::number(4.0*fourthsMs, 'f', 1)));

View File

@ -722,12 +722,12 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLineEdit" name="report"> <widget class="QLineEdit" name="myLocator">
<property name="focusPolicy"> <property name="focusPolicy">
<enum>Qt::ClickFocus</enum> <enum>Qt::ClickFocus</enum>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Report to callee</string> <string>Caller QRA locator</string>
</property> </property>
<property name="text"> <property name="text">
<string/> <string/>
@ -751,12 +751,12 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLineEdit" name="myLocator"> <widget class="QLineEdit" name="report">
<property name="focusPolicy"> <property name="focusPolicy">
<enum>Qt::ClickFocus</enum> <enum>Qt::ClickFocus</enum>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Caller QRA locator</string> <string>Report to callee</string>
</property> </property>
<property name="text"> <property name="text">
<string/> <string/>
@ -1028,6 +1028,23 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QLabel" name="timeMessageLengthLabel">
<property name="text">
<string>ML</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="timeMessageLengthText">
<property name="text">
<string>000</string>
</property>
</widget>
</item>
<item> <item>
<spacer name="horizontalSpacer_6"> <spacer name="horizontalSpacer_6">
<property name="orientation"> <property name="orientation">

View File

@ -25,7 +25,7 @@
#include "audiocatoutputworker.h" #include "audiocatoutputworker.h"
#define AUDIOOUTPUT_THROTTLE_MS 50 #define AUDIOOUTPUT_THROTTLE_MS 100
AudioCATOutputWorker::AudioCATOutputWorker(SampleMOFifo* sampleFifo, AudioFifo *fifo, QObject* parent) : AudioCATOutputWorker::AudioCATOutputWorker(SampleMOFifo* sampleFifo, AudioFifo *fifo, QObject* parent) :
QObject(parent), QObject(parent),
@ -41,7 +41,7 @@ AudioCATOutputWorker::AudioCATOutputWorker(SampleMOFifo* sampleFifo, AudioFifo *
m_sampleFifo(sampleFifo), m_sampleFifo(sampleFifo),
m_audioFifo(fifo) m_audioFifo(fifo)
{ {
m_audioBuffer.resize(1<<15); m_audioBuffer.resize(12000);
m_audioBufferFill = 0; m_audioBufferFill = 0;
setSamplerate(48000); setSamplerate(48000);
} }

View File

@ -46,7 +46,7 @@ MESSAGE_CLASS_DEFINITION(AudioCATSISO::MsgStartStop, Message)
AudioCATSISO::AudioCATSISO(DeviceAPI *deviceAPI) : AudioCATSISO::AudioCATSISO(DeviceAPI *deviceAPI) :
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_inputFifo(48000), m_inputFifo(48000),
m_outputFifo(48000), m_outputFifo(24000),
m_settings(), m_settings(),
m_inputWorker(nullptr), m_inputWorker(nullptr),
m_outputWorker(nullptr), m_outputWorker(nullptr),

View File

@ -257,6 +257,14 @@ void AudioCATSISOGUI::on_streamLock_toggled(bool checked)
} }
} }
void AudioCATSISOGUI::on_freqRxToTx_clicked()
{
m_settings.m_txCenterFrequency = m_settings.m_rxCenterFrequency;
displayFrequency();
m_settingsKeys.append("txCenterFrequency");
sendSettings();
}
void AudioCATSISOGUI::on_centerFrequency_changed(quint64 value) void AudioCATSISOGUI::on_centerFrequency_changed(quint64 value)
{ {
if (m_rxElseTx) if (m_rxElseTx)
@ -771,7 +779,8 @@ void AudioCATSISOGUI::makeUIConnections()
QObject::connect(ui->streamSide, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &AudioCATSISOGUI::on_streamSide_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->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->streamLock, &QToolButton::toggled, this, &AudioCATSISOGUI::on_streamLock_toggled);
QObject::connect(ui->startStop, &ButtonSwitch::toggled, this, &AudioCATSISOGUI::on_startStop_toggled); QObject::connect(ui->freqRxToTx, &QPushButton::clicked, this, &AudioCATSISOGUI::on_freqRxToTx_clicked);
QObject::connect(ui->startStop, &ButtonSwitch::toggled, this, &AudioCATSISOGUI::on_startStop_toggled);
QObject::connect(ui->ptt, &ButtonSwitch::toggled, this, &AudioCATSISOGUI::on_ptt_toggled); QObject::connect(ui->ptt, &ButtonSwitch::toggled, this, &AudioCATSISOGUI::on_ptt_toggled);
QObject::connect(ui->catConnect, &ButtonSwitch::toggled, this, &AudioCATSISOGUI::on_catConnect_toggled); QObject::connect(ui->catConnect, &ButtonSwitch::toggled, this, &AudioCATSISOGUI::on_catConnect_toggled);
QObject::connect(ui->centerFrequency, &ValueDial::changed, this, &AudioCATSISOGUI::on_centerFrequency_changed); QObject::connect(ui->centerFrequency, &ValueDial::changed, this, &AudioCATSISOGUI::on_centerFrequency_changed);

View File

@ -89,6 +89,7 @@ private slots:
void on_streamSide_currentIndexChanged(int index); void on_streamSide_currentIndexChanged(int index);
void on_spectrumSide_currentIndexChanged(int index); void on_spectrumSide_currentIndexChanged(int index);
void on_streamLock_toggled(bool checked); void on_streamLock_toggled(bool checked);
void on_freqRxToTx_clicked();
void on_startStop_toggled(bool checked); void on_startStop_toggled(bool checked);
void on_ptt_toggled(bool checked); void on_ptt_toggled(bool checked);
void on_pttSpectrumLinkToggled(bool checked); void on_pttSpectrumLinkToggled(bool checked);

View File

@ -160,6 +160,23 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QPushButton" name="freqRxToTx">
<property name="toolTip">
<string>Send Rx frequency to Tx</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../sdrgui/resources/res.qrc">
<normaloff>:/arrow_left.png</normaloff>:/arrow_left.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item> <item>
<widget class="ButtonSwitch" name="txEnable"> <widget class="ButtonSwitch" name="txEnable">
<property name="toolTip"> <property name="toolTip">