26 #include "ui_udpsinkgui.h" 140 ui->channelPower->setText(QString::number(powDb,
'f', 1));
143 ui->inputPower->setText(QString::number(inPowDb,
'f', 1));
147 ui->squelchLabel->setStyleSheet(
"QLabel { background-color : green; }");
149 ui->squelchLabel->setStyleSheet(
"QLabel { background:rgb(79,79,79); }");
170 connect(
this, SIGNAL(customContextMenuRequested(
const QPoint &)),
this, SLOT(
onMenuDialogCalled(
const QPoint &)));
171 setAttribute(Qt::WA_DeleteOnClose,
true);
178 ui->fmDeviation->setEnabled(
false);
180 ui->deltaFrequencyLabel->setText(QString(
"%1f").
arg(QChar(0x94, 0x03)));
182 ui->deltaFrequency->setValueRange(
false, 7, -9999999, 9999999);
183 ui->squelchLabel->setStyleSheet(
"QLabel { background:rgb(79,79,79); }");
185 ui->glSpectrum->setCenterFrequency(0);
186 ui->glSpectrum->setSampleRate(
ui->sampleRate->text().toInt());
187 ui->glSpectrum->setDisplayWaterfall(
true);
188 ui->glSpectrum->setDisplayMaxHold(
true);
265 ui->squelchText->setText(tr(
"%1").
arg(
ui->squelch->value()*1.0, 0,
'f', 0));
279 ui->volumeText->setText(QString(
"%1").
arg(
ui->volume->value()));
282 ui->gainText->setText(tr(
"%1").
arg(
ui->gain->value()/10.0, 0,
'f', 1));
284 ui->applyBtn->setEnabled(
false);
285 ui->applyBtn->setStyleSheet(
"QPushButton { background:rgb(79,79,79); }");
297 ui->sampleFormat->setCurrentIndex(0);
300 ui->sampleFormat->setCurrentIndex(1);
303 ui->sampleFormat->setCurrentIndex(2);
306 ui->sampleFormat->setCurrentIndex(3);
309 ui->sampleFormat->setCurrentIndex(4);
312 ui->sampleFormat->setCurrentIndex(5);
315 ui->sampleFormat->setCurrentIndex(6);
318 ui->sampleFormat->setCurrentIndex(7);
321 ui->sampleFormat->setCurrentIndex(8);
324 ui->sampleFormat->setCurrentIndex(9);
327 ui->sampleFormat->setCurrentIndex(10);
330 ui->sampleFormat->setCurrentIndex(0);
341 ui->fmDeviation->setEnabled(
false);
345 ui->fmDeviation->setEnabled(
false);
349 ui->fmDeviation->setEnabled(
true);
353 ui->fmDeviation->setEnabled(
true);
357 ui->fmDeviation->setEnabled(
false);
361 ui->fmDeviation->setEnabled(
false);
365 ui->fmDeviation->setEnabled(
false);
369 ui->fmDeviation->setEnabled(
false);
373 ui->fmDeviation->setEnabled(
false);
377 ui->fmDeviation->setEnabled(
false);
381 ui->fmDeviation->setEnabled(
false);
385 ui->fmDeviation->setEnabled(
false);
410 ui->applyBtn->setEnabled(
false);
411 ui->applyBtn->setStyleSheet(
"QPushButton { background:rgb(79,79,79); }");
424 if ((index == 1) || (index == 2)) {
425 ui->fmDeviation->setEnabled(
true);
427 ui->fmDeviation->setEnabled(
false);
432 ui->applyBtn->setEnabled(
true);
433 ui->applyBtn->setStyleSheet(
"QPushButton { background-color : green; }");
439 ui->applyBtn->setEnabled(
true);
440 ui->applyBtn->setStyleSheet(
"QPushButton { background-color : green; }");
446 quint16 udpPort =
ui->outputUDPPort->text().toInt(&ok);
448 if((!ok) || (udpPort < 1024)) {
455 ui->applyBtn->setEnabled(
true);
456 ui->applyBtn->setStyleSheet(
"QPushButton { background-color : green; }");
462 quint16 udpPort =
ui->inputUDPAudioPort->text().toInt(&ok);
464 if((!ok) || (udpPort < 1024)) {
471 ui->applyBtn->setEnabled(
true);
472 ui->applyBtn->setStyleSheet(
"QPushButton { background-color : green; }");
479 Real outputSampleRate =
ui->sampleRate->text().toDouble(&ok);
481 if((!ok) || (outputSampleRate < 1000))
484 ui->sampleRate->setText(QString(
"%1").
arg(outputSampleRate, 0));
491 ui->applyBtn->setEnabled(
true);
492 ui->applyBtn->setStyleSheet(
"QPushButton { background-color : green; }");
499 Real rfBandwidth =
ui->rfBandwidth->text().toDouble(&ok);
513 ui->applyBtn->setEnabled(
true);
514 ui->applyBtn->setStyleSheet(
"QPushButton { background-color : green; }");
521 int fmDeviation =
ui->fmDeviation->text().toInt(&ok);
523 if ((!ok) || (fmDeviation < 1))
533 ui->applyBtn->setEnabled(
true);
534 ui->applyBtn->setStyleSheet(
"QPushButton { background-color : green; }");
571 ui->gainText->setText(tr(
"%1").
arg(value/10.0, 0,
'f', 1));
578 ui->volumeText->setText(QString(
"%1").
arg(value));
588 ui->squelchText->setText(
"---");
593 ui->squelchText->setText(tr(
"%1").
arg(value*1.0, 0,
'f', 0));
603 ui->squelchGateText->setText(tr(
"%1").
arg(value*10.0, 0,
'f', 0));
609 if ((widget ==
ui->spectrumBox) && (
m_udpSink != 0))
void leaveEvent(QEvent *)
QByteArray serialize() const
static MainWindow * getInstance()
const QString & getReverseAPIAddress() const
void handleSourceMessages()
void onWidgetRolled(QWidget *widget, bool rollDown)
int getCenterFrequency() const
bool deserialize(const QByteArray &data)
void push(Message *message, bool emitSignal=true)
Push message onto queue.
void on_rfBandwidth_textEdited(const QString &arg1)
static double dbPower(double magsq, double floor=1e-12)
bool getSquelchOpen() const
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
void on_deltaFrequency_changed(qint64 value)
void on_sampleFormat_currentIndexChanged(int index)
void on_audioStereo_toggled(bool stereo)
virtual qint64 getCenterFrequency() const
uint16_t m_reverseAPIPort
void setReverseAPIChannelIndex(uint16_t channelIndex)
uint16_t getReverseAPIPort() const
void on_sampleRate_textEdited(const QString &arg1)
bool m_rfBandwidthChanged
void addChannelMarker(ChannelMarker *channelMarker)
Add channel marker to spectrum.
void setSpectrum(BasebandSampleSink *spectrum)
void applySettingsImmediate(bool force=false)
double getInMagSq() const
void on_squelchGate_valueChanged(int value)
virtual void setCenterFrequency(qint64 centerFrequency)
void on_inputUDPAudioPort_editingFinished()
int m_squelchGate
100ths seconds
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
void setReverseAPIDeviceIndex(uint16_t deviceIndex)
uint16_t getReverseAPIDeviceIndex() const
QByteArray serialize() const
ChannelMarker m_channelMarker
void on_applyBtn_clicked()
void blockApplySettings(bool block)
uint16_t m_reverseAPIDeviceIndex
virtual void setMessageQueueToGUI(MessageQueue *queue)
static UDPSinkGUI * create(PluginAPI *pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel)
void setHighlighted(bool highlighted)
void registerRxChannelInstance(const QString &channelName, PluginInstanceGUI *pluginGUI)
void addRollupWidget(QWidget *widget)
Add rollup widget to channel window.
void removeRxChannelInstance(PluginInstanceGUI *pluginGUI)
const QString & getTitle() const
bool useReverseAPI() const
static bool match(const Message *message)
bool getHighlighted() const
void setName(const QString &name)
DeviceUISet * m_deviceUISet
void setSpectrumGUI(Serializable *spectrumGUI)
void setSampleFormat(int index)
void on_fmDeviation_textEdited(const QString &arg1)
void on_agc_toggled(bool agc)
bool deserialize(const QByteArray &data)
uint16_t m_reverseAPIChannelIndex
SampleFormat m_sampleFormat
void setReverseAPIAddress(const QString &address)
void applySettings(bool force=false)
void on_volume_valueChanged(int value)
void setColor(const QColor &color)
void enterEvent(QEvent *)
void on_outputUDPPort_editingFinished()
void on_gain_valueChanged(int value)
UDPSinkGUI(PluginAPI *pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget *parent=0)
MovingAverage< double > m_inPowerAvg
void setVisible(bool visible)
void channelMarkerHighlightedByCursor()
void setReverseAPIPort(uint16_t port)
uint16_t getReverseAPIChannelIndex() const
void configure(MessageQueue *msgQueue, int fftSize, int overlapPercent, unsigned int averagingNb, int averagingMode, FFTWindow::Function window, bool m_linear)
void setBandwidth(int bandwidth)
void onMenuDialogCalled(const QPoint &p)
const QColor & getColor() const
void setTitle(const QString &title)
void channelMarkerChangedByCursor()
int64_t m_inputFrequencyOffset
void on_squelch_valueChanged(int value)
void setCenterFrequency(int centerFrequency)
virtual MessageQueue * getInputMessageQueue()
static const QString m_channelIdURI
MovingAverage< double > m_channelPowerAvg
virtual bool handleMessage(const Message &message)
UDPSinkSettings m_settings
void setUseReverseAPI(bool useReverseAPI)
void setChannelMarker(Serializable *channelMarker)
QString m_reverseAPIAddress
void on_audioActive_toggled(bool active)
SpectrumVis * m_spectrumVis
void setSampleFormatIndex(const UDPSinkSettings::SampleFormat &sampleFormat)
void on_outputUDPAddress_editingFinished()