19 #include <QMessageBox> 21 #include "ui_limesdroutputgui.h" 35 m_deviceUISet(deviceUISet),
37 m_sampleRateMode(true),
39 m_lastEngineState(
DeviceAPI::StNotStarted),
40 m_doApplySettings(true),
41 m_forceSettings(true),
43 m_deviceStatusCounter(0)
61 ui->lpf->setValueRange(6, (minF/1000)+1, maxF/1000);
64 ui->lpFIR->setValueRange(5, 1U, 56000U);
72 ui->antenna->setItemText(1,
"Hi");
73 ui->antenna->setItemText(2,
"Lo");
77 ui->antenna->setItemText(1,
"Lo");
78 ui->antenna->setItemText(2,
"Hi");
81 ui->hwInterpLabel->setText(QString::fromUtf8(
"H\u2191"));
82 ui->swInterpLabel->setText(QString::fromUtf8(
"S\u2191"));
90 char recFileNameCStr[30];
96 connect(startStopRightClickEnabler, SIGNAL(rightClick(
const QPoint &)),
this, SLOT(
openDeviceSettingsDialog(
const QPoint &)));
167 qint64 minLimit = minF/1000 + deltaFrequency;
168 qint64 maxLimit = maxF/1000 + deltaFrequency;
170 minLimit = minLimit < 0 ? 0 : minLimit > 9999999 ? 9999999 : minLimit;
171 maxLimit = maxLimit < 0 ? 0 : maxLimit > 9999999 ? 9999999 : maxLimit;
173 qDebug(
"LimeSDROutputGUI::updateFrequencyLimits: delta: %lld min: %lld max: %lld", deltaFrequency, minLimit, maxLimit);
175 ui->centerFrequency->setValueRange(7, minLimit, maxLimit);
225 ui->streamStatusLabel->setStyleSheet(
"QLabel { background-color : green; }");
227 ui->streamStatusLabel->setStyleSheet(
"QLabel { background-color : blue; }");
230 ui->streamLinkRateText->setText(tr(
"%1 MB/s").
arg(QString::number(report.
getLinkRate() / 1000000.0f,
'f', 3)));
233 ui->underrunLabel->setStyleSheet(
"QLabel { background-color : red; }");
235 ui->underrunLabel->setStyleSheet(
"QLabel { background:rgb(79,79,79); }");
239 ui->overrunLabel->setStyleSheet(
"QLabel { background-color : red; }");
241 ui->overrunLabel->setStyleSheet(
"QLabel { background:rgb(79,79,79); }");
245 ui->droppedLabel->setStyleSheet(
"QLabel { background-color : red; }");
247 ui->droppedLabel->setStyleSheet(
"QLabel { background:rgb(79,79,79); }");
256 ui->streamStatusLabel->setStyleSheet(
"QLabel { background:rgb(79,79,79); }");
264 ui->temperatureText->setText(tr(
"%1C").
arg(QString::number(report.
getTemperature(),
'f', 0)));
265 ui->gpioText->setText(tr(
"%1").
arg(report.
getGPIOPins(), 2, 16, QChar(
'0')).toUpper());
280 qDebug(
"LimeSDROutputGUI::handleInputMessages: message: %s", message->
getIdentifier());
284 qDebug(
"LimeSDROutputGUI::handleInputMessages: DSPSignalNotification: SampleRate: %d, CenterFrequency: %llu", notif->getSampleRate(), notif->getCenterFrequency());
325 if (dacRate < 100000000) {
326 ui->dacRateLabel->setText(tr(
"%1k").
arg(QString::number(dacRate / 1000.0f,
'g', 5)));
328 ui->dacRateLabel->setText(tr(
"%1M").
arg(QString::number(dacRate / 1000000.0f,
'g', 5)));
337 ui->sampleRate->blockSignals(
true);
341 ui->sampleRateMode->setStyleSheet(
"QToolButton { background:rgb(60,60,60); }");
342 ui->sampleRateMode->setText(
"SR");
345 ui->sampleRate->setToolTip(
"Host to device sample rate (S/s)");
346 ui->deviceRateText->setToolTip(
"Baseband sample rate (S/s)");
348 ui->deviceRateText->setText(tr(
"%1k").
arg(QString::number(basebandSampleRate / 1000.0f,
'g', 5)));
352 ui->sampleRateMode->setStyleSheet(
"QToolButton { background:rgb(50,50,50); }");
353 ui->sampleRateMode->setText(
"BB");
356 ui->sampleRate->setToolTip(
"Baseband sample rate (S/s)");
357 ui->deviceRateText->setToolTip(
"Host to device sample rate (S/s)");
361 ui->sampleRate->blockSignals(
false);
398 ui->ncoFrequency->setValueRange(
404 ui->ncoFrequency->blockSignals(
true);
405 ui->ncoFrequency->setToolTip(QString(
"NCO frequency shift in Hz (Range: +/- %1 kHz)").
arg(ncoHalfRange/1000));
407 ui->ncoFrequency->blockSignals(
false);
413 ui->centerFrequency->setToolTip(QString(
"Main center frequency in kHz (LO: %1 kHz)").
arg(centerFrequency/1000));
419 ui->centerFrequency->blockSignals(
true);
420 ui->centerFrequency->setValue(centerFrequency < 0 ? 0 : (
uint64_t) centerFrequency/1000);
421 ui->centerFrequency->blockSignals(
false);
426 int64_t centerFrequency = kHzValue*1000;
433 ui->centerFrequency->setToolTip(QString(
"Main center frequency in kHz (LO: %1 kHz)").
arg(centerFrequency/1000));
446 qDebug() <<
"LimeSDROutputGUI::updateHardware";
463 ui->startStop->setStyleSheet(
"QToolButton { background:rgb(79,79,79); }");
466 ui->startStop->setStyleSheet(
"QToolButton { background-color : blue; }");
469 ui->startStop->setStyleSheet(
"QToolButton { background-color : green; }");
472 ui->startStop->setStyleSheet(
"QToolButton { background-color : red; }");
557 if ((index <0) || (index > 5))
567 if ((index <0) || (index > 6)) {
MessageQueue m_inputMessageQueue
uint64_t getCenterFrequency() const
virtual void setCenterFrequency(qint64 centerFrequency)
int m_ncoFrequency
Actual NCO frequency (the resulting frequency with mixing is displayed)
Message * pop()
Pop message from queue.
const QString & getReverseAPIAddress() const
void on_sampleRateMode_toggled(bool checked)
QByteArray serialize() const
void on_extClock_clicked()
void push(Message *message, bool emitSignal=true)
Push message onto queue.
void setSampleRate(qint32 sampleRate)
void setName(const QString &name)
uint32_t getFifoSize() const
void on_gain_valueChanged(int value)
uint getDeviceUID() const
Return the current device engine unique ID.
quint64 m_deviceCenterFrequency
Center frequency in device.
bool isBuddyLeader() const
void setUseReverseAPI(bool useReverseAPI)
virtual ~LimeSDROutputGUI()
uint32_t m_extClockFreq
Frequency (Hz) of external clock source.
void updateSampleRateAndFrequency()
static MsgGetDeviceInfo * create()
void on_transverter_clicked()
void on_lpFIREnable_toggled(bool checked)
bool getStartStop() const
uint16_t getReverseAPIDeviceIndex() const
virtual bool handleMessage(const Message &message)
uint16_t m_reverseAPIDeviceIndex
void on_swInterp_currentIndexChanged(int index)
uint32_t getUnderrun() const
uint32_t getOverrun() const
QString errorMessage()
Last error message from the device engine.
void on_centerFrequency_changed(quint64 value)
bool deserialize(const QByteArray &data)
DeviceSampleSink * getSampleSink()
Return pointer to the device sample sink (single Tx) or nullptr.
uint16_t m_reverseAPIPort
uint32_t getDroppedPackets() const
uint8_t getGPIOPins() const
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
bool m_sampleRateMode
true: device, false: base band sample rate update mode
GLSpectrum * getSpectrum()
Direct spectrum getter.
engine is before initialization
int getLog2HardDecimInterp() const
int m_deviceStatusCounter
EngineState state() const
Return the state of the device engine corresponding to the stream type.
void on_lpf_changed(quint64 value)
void getSRRange(float &minF, float &maxF) const
std::size_t getChannelIndex()
void getLPRange(float &minF, float &maxF) const
MessageQueue * getInputMessageQueue()
void getLORange(float &minF, float &maxF) const
bool deserialize(const QByteArray &data)
uint16_t getReverseAPIPort() const
static MsgStartStop * create(bool startStop)
void blockApplySettings(bool block)
float getTemperature() const
void on_hwInterp_currentIndexChanged(int index)
float getLinkRate() const
bool m_ncoEnable
Enable TSP NCO and mixing.
virtual qint64 getCenterFrequency() const
static bool match(const Message *message)
QByteArray serialize() const
LimeSDROutputGUI(DeviceUISet *deviceUISet, QWidget *parent=0)
static MsgGetStreamInfo * create()
DeviceUISet * m_deviceUISet
qint64 m_transverterDeltaFrequency
void on_sampleRate_changed(quint64 value)
QString m_reverseAPIAddress
void on_lpFIR_changed(quint64 value)
void setCenterFrequencyDisplay()
LimeSDROutput * m_limeSDROutput
Same object as above but gives easy access to LimeSDROutput methods and attributes that are used inte...
bool m_extClock
True if external clock source.
void on_startStop_toggled(bool checked)
uint64_t m_centerFrequency
void setCenterFrequency(qint64 frequency)
virtual const char * getIdentifier() const
bool m_lpfFIREnable
Enable LMS digital lowpass FIR filters.
void setReverseAPIAddress(const QString &address)
LimeSDROutputSettings m_settings
void openDeviceSettingsDialog(const QPoint &p)
uint32_t m_gain
Optimally distributed gain (dB)
void setReverseAPIDeviceIndex(uint16_t deviceIndex)
float m_lpfBW
LMS amalog lowpass filter bandwidth (Hz)
void on_ncoEnable_toggled(bool checked)
uint32_t m_log2SoftInterp
void setReverseAPIPort(uint16_t port)
float m_lpfFIRBW
LMS digital lowpass FIR filters bandwidth (Hz)
void updateFrequencyLimits()
uint32_t getExtClockFeq() const
DeviceLimeSDRParams::LimeType getLimeType() const
bool useReverseAPI() const
uint32_t m_log2HardInterp
Ui::LimeSDROutputGUI * ui
int getDevSampleRate() const
void on_ncoFrequency_changed(qint64 value)
void on_antenna_currentIndexChanged(int index)
void setCenterFrequencySetting(uint64_t kHzValue)
uint32_t getFifoFilledCount() const
void handleInputMessages()
unsigned __int64 uint64_t