2016-06-19 03:56:49 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Copyright (C) 2016 Edouard Griffiths, F4EXB //
|
|
|
|
// //
|
|
|
|
// This program is free software; you can redistribute it and/or modify //
|
|
|
|
// it under the terms of the GNU General Public License as published by //
|
|
|
|
// the Free Software Foundation as version 3 of the License, or //
|
|
|
|
// //
|
|
|
|
// This program is distributed in the hope that it will be useful, //
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
|
|
|
// GNU General Public License V3 for more details. //
|
|
|
|
// //
|
|
|
|
// You should have received a copy of the GNU General Public License //
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <sstream>
|
|
|
|
#include <iostream>
|
|
|
|
#include <cassert>
|
|
|
|
|
|
|
|
#include <QDebug>
|
|
|
|
#include <QMessageBox>
|
|
|
|
#include <QTime>
|
|
|
|
#include <QDateTime>
|
|
|
|
#include <QString>
|
|
|
|
#include <QFileDialog>
|
|
|
|
|
|
|
|
#include <nanomsg/nn.h>
|
|
|
|
#include <nanomsg/pair.h>
|
|
|
|
|
|
|
|
#include "ui_sdrdaemonfecgui.h"
|
|
|
|
#include "gui/colormapper.h"
|
|
|
|
#include "gui/glspectrum.h"
|
|
|
|
#include "dsp/dspengine.h"
|
|
|
|
#include "dsp/dspcommands.h"
|
|
|
|
#include "mainwindow.h"
|
|
|
|
#include "util/simpleserializer.h"
|
|
|
|
|
|
|
|
#include "sdrdaemonfecgui.h"
|
2016-10-10 19:17:55 -04:00
|
|
|
|
|
|
|
#include <device/devicesourceapi.h>
|
2016-10-02 04:30:58 -04:00
|
|
|
#include <dsp/filerecord.h>
|
2016-06-19 03:56:49 -04:00
|
|
|
|
2016-10-10 19:17:55 -04:00
|
|
|
SDRdaemonFECGui::SDRdaemonFECGui(DeviceSourceAPI *deviceAPI, QWidget* parent) :
|
2016-06-19 03:56:49 -04:00
|
|
|
QWidget(parent),
|
|
|
|
ui(new Ui::SDRdaemonFECGui),
|
|
|
|
m_deviceAPI(deviceAPI),
|
|
|
|
m_sampleSource(NULL),
|
|
|
|
m_acquisition(false),
|
2016-10-03 12:29:05 -04:00
|
|
|
m_lastEngineState((DSPDeviceSourceEngine::State)-1),
|
2016-06-19 03:56:49 -04:00
|
|
|
m_sampleRate(0),
|
|
|
|
m_centerFrequency(0),
|
2016-07-24 05:09:11 -04:00
|
|
|
m_framesDecodingStatus(0),
|
2016-06-19 03:56:49 -04:00
|
|
|
m_bufferLengthInSecs(0.0),
|
|
|
|
m_bufferGauge(-50),
|
2016-07-24 05:09:11 -04:00
|
|
|
m_nbOriginalBlocks(128),
|
2017-05-25 14:13:34 -04:00
|
|
|
m_nbFECBlocks(0),
|
|
|
|
m_samplesCount(0),
|
|
|
|
m_tickCount(0),
|
|
|
|
m_address("127.0.0.1"),
|
|
|
|
m_dataPort(9090),
|
|
|
|
m_controlPort(9091),
|
|
|
|
m_addressEdited(false),
|
|
|
|
m_dataPortEdited(false),
|
|
|
|
m_initSendConfiguration(false),
|
2017-06-08 09:31:24 -04:00
|
|
|
m_countUnrecoverable(0),
|
|
|
|
m_countRecovered(0),
|
2017-06-07 20:06:36 -04:00
|
|
|
m_doApplySettings(true),
|
|
|
|
m_forceSettings(true),
|
2017-06-08 17:35:52 -04:00
|
|
|
m_txDelay(0.0),
|
2017-05-25 14:13:34 -04:00
|
|
|
m_dcBlock(false),
|
|
|
|
m_iqCorrection(false)
|
2016-06-19 03:56:49 -04:00
|
|
|
{
|
|
|
|
m_sender = nn_socket(AF_SP, NN_PAIR);
|
|
|
|
assert(m_sender != -1);
|
|
|
|
int millis = 500;
|
2017-05-26 04:35:29 -04:00
|
|
|
int rc __attribute__((unused)) = nn_setsockopt (m_sender, NN_SOL_SOCKET, NN_SNDTIMEO, &millis, sizeof (millis));
|
2016-06-19 03:56:49 -04:00
|
|
|
assert (rc == 0);
|
|
|
|
|
2016-07-27 23:57:59 -04:00
|
|
|
m_paletteGreenText.setColor(QPalette::WindowText, Qt::green);
|
|
|
|
m_paletteWhiteText.setColor(QPalette::WindowText, Qt::white);
|
|
|
|
|
2016-06-19 03:56:49 -04:00
|
|
|
m_startingTimeStamp.tv_sec = 0;
|
|
|
|
m_startingTimeStamp.tv_usec = 0;
|
|
|
|
ui->setupUi(this);
|
2017-06-08 18:43:06 -04:00
|
|
|
|
2017-05-16 11:48:12 -04:00
|
|
|
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
2017-06-08 19:03:56 -04:00
|
|
|
ui->centerFrequency->setValueRange(7, 0, 9999999U);
|
|
|
|
|
|
|
|
ui->freq->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
|
|
|
ui->freq->setValueRange(7, 0, 9999999U);
|
2016-06-19 03:56:49 -04:00
|
|
|
|
2017-06-08 18:43:06 -04:00
|
|
|
ui->sampleRate->setColorMapper(ColorMapper(ColorMapper::GrayGreenYellow));
|
2017-06-08 19:03:56 -04:00
|
|
|
ui->sampleRate->setValueRange(7, 32000U, 9999999U);
|
2017-06-08 18:43:06 -04:00
|
|
|
|
2016-06-19 03:56:49 -04:00
|
|
|
connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus()));
|
|
|
|
m_statusTimer.start(500);
|
|
|
|
connect(&(deviceAPI->getMainWindow()->getMasterTimer()), SIGNAL(timeout()), this, SLOT(tick()));
|
2017-06-07 20:06:36 -04:00
|
|
|
connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware()));
|
2016-06-19 03:56:49 -04:00
|
|
|
|
|
|
|
m_sampleSource = new SDRdaemonFECInput(deviceAPI->getMainWindow()->getMasterTimer(), m_deviceAPI);
|
|
|
|
connect(m_sampleSource->getOutputMessageQueueToGUI(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages()));
|
|
|
|
m_deviceAPI->setSource(m_sampleSource);
|
|
|
|
|
|
|
|
displaySettings();
|
|
|
|
|
|
|
|
char recFileNameCStr[30];
|
|
|
|
sprintf(recFileNameCStr, "test_%d.sdriq", m_deviceAPI->getDeviceUID());
|
2016-10-02 04:30:58 -04:00
|
|
|
m_fileSink = new FileRecord(std::string(recFileNameCStr));
|
2016-06-19 03:56:49 -04:00
|
|
|
m_deviceAPI->addSink(m_fileSink);
|
|
|
|
|
|
|
|
connect(m_deviceAPI->getDeviceOutputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleDSPMessages()), Qt::QueuedConnection);
|
2017-06-07 20:06:36 -04:00
|
|
|
|
2017-06-08 09:31:24 -04:00
|
|
|
m_eventsTime.start();
|
|
|
|
displayEventCounts();
|
|
|
|
displayEventTimer();
|
|
|
|
|
2017-06-07 20:06:36 -04:00
|
|
|
displaySettings();
|
|
|
|
sendControl(true);
|
|
|
|
sendSettings();
|
2016-06-19 03:56:49 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
SDRdaemonFECGui::~SDRdaemonFECGui()
|
|
|
|
{
|
|
|
|
m_deviceAPI->removeSink(m_fileSink);
|
|
|
|
delete m_fileSink;
|
2017-04-12 19:28:44 -04:00
|
|
|
delete m_sampleSource;
|
2016-06-19 03:56:49 -04:00
|
|
|
delete ui;
|
|
|
|
}
|
|
|
|
|
2017-06-07 20:06:36 -04:00
|
|
|
void SDRdaemonFECGui::blockApplySettings(bool block)
|
|
|
|
{
|
|
|
|
m_doApplySettings = !block;
|
|
|
|
}
|
|
|
|
|
2016-06-19 03:56:49 -04:00
|
|
|
void SDRdaemonFECGui::destroy()
|
|
|
|
{
|
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SDRdaemonFECGui::setName(const QString& name)
|
|
|
|
{
|
|
|
|
setObjectName(name);
|
|
|
|
}
|
|
|
|
|
|
|
|
QString SDRdaemonFECGui::getName() const
|
|
|
|
{
|
|
|
|
return objectName();
|
|
|
|
}
|
|
|
|
|
|
|
|
void SDRdaemonFECGui::resetToDefaults()
|
|
|
|
{
|
2017-06-07 20:06:36 -04:00
|
|
|
blockApplySettings(true);
|
|
|
|
m_settings.resetToDefaults();
|
|
|
|
displaySettings();
|
|
|
|
blockApplySettings(false);
|
|
|
|
sendSettings();
|
2016-06-19 03:56:49 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
QByteArray SDRdaemonFECGui::serialize() const
|
|
|
|
{
|
2017-06-07 20:06:36 -04:00
|
|
|
return m_settings.serialize();
|
2016-06-19 03:56:49 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
bool SDRdaemonFECGui::deserialize(const QByteArray& data)
|
|
|
|
{
|
2017-06-07 20:06:36 -04:00
|
|
|
blockApplySettings(true);
|
2016-06-19 03:56:49 -04:00
|
|
|
|
2017-06-07 20:06:36 -04:00
|
|
|
if(m_settings.deserialize(data))
|
|
|
|
{
|
|
|
|
displaySettings();
|
|
|
|
configureUDPLink();
|
2017-06-08 17:35:52 -04:00
|
|
|
updateTxDelay();
|
|
|
|
sendControl();
|
2017-06-07 20:06:36 -04:00
|
|
|
blockApplySettings(false);
|
|
|
|
sendControl(true);
|
|
|
|
m_forceSettings = true;
|
|
|
|
sendSettings();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
blockApplySettings(false);
|
|
|
|
return false;
|
|
|
|
}
|
2016-06-19 03:56:49 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
qint64 SDRdaemonFECGui::getCenterFrequency() const
|
|
|
|
{
|
2017-06-07 20:06:36 -04:00
|
|
|
return m_settings.m_centerFrequency;
|
2016-06-19 03:56:49 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void SDRdaemonFECGui::setCenterFrequency(qint64 centerFrequency)
|
|
|
|
{
|
2017-06-07 20:06:36 -04:00
|
|
|
m_settings.m_centerFrequency = centerFrequency;
|
|
|
|
displaySettings();
|
|
|
|
sendControl();
|
|
|
|
sendSettings();
|
2016-06-19 03:56:49 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
bool SDRdaemonFECGui::handleMessage(const Message& message)
|
|
|
|
{
|
|
|
|
if (SDRdaemonFECInput::MsgReportSDRdaemonAcquisition::match(message))
|
|
|
|
{
|
|
|
|
m_acquisition = ((SDRdaemonFECInput::MsgReportSDRdaemonAcquisition&)message).getAcquisition();
|
|
|
|
updateWithAcquisition();
|
|
|
|
return true;
|
|
|
|
}
|
2016-06-20 03:07:37 -04:00
|
|
|
else if (SDRdaemonFECInput::MsgReportSDRdaemonFECStreamData::match(message))
|
2016-06-19 03:56:49 -04:00
|
|
|
{
|
2017-06-08 17:35:52 -04:00
|
|
|
int sampleRate = ((SDRdaemonFECInput::MsgReportSDRdaemonFECStreamData&)message).getSampleRate();
|
|
|
|
|
|
|
|
if (m_sampleRate != sampleRate)
|
|
|
|
{
|
|
|
|
m_sampleRate = sampleRate;
|
|
|
|
updateTxDelay();
|
|
|
|
sendControl();
|
|
|
|
}
|
|
|
|
|
|
|
|
m_centerFrequency = ((SDRdaemonFECInput::MsgReportSDRdaemonFECStreamData&)message).getCenterFrequency();
|
|
|
|
m_startingTimeStamp.tv_sec = ((SDRdaemonFECInput::MsgReportSDRdaemonFECStreamData&)message).get_tv_sec();
|
|
|
|
m_startingTimeStamp.tv_usec = ((SDRdaemonFECInput::MsgReportSDRdaemonFECStreamData&)message).get_tv_usec();
|
|
|
|
|
|
|
|
updateWithStreamData();
|
|
|
|
return true;
|
2016-06-19 03:56:49 -04:00
|
|
|
}
|
2016-06-19 18:45:24 -04:00
|
|
|
else if (SDRdaemonFECInput::MsgReportSDRdaemonFECStreamTiming::match(message))
|
2016-06-19 03:56:49 -04:00
|
|
|
{
|
2016-06-19 18:45:24 -04:00
|
|
|
m_startingTimeStamp.tv_sec = ((SDRdaemonFECInput::MsgReportSDRdaemonFECStreamTiming&)message).get_tv_sec();
|
|
|
|
m_startingTimeStamp.tv_usec = ((SDRdaemonFECInput::MsgReportSDRdaemonFECStreamTiming&)message).get_tv_usec();
|
2016-07-24 05:09:11 -04:00
|
|
|
m_framesDecodingStatus = ((SDRdaemonFECInput::MsgReportSDRdaemonFECStreamTiming&)message).getFramesDecodingStatus();
|
2016-07-27 22:49:33 -04:00
|
|
|
m_allBlocksReceived = ((SDRdaemonFECInput::MsgReportSDRdaemonFECStreamTiming&)message).allBlocksReceived();
|
2016-06-19 18:45:24 -04:00
|
|
|
m_bufferLengthInSecs = ((SDRdaemonFECInput::MsgReportSDRdaemonFECStreamTiming&)message).getBufferLengthInSecs();
|
|
|
|
m_bufferGauge = ((SDRdaemonFECInput::MsgReportSDRdaemonFECStreamTiming&)message).getBufferGauge();
|
2016-07-17 18:39:35 -04:00
|
|
|
m_minNbBlocks = ((SDRdaemonFECInput::MsgReportSDRdaemonFECStreamTiming&)message).getMinNbBlocks();
|
2016-07-27 12:49:17 -04:00
|
|
|
m_minNbOriginalBlocks = ((SDRdaemonFECInput::MsgReportSDRdaemonFECStreamTiming&)message).getMinNbOriginalBlocks();
|
|
|
|
m_maxNbRecovery = ((SDRdaemonFECInput::MsgReportSDRdaemonFECStreamTiming&)message).getMaxNbRecovery();
|
2016-06-19 19:18:21 -04:00
|
|
|
m_avgNbBlocks = ((SDRdaemonFECInput::MsgReportSDRdaemonFECStreamTiming&)message).getAvgNbBlocks();
|
2016-07-27 12:49:17 -04:00
|
|
|
m_avgNbOriginalBlocks = ((SDRdaemonFECInput::MsgReportSDRdaemonFECStreamTiming&)message).getAvgNbOriginalBlocks();
|
2016-06-19 19:18:21 -04:00
|
|
|
m_avgNbRecovery = ((SDRdaemonFECInput::MsgReportSDRdaemonFECStreamTiming&)message).getAvgNbRecovery();
|
2016-07-24 05:09:11 -04:00
|
|
|
m_nbOriginalBlocks = ((SDRdaemonFECInput::MsgReportSDRdaemonFECStreamTiming&)message).getNbOriginalBlocksPerFrame();
|
2017-06-08 17:35:52 -04:00
|
|
|
|
|
|
|
int nbFECBlocks = ((SDRdaemonFECInput::MsgReportSDRdaemonFECStreamTiming&)message).getNbFECBlocksPerFrame();
|
|
|
|
|
|
|
|
if (m_nbFECBlocks != nbFECBlocks)
|
|
|
|
{
|
|
|
|
m_nbFECBlocks = nbFECBlocks;
|
|
|
|
updateTxDelay();
|
|
|
|
sendControl();
|
|
|
|
}
|
2016-06-19 03:56:49 -04:00
|
|
|
|
|
|
|
updateWithStreamTime();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SDRdaemonFECGui::handleDSPMessages()
|
|
|
|
{
|
|
|
|
Message* message;
|
|
|
|
|
|
|
|
while ((message = m_deviceAPI->getDeviceOutputMessageQueue()->pop()) != 0)
|
|
|
|
{
|
|
|
|
qDebug("SDRdaemonGui::handleDSPMessages: message: %s", message->getIdentifier());
|
|
|
|
|
|
|
|
if (DSPSignalNotification::match(*message))
|
|
|
|
{
|
|
|
|
DSPSignalNotification* notif = (DSPSignalNotification*) message;
|
|
|
|
m_deviceSampleRate = notif->getSampleRate();
|
|
|
|
m_deviceCenterFrequency = notif->getCenterFrequency();
|
|
|
|
qDebug("SDRdaemonGui::handleDSPMessages: SampleRate:%d, CenterFrequency:%llu", notif->getSampleRate(), notif->getCenterFrequency());
|
|
|
|
updateSampleRateAndFrequency();
|
|
|
|
m_fileSink->handleMessage(*notif); // forward to file sink
|
|
|
|
|
|
|
|
delete message;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SDRdaemonFECGui::handleSourceMessages()
|
|
|
|
{
|
|
|
|
Message* message;
|
|
|
|
|
|
|
|
while ((message = m_sampleSource->getOutputMessageQueueToGUI()->pop()) != 0)
|
|
|
|
{
|
|
|
|
//qDebug("SDRdaemonGui::handleSourceMessages: message: %s", message->getIdentifier());
|
|
|
|
|
|
|
|
if (handleMessage(*message))
|
|
|
|
{
|
|
|
|
delete message;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SDRdaemonFECGui::updateSampleRateAndFrequency()
|
|
|
|
{
|
|
|
|
m_deviceAPI->getSpectrum()->setSampleRate(m_deviceSampleRate);
|
|
|
|
m_deviceAPI->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency);
|
|
|
|
ui->deviceRateText->setText(tr("%1k").arg((float)m_deviceSampleRate / 1000));
|
|
|
|
}
|
|
|
|
|
2017-06-08 17:35:52 -04:00
|
|
|
void SDRdaemonFECGui::updateTxDelay()
|
|
|
|
{
|
|
|
|
m_txDelay = ((127*127*m_settings.m_txDelay) / m_sampleRate)/(128 + m_nbFECBlocks);
|
|
|
|
ui->txDelayText->setToolTip(tr("%1 us").arg(QString::number(m_txDelay*1e6, 'f', 0)));
|
|
|
|
}
|
|
|
|
|
2016-06-19 03:56:49 -04:00
|
|
|
void SDRdaemonFECGui::displaySettings()
|
|
|
|
{
|
2017-06-07 20:06:36 -04:00
|
|
|
ui->centerFrequency->setValue(m_settings.m_centerFrequency / 1000);
|
|
|
|
ui->deviceRateText->setText(tr("%1k").arg(m_sampleRate / 1000.0));
|
2016-06-19 03:56:49 -04:00
|
|
|
|
2017-06-08 19:03:56 -04:00
|
|
|
ui->freq->setValue(m_settings.m_centerFrequency / 1000);
|
2017-06-07 20:06:36 -04:00
|
|
|
ui->decim->setCurrentIndex(m_settings.m_log2Decim);
|
|
|
|
ui->fcPos->setCurrentIndex(m_settings.m_fcPos);
|
2017-06-08 18:43:06 -04:00
|
|
|
ui->sampleRate->setValue(m_settings.m_sampleRate);
|
2017-06-07 20:06:36 -04:00
|
|
|
ui->specificParms->setText(m_settings.m_specificParameters);
|
|
|
|
ui->specificParms->setCursorPosition(0);
|
2017-06-08 17:35:52 -04:00
|
|
|
ui->txDelayText->setText(tr("%1").arg(m_settings.m_txDelay*100));
|
2017-06-08 18:21:05 -04:00
|
|
|
ui->nbFECBlocks->setValue(m_settings.m_nbFECBlocks);
|
|
|
|
QString nstr = QString("%1").arg(m_settings.m_nbFECBlocks, 2, 10, QChar('0'));
|
|
|
|
ui->nbFECBlocksText->setText(nstr);
|
2016-06-19 03:56:49 -04:00
|
|
|
|
2017-06-07 20:06:36 -04:00
|
|
|
QString s0 = QString::number(128 + m_settings.m_nbFECBlocks, 'f', 0);
|
2017-06-08 18:21:05 -04:00
|
|
|
ui->nominalNbBlocksText->setText(tr("%1/%2").arg(s0).arg(nstr));
|
2016-06-19 03:56:49 -04:00
|
|
|
|
2017-06-07 20:06:36 -04:00
|
|
|
ui->address->setText(m_settings.m_address);
|
|
|
|
ui->dataPort->setText(tr("%1").arg(m_settings.m_dataPort));
|
|
|
|
ui->controlPort->setText(tr("%1").arg(m_settings.m_controlPort));
|
|
|
|
ui->specificParms->setText(m_settings.m_specificParameters);
|
2016-06-19 03:56:49 -04:00
|
|
|
|
2017-06-07 20:06:36 -04:00
|
|
|
ui->dcOffset->setChecked(m_settings.m_dcBlock);
|
|
|
|
ui->iqImbalance->setChecked(m_settings.m_iqCorrection);
|
2016-06-19 03:56:49 -04:00
|
|
|
}
|
|
|
|
|
2017-06-07 20:06:36 -04:00
|
|
|
void SDRdaemonFECGui::sendControl(bool force)
|
2016-06-19 03:56:49 -04:00
|
|
|
{
|
2017-06-07 20:06:36 -04:00
|
|
|
QString remoteAddress;
|
|
|
|
((SDRdaemonFECInput *) m_sampleSource)->getRemoteAddress(remoteAddress);
|
2016-06-19 03:56:49 -04:00
|
|
|
|
2017-06-07 20:06:36 -04:00
|
|
|
if ((remoteAddress != m_remoteAddress) ||
|
|
|
|
(m_settings.m_controlPort != m_controlSettings.m_controlPort) || force)
|
|
|
|
{
|
|
|
|
m_remoteAddress = remoteAddress;
|
2016-06-19 03:56:49 -04:00
|
|
|
|
2017-06-07 20:06:36 -04:00
|
|
|
int rc = nn_shutdown(m_sender, 0);
|
|
|
|
|
|
|
|
if (rc < 0) {
|
|
|
|
qDebug() << "SDRdaemonFECGui::sendControl: disconnection failed";
|
|
|
|
} else {
|
|
|
|
qDebug() << "SDRdaemonFECGui::sendControl: disconnection successful";
|
|
|
|
}
|
|
|
|
|
|
|
|
std::ostringstream os;
|
|
|
|
os << "tcp://" << m_remoteAddress.toStdString() << ":" << m_settings.m_controlPort;
|
|
|
|
std::string addrstrng = os.str();
|
|
|
|
rc = nn_connect(m_sender, addrstrng.c_str());
|
2016-06-19 03:56:49 -04:00
|
|
|
|
2017-06-07 20:06:36 -04:00
|
|
|
if (rc < 0) {
|
|
|
|
qDebug() << "SDRdaemonFECGui::sendConfiguration: connexion to " << addrstrng.c_str() << " failed";
|
|
|
|
QMessageBox::information(this, tr("Message"), tr("Cannot connect to remote control port"));
|
|
|
|
} else {
|
|
|
|
qDebug() << "SDRdaemonFECGui::sendConfiguration: connexion to " << addrstrng.c_str() << " successful";
|
|
|
|
}
|
|
|
|
}
|
2016-06-19 03:56:49 -04:00
|
|
|
|
2017-06-07 20:06:36 -04:00
|
|
|
std::ostringstream os;
|
|
|
|
int nbArgs = 0;
|
2016-06-19 03:56:49 -04:00
|
|
|
|
2017-06-07 20:06:36 -04:00
|
|
|
if ((m_settings.m_centerFrequency != m_controlSettings.m_centerFrequency) || force)
|
|
|
|
{
|
|
|
|
os << "freq=" << m_settings.m_centerFrequency;
|
|
|
|
nbArgs++;
|
|
|
|
}
|
2016-06-19 03:56:49 -04:00
|
|
|
|
2017-06-07 20:06:36 -04:00
|
|
|
if ((m_settings.m_sampleRate != m_controlSettings.m_sampleRate) || (m_settings.m_log2Decim != m_controlSettings.m_log2Decim) || force)
|
|
|
|
{
|
|
|
|
if (nbArgs > 0) os << ",";
|
|
|
|
os << "srate=" << m_settings.m_sampleRate;
|
|
|
|
nbArgs++;
|
|
|
|
}
|
2016-06-19 03:56:49 -04:00
|
|
|
|
2017-06-07 20:06:36 -04:00
|
|
|
if ((m_settings.m_log2Decim != m_controlSettings.m_log2Decim) || force)
|
|
|
|
{
|
|
|
|
if (nbArgs > 0) os << ",";
|
|
|
|
os << "decim=" << m_settings.m_log2Decim;
|
|
|
|
nbArgs++;
|
|
|
|
}
|
2016-06-19 03:56:49 -04:00
|
|
|
|
2017-06-07 20:06:36 -04:00
|
|
|
if ((m_settings.m_fcPos != m_controlSettings.m_fcPos) || force)
|
|
|
|
{
|
|
|
|
if (nbArgs > 0) os << ",";
|
|
|
|
os << "fcpos=" << m_settings.m_fcPos;
|
|
|
|
nbArgs++;
|
|
|
|
}
|
2016-06-19 03:56:49 -04:00
|
|
|
|
2017-06-08 18:21:05 -04:00
|
|
|
if ((m_settings.m_nbFECBlocks != m_controlSettings.m_nbFECBlocks) || force)
|
|
|
|
{
|
|
|
|
if (nbArgs > 0) os << ",";
|
|
|
|
os << "fecblk=" << m_settings.m_nbFECBlocks;
|
|
|
|
nbArgs++;
|
|
|
|
}
|
|
|
|
|
2017-06-08 17:35:52 -04:00
|
|
|
if (m_txDelay != 0.0)
|
|
|
|
{
|
|
|
|
if (nbArgs > 0) os << ",";
|
|
|
|
os << "txdelay=" << (int) (m_txDelay*1e6);
|
|
|
|
nbArgs++;
|
|
|
|
m_txDelay = 0.0;
|
|
|
|
}
|
|
|
|
|
2017-06-07 20:06:36 -04:00
|
|
|
if ((m_settings.m_specificParameters != m_controlSettings.m_specificParameters) || force)
|
|
|
|
{
|
|
|
|
if (m_settings.m_specificParameters.size() > 0)
|
|
|
|
{
|
|
|
|
if (nbArgs > 0) os << ",";
|
|
|
|
os << m_settings.m_specificParameters.toStdString();
|
|
|
|
nbArgs++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (nbArgs > 0)
|
|
|
|
{
|
|
|
|
int config_size = os.str().size();
|
|
|
|
int rc = nn_send(m_sender, (void *) os.str().c_str(), config_size, 0);
|
|
|
|
|
|
|
|
if (rc != config_size)
|
|
|
|
{
|
|
|
|
//QMessageBox::information(this, tr("Message"), tr("Cannot send message to remote control port"));
|
|
|
|
qDebug() << "SDRdaemonFECGui::sendControl: Cannot send message to remote control port."
|
|
|
|
<< " remoteAddress: " << m_remoteAddress
|
|
|
|
<< " remotePort: " << m_settings.m_controlPort
|
|
|
|
<< " message: " << os.str().c_str();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
qDebug() << "SDRdaemonFECGui::sendControl:"
|
|
|
|
<< "remoteAddress:" << m_remoteAddress
|
|
|
|
<< "remotePort:" << m_settings.m_controlPort
|
|
|
|
<< "message:" << os.str().c_str();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
m_controlSettings.m_address = m_settings.m_address;
|
|
|
|
m_controlSettings.m_controlPort = m_settings.m_controlPort;
|
|
|
|
m_controlSettings.m_centerFrequency = m_settings.m_centerFrequency;
|
|
|
|
m_controlSettings.m_sampleRate = m_settings.m_sampleRate;
|
|
|
|
m_controlSettings.m_log2Decim = m_settings.m_log2Decim;
|
|
|
|
m_controlSettings.m_fcPos = m_settings.m_fcPos;
|
2017-06-08 18:21:05 -04:00
|
|
|
m_controlSettings.m_nbFECBlocks = m_settings.m_nbFECBlocks;
|
2017-06-07 20:06:36 -04:00
|
|
|
m_controlSettings.m_specificParameters = m_settings.m_specificParameters;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SDRdaemonFECGui::sendSettings()
|
|
|
|
{
|
|
|
|
if(!m_updateTimer.isActive())
|
|
|
|
m_updateTimer.start(100);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SDRdaemonFECGui::on_applyButton_clicked(bool checked __attribute__((unused)))
|
|
|
|
{
|
|
|
|
m_settings.m_address = ui->address->text();
|
2016-06-19 03:56:49 -04:00
|
|
|
|
2017-06-07 20:06:36 -04:00
|
|
|
bool ctlOk;
|
|
|
|
int udpCtlPort = ui->controlPort->text().toInt(&ctlOk);
|
2016-06-19 03:56:49 -04:00
|
|
|
|
2017-06-07 20:06:36 -04:00
|
|
|
if((ctlOk) && (udpCtlPort >= 1024) && (udpCtlPort < 65535))
|
2016-06-19 03:56:49 -04:00
|
|
|
{
|
2017-06-07 20:06:36 -04:00
|
|
|
m_settings.m_controlPort = udpCtlPort;
|
2016-06-19 03:56:49 -04:00
|
|
|
}
|
2017-06-07 20:06:36 -04:00
|
|
|
|
|
|
|
bool dataOk;
|
|
|
|
int udpDataPort = ui->dataPort->text().toInt(&dataOk);
|
|
|
|
|
|
|
|
if((dataOk) && (udpDataPort >= 1024) && (udpDataPort < 65535))
|
2016-06-19 03:56:49 -04:00
|
|
|
{
|
2017-06-07 20:06:36 -04:00
|
|
|
m_settings.m_dataPort = udpDataPort;
|
2016-06-19 03:56:49 -04:00
|
|
|
}
|
2017-06-07 20:06:36 -04:00
|
|
|
|
|
|
|
configureUDPLink();
|
|
|
|
}
|
|
|
|
|
|
|
|
void SDRdaemonFECGui::on_sendButton_clicked(bool checked __attribute__((unused)))
|
|
|
|
{
|
2017-06-08 17:35:52 -04:00
|
|
|
updateTxDelay();
|
2017-06-07 20:06:36 -04:00
|
|
|
sendControl(true);
|
|
|
|
ui->specificParms->setCursorPosition(0);
|
2016-06-19 03:56:49 -04:00
|
|
|
}
|
|
|
|
|
2017-06-07 18:21:46 -04:00
|
|
|
void SDRdaemonFECGui::on_address_returnPressed()
|
2016-06-19 03:56:49 -04:00
|
|
|
{
|
2017-06-07 20:06:36 -04:00
|
|
|
m_settings.m_address = ui->address->text();
|
|
|
|
configureUDPLink();
|
2016-06-19 03:56:49 -04:00
|
|
|
}
|
|
|
|
|
2017-06-07 18:21:46 -04:00
|
|
|
void SDRdaemonFECGui::on_dataPort_returnPressed()
|
2016-06-19 03:56:49 -04:00
|
|
|
{
|
2017-06-07 20:06:36 -04:00
|
|
|
bool dataOk;
|
|
|
|
int udpDataPort = ui->dataPort->text().toInt(&dataOk);
|
|
|
|
|
|
|
|
if((!dataOk) || (udpDataPort < 1024) || (udpDataPort > 65535))
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m_settings.m_dataPort = udpDataPort;
|
|
|
|
}
|
|
|
|
|
|
|
|
configureUDPLink();
|
2016-06-19 03:56:49 -04:00
|
|
|
}
|
|
|
|
|
2017-06-07 18:21:46 -04:00
|
|
|
void SDRdaemonFECGui::on_controlPort_returnPressed()
|
2016-06-19 03:56:49 -04:00
|
|
|
{
|
2017-06-07 20:06:36 -04:00
|
|
|
bool ctlOk;
|
|
|
|
int udpCtlPort = ui->controlPort->text().toInt(&ctlOk);
|
|
|
|
|
|
|
|
if((!ctlOk) || (udpCtlPort < 1024) || (udpCtlPort > 65535))
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m_settings.m_controlPort = udpCtlPort;
|
|
|
|
}
|
|
|
|
|
|
|
|
sendControl();
|
2016-06-19 03:56:49 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void SDRdaemonFECGui::on_dcOffset_toggled(bool checked)
|
|
|
|
{
|
|
|
|
if (m_dcBlock != checked)
|
|
|
|
{
|
|
|
|
m_dcBlock = checked;
|
|
|
|
configureAutoCorrections();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SDRdaemonFECGui::on_iqImbalance_toggled(bool checked)
|
|
|
|
{
|
|
|
|
if (m_iqCorrection != checked)
|
|
|
|
{
|
|
|
|
m_iqCorrection = checked;
|
|
|
|
configureAutoCorrections();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-06-08 19:03:56 -04:00
|
|
|
void SDRdaemonFECGui::on_freq_changed(quint64 value)
|
2016-06-19 03:56:49 -04:00
|
|
|
{
|
2017-06-08 19:03:56 -04:00
|
|
|
m_settings.m_centerFrequency = value * 1000;
|
|
|
|
sendControl();
|
2016-06-19 03:56:49 -04:00
|
|
|
}
|
|
|
|
|
2017-06-08 18:43:06 -04:00
|
|
|
void SDRdaemonFECGui::on_sampleRate_changed(quint64 value)
|
2016-06-19 03:56:49 -04:00
|
|
|
{
|
2017-06-08 18:43:06 -04:00
|
|
|
m_settings.m_sampleRate = value;
|
|
|
|
sendControl();
|
2016-06-19 03:56:49 -04:00
|
|
|
}
|
|
|
|
|
2017-06-07 18:21:46 -04:00
|
|
|
void SDRdaemonFECGui::on_specificParms_returnPressed()
|
2016-06-19 03:56:49 -04:00
|
|
|
{
|
2017-06-07 20:06:36 -04:00
|
|
|
if ((ui->specificParms->text()).size() > 0) {
|
|
|
|
m_settings.m_specificParameters = ui->specificParms->text();
|
|
|
|
sendControl();
|
|
|
|
}
|
2016-06-19 03:56:49 -04:00
|
|
|
}
|
|
|
|
|
2017-05-25 14:13:34 -04:00
|
|
|
void SDRdaemonFECGui::on_decim_currentIndexChanged(int index __attribute__((unused)))
|
2016-06-19 03:56:49 -04:00
|
|
|
{
|
2017-06-07 20:06:36 -04:00
|
|
|
m_settings.m_log2Decim = ui->decim->currentIndex();
|
|
|
|
sendControl();
|
2016-06-19 03:56:49 -04:00
|
|
|
}
|
|
|
|
|
2017-05-25 14:13:34 -04:00
|
|
|
void SDRdaemonFECGui::on_fcPos_currentIndexChanged(int index __attribute__((unused)))
|
2016-06-19 03:56:49 -04:00
|
|
|
{
|
2017-06-07 20:06:36 -04:00
|
|
|
m_settings.m_fcPos = ui->fcPos->currentIndex();
|
|
|
|
sendControl();
|
2016-06-19 03:56:49 -04:00
|
|
|
}
|
|
|
|
|
2017-06-08 17:35:52 -04:00
|
|
|
void SDRdaemonFECGui::on_txDelay_valueChanged(int value)
|
|
|
|
{
|
|
|
|
m_settings.m_txDelay = value / 100.0;
|
|
|
|
ui->txDelayText->setText(tr("%1").arg(value));
|
|
|
|
updateTxDelay();
|
|
|
|
sendControl();
|
|
|
|
}
|
|
|
|
|
2017-06-08 18:21:05 -04:00
|
|
|
void SDRdaemonFECGui::on_nbFECBlocks_valueChanged(int value)
|
|
|
|
{
|
|
|
|
m_settings.m_nbFECBlocks = value;
|
|
|
|
QString nstr = QString("%1").arg(m_settings.m_nbFECBlocks, 2, 10, QChar('0'));
|
|
|
|
ui->nbFECBlocksText->setText(nstr);
|
|
|
|
sendControl();
|
|
|
|
}
|
|
|
|
|
2016-06-19 03:56:49 -04:00
|
|
|
void SDRdaemonFECGui::on_startStop_toggled(bool checked)
|
|
|
|
{
|
|
|
|
if (checked)
|
|
|
|
{
|
|
|
|
if (m_deviceAPI->initAcquisition())
|
|
|
|
{
|
|
|
|
m_deviceAPI->startAcquisition();
|
2016-11-28 19:09:06 -05:00
|
|
|
DSPEngine::instance()->startAudioOutput();
|
2016-06-19 03:56:49 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m_deviceAPI->stopAcquisition();
|
2016-11-28 19:09:06 -05:00
|
|
|
DSPEngine::instance()->stopAudioOutput();
|
2016-06-19 03:56:49 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SDRdaemonFECGui::on_record_toggled(bool checked)
|
|
|
|
{
|
|
|
|
if (checked)
|
|
|
|
{
|
|
|
|
ui->record->setStyleSheet("QToolButton { background-color : red; }");
|
|
|
|
m_fileSink->startRecording();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ui->record->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
|
|
|
m_fileSink->stopRecording();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-06-08 09:31:24 -04:00
|
|
|
void SDRdaemonFECGui::on_eventCountsReset_clicked(bool checked __attribute__((unused)))
|
|
|
|
{
|
|
|
|
m_countUnrecoverable = 0;
|
|
|
|
m_countRecovered = 0;
|
|
|
|
m_eventsTime.start();
|
|
|
|
displayEventCounts();
|
|
|
|
displayEventTimer();
|
|
|
|
}
|
|
|
|
|
|
|
|
void SDRdaemonFECGui::displayEventCounts()
|
|
|
|
{
|
|
|
|
QString nstr = QString("%1").arg(m_countUnrecoverable, 3, 10, QChar('0'));
|
|
|
|
ui->eventUnrecText->setText(nstr);
|
|
|
|
nstr = QString("%1").arg(m_countRecovered, 3, 10, QChar('0'));
|
|
|
|
ui->eventRecText->setText(nstr);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SDRdaemonFECGui::displayEventTimer()
|
|
|
|
{
|
|
|
|
int elapsedTimeMillis = m_eventsTime.elapsed();
|
|
|
|
QTime recordLength(0, 0, 0, 0);
|
|
|
|
recordLength = recordLength.addSecs(elapsedTimeMillis/1000);
|
|
|
|
QString s_time = recordLength.toString("hh:mm:ss");
|
|
|
|
ui->eventCountsTimeText->setText(s_time);
|
|
|
|
}
|
|
|
|
|
2016-06-19 03:56:49 -04:00
|
|
|
void SDRdaemonFECGui::configureUDPLink()
|
|
|
|
{
|
2017-06-07 20:06:36 -04:00
|
|
|
qDebug() << "SDRdaemonGui::configureUDPLink: " << m_settings.m_address.toStdString().c_str()
|
|
|
|
<< " : " << m_settings.m_dataPort;
|
2016-06-19 03:56:49 -04:00
|
|
|
|
2017-06-07 20:06:36 -04:00
|
|
|
SDRdaemonFECInput::MsgConfigureSDRdaemonUDPLink* message = SDRdaemonFECInput::MsgConfigureSDRdaemonUDPLink::create(m_settings.m_address, m_settings.m_dataPort);
|
2016-06-19 03:56:49 -04:00
|
|
|
m_sampleSource->getInputMessageQueue()->push(message);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SDRdaemonFECGui::configureAutoCorrections()
|
|
|
|
{
|
|
|
|
SDRdaemonFECInput::MsgConfigureSDRdaemonAutoCorr* message = SDRdaemonFECInput::MsgConfigureSDRdaemonAutoCorr::create(m_dcBlock, m_iqCorrection);
|
|
|
|
m_sampleSource->getInputMessageQueue()->push(message);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SDRdaemonFECGui::updateWithAcquisition()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void SDRdaemonFECGui::updateWithStreamData()
|
|
|
|
{
|
|
|
|
ui->centerFrequency->setValue(m_centerFrequency / 1000);
|
|
|
|
updateWithStreamTime();
|
|
|
|
}
|
|
|
|
|
|
|
|
void SDRdaemonFECGui::updateWithStreamTime()
|
|
|
|
{
|
2017-06-08 09:31:24 -04:00
|
|
|
bool updateEventCounts = false;
|
2016-06-19 03:56:49 -04:00
|
|
|
quint64 startingTimeStampMsec = ((quint64) m_startingTimeStamp.tv_sec * 1000LL) + ((quint64) m_startingTimeStamp.tv_usec / 1000LL);
|
|
|
|
QDateTime dt = QDateTime::fromMSecsSinceEpoch(startingTimeStampMsec);
|
|
|
|
QString s_date = dt.toString("yyyy-MM-dd hh:mm:ss.zzz");
|
|
|
|
ui->absTimeText->setText(s_date);
|
|
|
|
|
2017-06-08 09:31:24 -04:00
|
|
|
if (m_framesDecodingStatus == 2)
|
|
|
|
{
|
2016-07-17 18:39:35 -04:00
|
|
|
ui->allFramesDecoded->setStyleSheet("QToolButton { background-color : green; }");
|
2017-06-08 09:31:24 -04:00
|
|
|
}
|
|
|
|
else if (m_framesDecodingStatus == 1)
|
|
|
|
{
|
|
|
|
if (m_countRecovered < 999) m_countRecovered++;
|
|
|
|
updateEventCounts = true;
|
2016-07-25 02:40:10 -04:00
|
|
|
ui->allFramesDecoded->setStyleSheet("QToolButton { background:rgb(56,56,56); }");
|
2017-06-08 09:31:24 -04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (m_countUnrecoverable < 999) m_countUnrecoverable++;
|
|
|
|
updateEventCounts = true;
|
2017-06-08 02:40:21 -04:00
|
|
|
ui->allFramesDecoded->setStyleSheet("QToolButton { background-color : red; }");
|
2016-06-19 03:56:49 -04:00
|
|
|
}
|
|
|
|
|
2016-06-19 19:18:21 -04:00
|
|
|
QString s = QString::number(m_bufferLengthInSecs, 'f', 1);
|
2016-06-19 03:56:49 -04:00
|
|
|
ui->bufferLenSecsText->setText(tr("%1").arg(s));
|
|
|
|
|
2016-06-21 19:10:58 -04:00
|
|
|
s = QString::number(m_bufferGauge, 'f', 0);
|
2016-06-19 03:56:49 -04:00
|
|
|
ui->bufferRWBalanceText->setText(tr("%1").arg(s));
|
|
|
|
|
2016-06-21 19:10:58 -04:00
|
|
|
ui->bufferGaugeNegative->setValue((m_bufferGauge < 0 ? -m_bufferGauge : 0));
|
|
|
|
ui->bufferGaugePositive->setValue((m_bufferGauge < 0 ? 0 : m_bufferGauge));
|
2016-06-19 19:18:21 -04:00
|
|
|
|
2016-07-17 18:39:35 -04:00
|
|
|
s = QString::number(m_minNbBlocks, 'f', 0);
|
|
|
|
ui->minNbBlocksText->setText(tr("%1").arg(s));
|
2016-06-19 19:18:21 -04:00
|
|
|
|
2017-06-08 18:21:05 -04:00
|
|
|
s = QString("%1").arg(m_maxNbRecovery, 2, 10, QChar('0'));
|
2016-07-27 12:49:17 -04:00
|
|
|
ui->maxNbRecoveryText->setText(tr("%1").arg(s));
|
2016-06-19 19:18:21 -04:00
|
|
|
|
2016-07-24 05:09:11 -04:00
|
|
|
s = QString::number(m_nbOriginalBlocks + m_nbFECBlocks, 'f', 0);
|
2017-06-08 18:21:05 -04:00
|
|
|
QString s1 = QString("%1").arg(m_nbFECBlocks, 2, 10, QChar('0'));
|
2016-07-24 05:09:11 -04:00
|
|
|
ui->nominalNbBlocksText->setText(tr("%1/%2").arg(s).arg(s1));
|
2017-06-08 09:31:24 -04:00
|
|
|
|
|
|
|
if (updateEventCounts)
|
|
|
|
{
|
|
|
|
displayEventCounts();
|
|
|
|
}
|
|
|
|
|
|
|
|
displayEventTimer();
|
2016-06-19 03:56:49 -04:00
|
|
|
}
|
|
|
|
|
2017-06-07 20:06:36 -04:00
|
|
|
void SDRdaemonFECGui::updateHardware()
|
|
|
|
{
|
|
|
|
qDebug() << "SDRdaemonSinkGui::updateHardware";
|
|
|
|
SDRdaemonFECInput::MsgConfigureSDRdaemonFEC* message = SDRdaemonFECInput::MsgConfigureSDRdaemonFEC::create(m_settings, m_forceSettings);
|
|
|
|
m_sampleSource->getInputMessageQueue()->push(message);
|
|
|
|
m_forceSettings = false;
|
|
|
|
m_updateTimer.stop();
|
|
|
|
}
|
|
|
|
|
2016-06-19 03:56:49 -04:00
|
|
|
void SDRdaemonFECGui::updateStatus()
|
|
|
|
{
|
|
|
|
int state = m_deviceAPI->state();
|
|
|
|
|
|
|
|
if(m_lastEngineState != state)
|
|
|
|
{
|
|
|
|
switch(state)
|
|
|
|
{
|
2016-10-03 12:29:05 -04:00
|
|
|
case DSPDeviceSourceEngine::StNotStarted:
|
2016-06-19 03:56:49 -04:00
|
|
|
ui->startStop->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
|
|
|
break;
|
2016-10-03 12:29:05 -04:00
|
|
|
case DSPDeviceSourceEngine::StIdle:
|
2016-06-19 03:56:49 -04:00
|
|
|
ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
|
|
|
|
break;
|
2016-10-03 12:29:05 -04:00
|
|
|
case DSPDeviceSourceEngine::StRunning:
|
2016-06-19 03:56:49 -04:00
|
|
|
ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
|
|
|
|
break;
|
2016-10-03 12:29:05 -04:00
|
|
|
case DSPDeviceSourceEngine::StError:
|
2016-06-19 03:56:49 -04:00
|
|
|
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
|
|
|
QMessageBox::information(this, tr("Message"), m_deviceAPI->errorMessage());
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
m_lastEngineState = state;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SDRdaemonFECGui::tick()
|
|
|
|
{
|
|
|
|
if ((++m_tickCount & 0xf) == 0) {
|
|
|
|
SDRdaemonFECInput::MsgConfigureSDRdaemonStreamTiming* message = SDRdaemonFECInput::MsgConfigureSDRdaemonStreamTiming::create();
|
|
|
|
m_sampleSource->getInputMessageQueue()->push(message);
|
|
|
|
}
|
|
|
|
}
|