7 #include "ui_ssbdemodgui.h" 85 qDebug(
"SSBDemodGUI::handleMessage: SSBDemod::MsgConfigureSSBDemod");
146 ui->flipSidebands->setEnabled(!dsb);
171 ui->volumeText->setText(QString(
"%1").
arg(value / 10.0, 0,
'f', 1));
190 QString s = QString::number((1<<value),
'f', 0);
191 ui->agcTimeText->setText(s);
205 int agcThresholdGate = value < 20 ? value : ((value - 20) * 10) + 20;
206 QString s = QString::number(agcThresholdGate,
'f', 0);
207 ui->agcThresholdGateText->setText(s);
221 if ((value < 0) || (value > 4)) {
231 int bwValue =
ui->BW->value();
232 int lcValue =
ui->lowCut->value();
233 ui->BW->setValue(-bwValue);
234 ui->lowCut->setValue(-lcValue);
289 setAttribute(Qt::WA_DeleteOnClose,
true);
291 connect(
this, SIGNAL(customContextMenuRequested(
const QPoint &)),
this, SLOT(
onMenuDialogCalled(
const QPoint &)));
299 connect(audioMuteRightClickEnabler, SIGNAL(rightClick(
const QPoint &)),
this, SLOT(
audioSelect()));
301 ui->deltaFrequencyLabel->setText(QString(
"%1f").
arg(QChar(0x94, 0x03)));
303 ui->deltaFrequency->setValueRange(
false, 7, -9999999, 9999999);
308 ui->glSpectrum->setDisplayWaterfall(
true);
309 ui->glSpectrum->setDisplayMaxHold(
true);
310 ui->glSpectrum->setSsbSpectrum(
true);
338 m_iconDSBUSB.addPixmap(QPixmap(
"://dsb.png"), QIcon::Normal, QIcon::On);
339 m_iconDSBUSB.addPixmap(QPixmap(
"://usb.png"), QIcon::Normal, QIcon::Off);
340 m_iconDSBLSB.addPixmap(QPixmap(
"://dsb.png"), QIcon::Normal, QIcon::On);
341 m_iconDSBLSB.addPixmap(QPixmap(
"://lsb.png"), QIcon::Normal, QIcon::Off);
388 bool dsb =
ui->dsb->isChecked();
391 int bw =
ui->BW->value();
392 int lw =
ui->lowCut->value();
395 tickInterval = tickInterval == 0 ? 1 : tickInterval;
397 qDebug() <<
"SSBDemodGUI::applyBandwidths:" 399 <<
" spanLog2: " << spanLog2
403 <<
" bwMax: " << bwMax
404 <<
" tickInterval: " << tickInterval;
406 ui->BW->setTickInterval(tickInterval);
407 ui->lowCut->setTickInterval(tickInterval);
409 bw = bw < -bwMax ? -bwMax : bw > bwMax ? bwMax : bw;
412 lw = lw < bw+1 ? bw+1 : lw < 0 ? lw : 0;
414 lw = lw > bw-1 ? bw-1 : lw < 0 ? 0 : lw;
421 bw = bw < 0 ? -bw : bw;
425 QString spanStr = QString::number(bwMax/10.0,
'f', 1);
426 QString bwStr = QString::number(bw/10.0,
'f', 1);
427 QString lwStr = QString::number(lw/10.0,
'f', 1);
431 ui->BWText->setText(tr(
"%1%2k").
arg(QChar(0xB1, 0x00)).
arg(bwStr));
432 ui->spanText->setText(tr(
"%1%2k").
arg(QChar(0xB1, 0x00)).
arg(spanStr));
433 ui->scaleMinus->setText(
"0");
434 ui->scaleCenter->setText(
"");
435 ui->scalePlus->setText(tr(
"%1").
arg(QChar(0xB1, 0x00)));
436 ui->lsbLabel->setText(
"");
437 ui->usbLabel->setText(
"");
438 ui->glSpectrum->setCenterFrequency(0);
440 ui->glSpectrum->setSsbSpectrum(
false);
441 ui->glSpectrum->setLsbDisplay(
false);
445 ui->BWText->setText(tr(
"%1k").
arg(bwStr));
446 ui->spanText->setText(tr(
"%1k").
arg(spanStr));
447 ui->scaleMinus->setText(
"-");
448 ui->scaleCenter->setText(
"0");
449 ui->scalePlus->setText(
"+");
450 ui->lsbLabel->setText(
"LSB");
451 ui->usbLabel->setText(
"USB");
454 ui->glSpectrum->setSsbSpectrum(
true);
455 ui->glSpectrum->setLsbDisplay(bw < 0);
458 ui->lowCutText->setText(tr(
"%1k").
arg(lwStr));
461 ui->BW->blockSignals(
true);
462 ui->lowCut->blockSignals(
true);
464 ui->BW->setMaximum(bwMax);
465 ui->BW->setMinimum(dsb ? 0 : -bwMax);
466 ui->BW->setValue(bw);
468 ui->lowCut->setMaximum(dsb ? 0 : bwMax);
469 ui->lowCut->setMinimum(dsb ? 0 : -bwMax);
470 ui->lowCut->setValue(lw);
472 ui->lowCut->blockSignals(
false);
473 ui->BW->blockSignals(
false);
532 ui->spanLog2->blockSignals(
true);
533 ui->dsb->blockSignals(
true);
534 ui->BW->blockSignals(
true);
544 ui->BWText->setText(tr(
"%1%2k").
arg(QChar(0xB1, 0x00)).
arg(s));
548 ui->BWText->setText(tr(
"%1k").
arg(s));
551 ui->spanLog2->blockSignals(
false);
552 ui->dsb->blockSignals(
false);
553 ui->BW->blockSignals(
false);
564 s = QString::number((1<<
ui->agcTimeLog2->value()),
'f', 0);
565 ui->agcTimeText->setText(s);
578 ui->agcPowerThresholdText->setText(
"---");
582 QString s = QString::number(value,
'f', 0);
583 ui->agcPowerThresholdText->setText(s);
589 QString s = QString::number(value,
'f', 0);
590 ui->agcThresholdGateText->setText(s);
591 int dialValue = value;
594 dialValue = ((value - 20) / 10) + 20;
597 ui->agcThresholdGate->setValue(dialValue);
612 qDebug(
"SSBDemodGUI::audioSelect");
625 double magsqAvg, magsqPeak;
631 ui->channelPowerMeter->levelChanged(
637 ui->channelPower->setText(tr(
"%1 dB").
arg(powDbAvg, 0,
'f', 1));
645 ui->audioMute->setStyleSheet(
"QToolButton { background-color : green; }");
647 ui->audioMute->setStyleSheet(
"QToolButton { background:rgb(79,79,79); }");
static MainWindow * getInstance()
const QString & getReverseAPIAddress() const
void on_agcPowerThreshold_valueChanged(int value)
int getCenterFrequency() const
void setLowCutoff(int lowCutoff)
void on_dsb_toggled(bool dsb)
uint16_t m_reverseAPIPort
void push(Message *message, bool emitSignal=true)
Push message onto queue.
void on_audioMute_toggled(bool checked)
void on_audioFlipChannels_toggled(bool flip)
void on_audioBinaural_toggled(bool binaural)
static double dbPower(double magsq, double floor=1e-12)
void channelMarkerChangedByCursor()
virtual void setCenterFrequency(qint64 centerFrequency)
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
int spanLog2Limit(int spanLog2)
virtual qint64 getCenterFrequency() const
virtual bool handleMessage(const Message &message)
QByteArray serialize() const
static SSBDemodGUI * create(PluginAPI *pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel)
SpectrumVis * m_spectrumVis
static const QString m_channelIdURI
QString m_audioDeviceName
static const int m_minPowerThresholdDB
void setReverseAPIChannelIndex(uint16_t channelIndex)
QByteArray serialize() const
uint16_t getReverseAPIPort() const
void addChannelMarker(ChannelMarker *channelMarker)
Add channel marker to spectrum.
SSBDemodGUI(PluginAPI *pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget *parent=0)
void getMagSqLevels(double &avg, double &peak, int &nbSamples)
void on_agcThresholdGate_valueChanged(int value)
void applySettings(bool force=false)
ChannelMarker m_channelMarker
void on_spanLog2_valueChanged(int value)
bool deserialize(const QByteArray &data)
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
void setReverseAPIDeviceIndex(uint16_t deviceIndex)
uint16_t getReverseAPIDeviceIndex() const
void displayAGCPowerThreshold(int value)
void setSampleSink(BasebandSampleSink *sampleSink)
SSBDemodSettings m_settings
virtual void setMessageQueueToGUI(MessageQueue *queue)
static DSPEngine * instance()
void setHighlighted(bool highlighted)
void applyBandwidths(int spanLog2, bool force=false)
void handleInputMessages()
void registerRxChannelInstance(const QString &channelName, PluginInstanceGUI *pluginGUI)
bool deserialize(const QByteArray &data)
void addRollupWidget(QWidget *widget)
Add rollup widget to channel window.
void removeRxChannelInstance(PluginInstanceGUI *pluginGUI)
const QString & getTitle() const
bool blockApplySettings(bool block)
bool useReverseAPI() const
static bool match(const Message *message)
bool getHighlighted() const
void on_agcTimeLog2_valueChanged(int value)
void on_BW_valueChanged(int value)
void leaveEvent(QEvent *)
void on_agc_toggled(bool checked)
uint16_t m_reverseAPIDeviceIndex
QString m_audioDeviceName
void on_lowCut_valueChanged(int value)
void displayAGCThresholdGate(int value)
uint32_t getAudioSampleRate() const
void setReverseAPIAddress(const QString &address)
uint16_t m_reverseAPIChannelIndex
qint32 m_inputFrequencyOffset
void setSpectrumGUI(Serializable *spectrumGUI)
void setColor(const QColor &color)
uint32_t getInputSampleRate() const
void setVisible(bool visible)
void setReverseAPIPort(uint16_t port)
void on_volume_valueChanged(int value)
bool getAudioActive() const
void on_agcClamping_toggled(bool checked)
uint16_t getReverseAPIChannelIndex() const
void setBandwidth(int bandwidth)
QString m_reverseAPIAddress
void on_deltaFrequency_changed(qint64 value)
const QColor & getColor() const
void setTitle(const QString &title)
void setName(const QString &name)
void channelMarkerHighlightedByCursor()
static const float m_mminPowerThresholdDBf
void setCenterFrequency(int centerFrequency)
void setSidebands(sidebands_t sidebands)
void onMenuDialogCalled(const QPoint &p)
void on_flipSidebands_clicked(bool checked)
void setUseReverseAPI(bool useReverseAPI)
void enterEvent(QEvent *)
void onWidgetRolled(QWidget *widget, bool rollDown)
DeviceUISet * m_deviceUISet
void setChannelMarker(Serializable *channelMarker)
virtual MessageQueue * getInputMessageQueue()
T min(const T &x, const T &y)