29 #include "ui_udpsourcegui.h" 129 connect(
this, SIGNAL(customContextMenuRequested(
const QPoint &)),
this, SLOT(
onMenuDialogCalled(
const QPoint &)));
130 setAttribute(Qt::WA_DeleteOnClose,
true);
137 ui->fmDeviation->setEnabled(
false);
138 ui->deltaFrequencyLabel->setText(QString(
"%1f").
arg(QChar(0x94, 0x03)));
140 ui->deltaFrequency->setValueRange(
false, 7, -9999999, 9999999);
142 ui->glSpectrum->setCenterFrequency(0);
143 ui->glSpectrum->setSampleRate(
ui->sampleRate->text().toInt());
144 ui->glSpectrum->setDisplayWaterfall(
true);
145 ui->glSpectrum->setDisplayMaxHold(
true);
175 connect(
m_udpSource, SIGNAL(levelChanged(qreal, qreal,
int)),
ui->volumeMeter, SLOT(levelChanged(qreal, qreal,
int)));
206 ui->applyBtn->setEnabled(
false);
207 ui->applyBtn->setStyleSheet(
"QPushButton { background:rgb(79,79,79); }");
246 ui->squelchText->setText(
"---");
257 ui->applyBtn->setEnabled(
false);
258 ui->applyBtn->setStyleSheet(
"QPushButton { background:rgb(79,79,79); }");
280 ui->fmDeviation->setEnabled(
true);
282 ui->fmDeviation->setEnabled(
false);
286 ui->amModPercent->setEnabled(
true);
288 ui->amModPercent->setEnabled(
false);
293 ui->applyBtn->setEnabled(
true);
294 ui->applyBtn->setStyleSheet(
"QPushButton { background-color : green; }");
300 ui->applyBtn->setEnabled(
true);
301 ui->applyBtn->setStyleSheet(
"QPushButton { background-color : green; }");
307 quint16 udpPort =
ui->localUDPPort->text().toInt(&ok);
309 if((!ok) || (udpPort < 1024)) {
316 ui->applyBtn->setEnabled(
true);
317 ui->applyBtn->setStyleSheet(
"QPushButton { background-color : green; }");
324 Real inputSampleRate =
ui->sampleRate->text().toDouble(&ok);
326 if ((!ok) || (inputSampleRate < 1000)) {
333 ui->applyBtn->setEnabled(
true);
334 ui->applyBtn->setStyleSheet(
"QPushButton { background-color : green; }");
341 Real rfBandwidth =
ui->rfBandwidth->text().toDouble(&ok);
355 ui->applyBtn->setEnabled(
true);
356 ui->applyBtn->setStyleSheet(
"QPushButton { background-color : green; }");
363 int fmDeviation =
ui->fmDeviation->text().toInt(&ok);
365 if ((!ok) || (fmDeviation < 1)) {
372 ui->applyBtn->setEnabled(
true);
373 ui->applyBtn->setStyleSheet(
"QPushButton { background-color : green; }");
380 int amModPercent =
ui->amModPercent->text().toInt(&ok);
382 if ((!ok) || (amModPercent < 1) || (amModPercent > 100))
385 ui->amModPercent->setText(QString(
"%1").
arg(95));
390 ui->applyBtn->setEnabled(
true);
391 ui->applyBtn->setStyleSheet(
"QPushButton { background-color : green; }");
416 ui->squelchText->setText(
"---");
425 ui->squelchGateText->setText(tr(
"%1").
arg(roundf(value * 10.0), 0,
'f', 0));
522 ui->channelPower->setText(tr(
"%1 dB").
arg(powDb, 0,
'f', 1));
524 ui->inputPower->setText(tr(
"%1").
arg(inPowDb, 0,
'f', 1));
528 ui->bufferGaugeNegative->setValue((bufferGauge < 0 ? -bufferGauge : 0));
529 ui->bufferGaugePositive->setValue((bufferGauge < 0 ? 0 : bufferGauge));
530 QString s = QString::number(bufferGauge,
'f', 0);
531 ui->bufferRWBalanceText->setText(tr(
"%1").
arg(s));
534 ui->channelMute->setStyleSheet(
"QToolButton { background-color : green; }");
536 ui->channelMute->setStyleSheet(
"QToolButton { background:rgb(79,79,79); }");
547 ui->sampleFormat->setCurrentIndex(0);
548 ui->fmDeviation->setEnabled(
false);
549 ui->stereoInput->setChecked(
true);
550 ui->stereoInput->setEnabled(
false);
553 ui->sampleFormat->setCurrentIndex(1);
554 ui->fmDeviation->setEnabled(
true);
555 ui->stereoInput->setEnabled(
true);
558 ui->sampleFormat->setCurrentIndex(2);
559 ui->fmDeviation->setEnabled(
false);
560 ui->stereoInput->setEnabled(
true);
563 ui->sampleFormat->setCurrentIndex(3);
564 ui->fmDeviation->setEnabled(
false);
565 ui->stereoInput->setEnabled(
true);
568 ui->sampleFormat->setCurrentIndex(4);
569 ui->fmDeviation->setEnabled(
false);
570 ui->stereoInput->setEnabled(
true);
573 ui->sampleFormat->setCurrentIndex(0);
574 ui->fmDeviation->setEnabled(
false);
575 ui->stereoInput->setChecked(
true);
576 ui->stereoInput->setEnabled(
false);
587 ui->fmDeviation->setEnabled(
false);
588 ui->stereoInput->setChecked(
true);
589 ui->stereoInput->setEnabled(
false);
593 ui->fmDeviation->setEnabled(
true);
594 ui->stereoInput->setEnabled(
true);
598 ui->fmDeviation->setEnabled(
false);
599 ui->stereoInput->setEnabled(
true);
603 ui->fmDeviation->setEnabled(
false);
604 ui->stereoInput->setEnabled(
true);
608 ui->fmDeviation->setEnabled(
false);
609 ui->stereoInput->setEnabled(
true);
613 ui->fmDeviation->setEnabled(
false);
614 ui->stereoInput->setChecked(
true);
615 ui->stereoInput->setEnabled(
false);
void removeTxChannelInstance(PluginInstanceGUI *pluginGUI)
double getInMagSq() const
static MainWindow * getInstance()
void enterEvent(QEvent *)
const QString & getReverseAPIAddress() const
void on_amModPercent_textEdited(const QString &arg1)
void on_rfBandwidth_textEdited(const QString &arg1)
int getCenterFrequency() const
virtual bool deserialize(const QByteArray &data)
void registerTxChannelInstance(const QString &channelName, PluginInstanceGUI *pluginGUI)
virtual void setCenterFrequency(qint64 centerFrequency)
void push(Message *message, bool emitSignal=true)
Push message onto queue.
void on_applyBtn_clicked()
static double dbPower(double magsq, double floor=1e-12)
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
void blockApplySettings(bool block)
virtual void resetToDefaults()
DeviceUISet * m_deviceUISet
static const QString m_channelIdURI
void on_deltaFrequency_changed(qint64 value)
void on_squelchGate_valueChanged(int value)
void leaveEvent(QEvent *)
static UDPSourceGUI * create(PluginAPI *pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSource *channelTx)
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
void setReverseAPIChannelIndex(uint16_t channelIndex)
uint16_t getReverseAPIPort() const
void addChannelMarker(ChannelMarker *channelMarker)
Add channel marker to spectrum.
MovingAverageUtil< double, double, 4 > m_inPowerAvg
bool getSquelchOpen() const
virtual QByteArray serialize() const
void setSpectrum(bool enabled)
virtual MessageQueue * getInputMessageQueue()
void on_localUDPPort_editingFinished()
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Real m_squelch
squared magnitude
void setReverseAPIDeviceIndex(uint16_t deviceIndex)
uint16_t getReverseAPIDeviceIndex() const
bool m_rfBandwidthChanged
qint64 m_inputFrequencyOffset
int32_t getBufferGauge() const
void on_sampleRate_textEdited(const QString &arg1)
void setSourceOrSinkStream(bool sourceOrSinkStream)
void setName(const QString &name)
QString m_reverseAPIAddress
void setHighlighted(bool highlighted)
void addRollupWidget(QWidget *widget)
Add rollup widget to channel window.
virtual void setMessageQueueToGUI(MessageQueue *queue)
void handleSourceMessages()
const QString & getTitle() const
bool useReverseAPI() const
static bool match(const Message *message)
QByteArray serialize() const
bool deserialize(const QByteArray &data)
uint16_t m_reverseAPIPort
void setSpectrumSink(BasebandSampleSink *spectrum)
void setSampleFormat(int index)
uint16_t m_reverseAPIDeviceIndex
void on_gainIn_valueChanged(int value)
void on_squelch_valueChanged(int value)
void onWidgetRolled(QWidget *widget, bool rollDown)
void on_sampleFormat_currentIndexChanged(int index)
virtual bool handleMessage(const Message &message)
void setSampleFormatIndex(const UDPSourceSettings::SampleFormat &sampleFormat)
void on_localUDPAddress_editingFinished()
void setReverseAPIAddress(const QString &address)
MovingAverageUtil< double, double, 4 > m_channelPowerAvg
uint16_t m_reverseAPIChannelIndex
void setColor(const QColor &color)
SpectrumVis * m_spectrumVis
UDPSourceSettings m_settings
virtual qint64 getCenterFrequency() const
void setVisible(bool visible)
void setReverseAPIPort(uint16_t port)
Real m_squelchGate
seconds
void onMenuDialogCalled(const QPoint &p)
ChannelMarker m_channelMarker
uint16_t getReverseAPIChannelIndex() const
void configure(MessageQueue *msgQueue, int fftSize, int overlapPercent, unsigned int averagingNb, int averagingMode, FFTWindow::Function window, bool m_linear)
void channelMarkerChangedByCursor()
SampleFormat m_sampleFormat
void setBandwidth(int bandwidth)
const QColor & getColor() const
void setTitle(const QString &title)
void on_stereoInput_toggled(bool checked)
UDPSourceGUI(PluginAPI *pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSource *channelTx, QWidget *parent=NULL)
void on_autoRWBalance_toggled(bool checked)
void setCenterFrequency(int centerFrequency)
void on_channelMute_toggled(bool checked)
void on_gainOut_valueChanged(int value)
void setUseReverseAPI(bool useReverseAPI)
void on_resetUDPReadIndex_clicked()
void applySettings(bool force=false)
void on_fmDeviation_textEdited(const QString &arg1)