1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-02 06:04:39 -04:00

LimeSDR input: implemented basic stream reporting

This commit is contained in:
f4exb
2017-04-19 18:41:55 +02:00
parent 1a1c793014
commit db67e07ab9
7 changed files with 399 additions and 136 deletions
@@ -35,7 +35,8 @@ LimeSDRInputGUI::LimeSDRInputGUI(DeviceSourceAPI *deviceAPI, QWidget* parent) :
m_sampleSource(0),
m_sampleRate(0),
m_lastEngineState((DSPDeviceSourceEngine::State)-1),
m_doApplySettings(true)
m_doApplySettings(true),
m_statusCounter(0)
{
m_limeSDRInput = new LimeSDRInput(m_deviceAPI);
m_sampleSource = (DeviceSampleSource *) m_limeSDRInput;
@@ -179,6 +180,29 @@ void LimeSDRInputGUI::handleMessagesToGUI()
delete message;
}
else if (LimeSDRInput::MsgReportStreamInfo::match(*message))
{
LimeSDRInput::MsgReportStreamInfo *report = (LimeSDRInput::MsgReportStreamInfo *) message;
if (report->getSuccess())
{
if (report->getActive())
{
ui->streamStatusLabel->setStyleSheet("QLabel { background-color : green; }");
}
else
{
ui->streamStatusLabel->setStyleSheet("QLabel { background:rgb(79,79,79); }");
}
ui->streamSampleRateText->setText(tr("%1kS").arg(QString::number(report->getSampleRate() / 1000.0f, 'f', 0)));
ui->streamLinkRateText->setText(tr("%1kB").arg(QString::number(report->getLinkRate() / 1000.0f, 'f', 0)));
}
else
{
ui->streamStatusLabel->setStyleSheet("QLabel { background-color : red; }");
}
}
}
}
@@ -253,6 +277,17 @@ void LimeSDRInputGUI::updateStatus()
m_lastEngineState = state;
}
if (m_statusCounter < 1)
{
m_statusCounter++;
}
else
{
LimeSDRInput::MsgGetStreamInfo* message = LimeSDRInput::MsgGetStreamInfo::create();
m_sampleSource->getInputMessageQueue()->push(message);
m_statusCounter = 0;
}
}
void LimeSDRInputGUI::blockApplySettings(bool block)