mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-03-28 07:08:38 -04:00
FileSource channel: final changes. Bumped version and updated changelogs
This commit is contained in:
parent
9526d82ab8
commit
0b0985f918
@ -1,3 +1,10 @@
|
|||||||
|
sdrangel (4.11.0-1) unstable; urgency=medium
|
||||||
|
|
||||||
|
* File Source channel plugin
|
||||||
|
* Flatpak build update
|
||||||
|
|
||||||
|
-- Edouard Griffiths, F4EXB <f4exb06@gmail.com> Tue, 09 Jul 2019 23:04:06 +0200
|
||||||
|
|
||||||
sdrangel (4.10.5-1) unstable; urgency=medium
|
sdrangel (4.10.5-1) unstable; urgency=medium
|
||||||
|
|
||||||
* Windows: removed console display
|
* Windows: removed console display
|
||||||
|
@ -17,8 +17,8 @@ set(CMAKE_CXX_EXTENSIONS OFF)
|
|||||||
|
|
||||||
# configure version
|
# configure version
|
||||||
set(sdrangel_VERSION_MAJOR "4")
|
set(sdrangel_VERSION_MAJOR "4")
|
||||||
set(sdrangel_VERSION_MINOR "10")
|
set(sdrangel_VERSION_MINOR "11")
|
||||||
set(sdrangel_VERSION_PATCH "5")
|
set(sdrangel_VERSION_PATCH "0")
|
||||||
set(sdrangel_VERSION_SUFFIX "")
|
set(sdrangel_VERSION_SUFFIX "")
|
||||||
|
|
||||||
# SDRAngel cmake options
|
# SDRAngel cmake options
|
||||||
|
7
debian/changelog
vendored
7
debian/changelog
vendored
@ -1,3 +1,10 @@
|
|||||||
|
sdrangel (4.11.0-1) unstable; urgency=medium
|
||||||
|
|
||||||
|
* File Source channel plugin
|
||||||
|
* Flatpak build update
|
||||||
|
|
||||||
|
-- Edouard Griffiths, F4EXB <f4exb06@gmail.com> Tue, 09 Jul 2019 23:04:06 +0200
|
||||||
|
|
||||||
sdrangel (4.10.5-1) unstable; urgency=medium
|
sdrangel (4.10.5-1) unstable; urgency=medium
|
||||||
|
|
||||||
* Windows: removed console display
|
* Windows: removed console display
|
||||||
|
@ -36,13 +36,13 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>415</width>
|
<width>412</width>
|
||||||
<height>171</height>
|
<height>181</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>415</width>
|
<width>412</width>
|
||||||
<height>0</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
@ -41,6 +41,7 @@
|
|||||||
#include "dsp/threadedbasebandsamplesource.h"
|
#include "dsp/threadedbasebandsamplesource.h"
|
||||||
#include "dsp/hbfilterchainconverter.h"
|
#include "dsp/hbfilterchainconverter.h"
|
||||||
#include "dsp/filerecord.h"
|
#include "dsp/filerecord.h"
|
||||||
|
#include "util/db.h"
|
||||||
|
|
||||||
MESSAGE_CLASS_DEFINITION(FileSource::MsgConfigureChannelizer, Message)
|
MESSAGE_CLASS_DEFINITION(FileSource::MsgConfigureChannelizer, Message)
|
||||||
MESSAGE_CLASS_DEFINITION(FileSource::MsgSampleRateNotification, Message)
|
MESSAGE_CLASS_DEFINITION(FileSource::MsgSampleRateNotification, Message)
|
||||||
@ -82,6 +83,12 @@ FileSource::FileSource(DeviceAPI *deviceAPI) :
|
|||||||
|
|
||||||
m_networkManager = new QNetworkAccessManager();
|
m_networkManager = new QNetworkAccessManager();
|
||||||
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||||
|
|
||||||
|
m_linearGain = 1.0f;
|
||||||
|
m_magsq = 0.0f;
|
||||||
|
m_magsqSum = 0.0f;
|
||||||
|
m_magsqPeak = 0.0f;
|
||||||
|
m_magsqCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
FileSource::~FileSource()
|
FileSource::~FileSource()
|
||||||
@ -96,6 +103,9 @@ FileSource::~FileSource()
|
|||||||
|
|
||||||
void FileSource::pull(Sample& sample)
|
void FileSource::pull(Sample& sample)
|
||||||
{
|
{
|
||||||
|
Real re;
|
||||||
|
Real im;
|
||||||
|
|
||||||
struct Sample16
|
struct Sample16
|
||||||
{
|
{
|
||||||
int16_t real;
|
int16_t real;
|
||||||
@ -110,12 +120,10 @@ void FileSource::pull(Sample& sample)
|
|||||||
|
|
||||||
if (!m_running)
|
if (!m_running)
|
||||||
{
|
{
|
||||||
sample.setReal(0);
|
re = 0;
|
||||||
sample.setImag(0);
|
im = 0;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
else if (m_sampleSize == 16)
|
||||||
if (m_sampleSize == 16)
|
|
||||||
{
|
{
|
||||||
Sample16 sample16;
|
Sample16 sample16;
|
||||||
m_ifstream.read(reinterpret_cast<char*>(&sample16), sizeof(Sample16));
|
m_ifstream.read(reinterpret_cast<char*>(&sample16), sizeof(Sample16));
|
||||||
@ -126,24 +134,12 @@ void FileSource::pull(Sample& sample)
|
|||||||
m_samplesCount++;
|
m_samplesCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SDR_TX_SAMP_SZ == 16)
|
// scale to +/-1.0
|
||||||
{
|
re = (sample16.real * m_linearGain) / 32760.0f;
|
||||||
sample.setReal(sample16.real);
|
im = (sample16.imag * m_linearGain) / 32760.0f;
|
||||||
sample.setImag(sample16.imag);
|
}
|
||||||
}
|
else if (m_sampleSize == 24)
|
||||||
else if (SDR_TX_SAMP_SZ == 24)
|
{
|
||||||
{
|
|
||||||
sample.setReal(sample16.real << 8);
|
|
||||||
sample.setImag(sample16.imag << 8);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sample.setReal(0);
|
|
||||||
sample.setImag(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (m_sampleSize == 24)
|
|
||||||
{
|
|
||||||
Sample24 sample24;
|
Sample24 sample24;
|
||||||
m_ifstream.read(reinterpret_cast<char*>(&sample24), sizeof(Sample24));
|
m_ifstream.read(reinterpret_cast<char*>(&sample24), sizeof(Sample24));
|
||||||
|
|
||||||
@ -153,27 +149,43 @@ void FileSource::pull(Sample& sample)
|
|||||||
m_samplesCount++;
|
m_samplesCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SDR_TX_SAMP_SZ == 24)
|
// scale to +/-1.0
|
||||||
{
|
re = (sample24.real * m_linearGain) / 8388608.0f;
|
||||||
sample.setReal(sample24.real);
|
im = (sample24.imag * m_linearGain) / 8388608.0f;
|
||||||
sample.setImag(sample24.imag);
|
}
|
||||||
}
|
else
|
||||||
else if (SDR_TX_SAMP_SZ == 16)
|
{
|
||||||
{
|
re = 0;
|
||||||
sample.setReal(sample24.real >> 8);
|
im = 0;
|
||||||
sample.setImag(sample24.imag >> 8);
|
}
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
if (SDR_TX_SAMP_SZ == 16)
|
||||||
sample.setReal(0);
|
{
|
||||||
sample.setImag(0);
|
sample.setReal(re * 32768.0f);
|
||||||
}
|
sample.setImag(im * 32768.0f);
|
||||||
}
|
}
|
||||||
|
else if (SDR_TX_SAMP_SZ == 24)
|
||||||
|
{
|
||||||
|
sample.setReal(re * 8388608.0f);
|
||||||
|
sample.setImag(im * 8388608.0f);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sample.setReal(0);
|
sample.setReal(0);
|
||||||
sample.setImag(0);
|
sample.setImag(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Real magsq = re*re + im*im;
|
||||||
|
m_movingAverage(magsq);
|
||||||
|
m_magsq = m_movingAverage.asDouble();
|
||||||
|
m_magsqSum += magsq;
|
||||||
|
|
||||||
|
if (magsq > m_magsqPeak) {
|
||||||
|
m_magsqPeak = magsq;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_magsqCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileSource::pullAudio(int nbSamples)
|
void FileSource::pullAudio(int nbSamples)
|
||||||
@ -457,13 +469,19 @@ void FileSource::applySettings(const FileSourceSettings& settings, bool force)
|
|||||||
|
|
||||||
QList<QString> reverseAPIKeys;
|
QList<QString> reverseAPIKeys;
|
||||||
|
|
||||||
if ((m_settings.m_loop != settings.m_loop)) {
|
if ((m_settings.m_loop != settings.m_loop) || force) {
|
||||||
reverseAPIKeys.append("loop");
|
reverseAPIKeys.append("loop");
|
||||||
}
|
}
|
||||||
if ((m_settings.m_fileName != settings.m_fileName)) {
|
if ((m_settings.m_fileName != settings.m_fileName) || force) {
|
||||||
reverseAPIKeys.append("fileName");
|
reverseAPIKeys.append("fileName");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((m_settings.m_gainDB != settings.m_gainDB) || force)
|
||||||
|
{
|
||||||
|
m_linearGain = CalcDb::powerFromdB(settings.m_gainDB);
|
||||||
|
reverseAPIKeys.append("gainDB");
|
||||||
|
}
|
||||||
|
|
||||||
if (settings.m_useReverseAPI)
|
if (settings.m_useReverseAPI)
|
||||||
{
|
{
|
||||||
bool fullUpdate = ((m_settings.m_useReverseAPI != settings.m_useReverseAPI) && settings.m_useReverseAPI) ||
|
bool fullUpdate = ((m_settings.m_useReverseAPI != settings.m_useReverseAPI) && settings.m_useReverseAPI) ||
|
||||||
@ -530,6 +548,9 @@ int FileSource::webapiSettingsPutPatch(
|
|||||||
if (channelSettingsKeys.contains("title")) {
|
if (channelSettingsKeys.contains("title")) {
|
||||||
settings.m_title = *response.getFileSourceSettings()->getTitle();
|
settings.m_title = *response.getFileSourceSettings()->getTitle();
|
||||||
}
|
}
|
||||||
|
if (channelSettingsKeys.contains("gainDB")) {
|
||||||
|
settings.m_gainDB = response.getFileSourceSettings()->getGainDb();
|
||||||
|
}
|
||||||
if (channelSettingsKeys.contains("useReverseAPI")) {
|
if (channelSettingsKeys.contains("useReverseAPI")) {
|
||||||
settings.m_useReverseAPI = response.getFileSourceSettings()->getUseReverseApi() != 0;
|
settings.m_useReverseAPI = response.getFileSourceSettings()->getUseReverseApi() != 0;
|
||||||
}
|
}
|
||||||
@ -576,6 +597,7 @@ void FileSource::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& re
|
|||||||
{
|
{
|
||||||
response.getFileSourceSettings()->setLog2Interp(settings.m_log2Interp);
|
response.getFileSourceSettings()->setLog2Interp(settings.m_log2Interp);
|
||||||
response.getFileSourceSettings()->setFilterChainHash(settings.m_filterChainHash);
|
response.getFileSourceSettings()->setFilterChainHash(settings.m_filterChainHash);
|
||||||
|
response.getFileSourceSettings()->setGainDb(settings.m_gainDB);
|
||||||
response.getFileSourceSettings()->setRgbColor(settings.m_rgbColor);
|
response.getFileSourceSettings()->setRgbColor(settings.m_rgbColor);
|
||||||
|
|
||||||
if (response.getFileSourceSettings()->getTitle()) {
|
if (response.getFileSourceSettings()->getTitle()) {
|
||||||
@ -599,9 +621,36 @@ void FileSource::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& re
|
|||||||
|
|
||||||
void FileSource::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)
|
void FileSource::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)
|
||||||
{
|
{
|
||||||
|
qint64 t_sec = 0;
|
||||||
|
qint64 t_msec = 0;
|
||||||
|
quint64 samplesCount = getSamplesCount();
|
||||||
|
|
||||||
|
if (m_fileSampleRate > 0)
|
||||||
|
{
|
||||||
|
t_sec = samplesCount / m_fileSampleRate;
|
||||||
|
t_msec = (samplesCount - (t_sec * m_fileSampleRate)) * 1000 / m_fileSampleRate;
|
||||||
|
}
|
||||||
|
|
||||||
|
QTime t(0, 0, 0, 0);
|
||||||
|
t = t.addSecs(t_sec);
|
||||||
|
t = t.addMSecs(t_msec);
|
||||||
|
response.getFileSourceReport()->setElapsedTime(new QString(t.toString("HH:mm:ss.zzz")));
|
||||||
|
|
||||||
|
qint64 startingTimeStampMsec = m_startingTimeStamp * 1000LL;
|
||||||
|
QDateTime dt = QDateTime::fromMSecsSinceEpoch(startingTimeStampMsec);
|
||||||
|
dt = dt.addSecs(t_sec);
|
||||||
|
dt = dt.addMSecs(t_msec);
|
||||||
|
response.getFileSourceReport()->setAbsoluteTime(new QString(dt.toString("yyyy-MM-dd HH:mm:ss.zzz")));
|
||||||
|
|
||||||
|
QTime recordLength(0, 0, 0, 0);
|
||||||
|
recordLength = recordLength.addSecs(m_recordLength);
|
||||||
|
response.getFileSourceReport()->setDurationTime(new QString(recordLength.toString("HH:mm:ss")));
|
||||||
|
|
||||||
|
response.getFileSourceReport()->setFileName(new QString(m_settings.m_fileName));
|
||||||
response.getFileSourceReport()->setFileSampleRate(m_fileSampleRate);
|
response.getFileSourceReport()->setFileSampleRate(m_fileSampleRate);
|
||||||
response.getFileSourceReport()->setFileSampleSize(m_sampleSize);
|
response.getFileSourceReport()->setFileSampleSize(m_sampleSize);
|
||||||
response.getFileSourceReport()->setSampleRate(m_sampleRate);
|
response.getFileSourceReport()->setSampleRate(m_sampleRate);
|
||||||
|
response.getFileSourceReport()->setChannelPowerDb(CalcDb::dbPower(getMagSq()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileSource::webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const FileSourceSettings& settings, bool force)
|
void FileSource::webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const FileSourceSettings& settings, bool force)
|
||||||
@ -622,6 +671,9 @@ void FileSource::webapiReverseSendSettings(QList<QString>& channelSettingsKeys,
|
|||||||
if (channelSettingsKeys.contains("filterChainHash") || force) {
|
if (channelSettingsKeys.contains("filterChainHash") || force) {
|
||||||
swgFileSourceSettings->setFilterChainHash(settings.m_filterChainHash);
|
swgFileSourceSettings->setFilterChainHash(settings.m_filterChainHash);
|
||||||
}
|
}
|
||||||
|
if (channelSettingsKeys.contains("gainDB") || force) {
|
||||||
|
swgFileSourceSettings->setGainDb(settings.m_gainDB);
|
||||||
|
}
|
||||||
if (channelSettingsKeys.contains("rgbColor") || force) {
|
if (channelSettingsKeys.contains("rgbColor") || force) {
|
||||||
swgFileSourceSettings->setRgbColor(settings.m_rgbColor);
|
swgFileSourceSettings->setRgbColor(settings.m_rgbColor);
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
#include "dsp/basebandsamplesource.h"
|
#include "dsp/basebandsamplesource.h"
|
||||||
#include "channel/channelapi.h"
|
#include "channel/channelapi.h"
|
||||||
#include "util/message.h"
|
#include "util/message.h"
|
||||||
|
#include "util/movingaverage.h"
|
||||||
#include "filesourcesettings.h"
|
#include "filesourcesettings.h"
|
||||||
|
|
||||||
class ThreadedBasebandSampleSource;
|
class ThreadedBasebandSampleSource;
|
||||||
@ -354,11 +354,40 @@ public:
|
|||||||
void setSampleRate(uint32_t sampleRate) { m_sampleRate = sampleRate; }
|
void setSampleRate(uint32_t sampleRate) { m_sampleRate = sampleRate; }
|
||||||
|
|
||||||
quint64 getSamplesCount() const { return m_samplesCount; }
|
quint64 getSamplesCount() const { return m_samplesCount; }
|
||||||
|
double getMagSq() const { return m_magsq; }
|
||||||
|
|
||||||
|
void getMagSqLevels(double& avg, double& peak, int& nbSamples)
|
||||||
|
{
|
||||||
|
if (m_magsqCount > 0)
|
||||||
|
{
|
||||||
|
m_magsq = m_magsqSum / m_magsqCount;
|
||||||
|
m_magSqLevelStore.m_magsq = m_magsq;
|
||||||
|
m_magSqLevelStore.m_magsqPeak = m_magsqPeak;
|
||||||
|
}
|
||||||
|
|
||||||
|
avg = m_magSqLevelStore.m_magsq;
|
||||||
|
peak = m_magSqLevelStore.m_magsqPeak;
|
||||||
|
nbSamples = m_magsqCount == 0 ? 1 : m_magsqCount;
|
||||||
|
|
||||||
|
m_magsqSum = 0.0f;
|
||||||
|
m_magsqPeak = 0.0f;
|
||||||
|
m_magsqCount = 0;
|
||||||
|
}
|
||||||
|
|
||||||
static const QString m_channelIdURI;
|
static const QString m_channelIdURI;
|
||||||
static const QString m_channelId;
|
static const QString m_channelId;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
struct MagSqLevelsStore
|
||||||
|
{
|
||||||
|
MagSqLevelsStore() :
|
||||||
|
m_magsq(1e-12),
|
||||||
|
m_magsqPeak(1e-12)
|
||||||
|
{}
|
||||||
|
double m_magsq;
|
||||||
|
double m_magsqPeak;
|
||||||
|
};
|
||||||
|
|
||||||
DeviceAPI* m_deviceAPI;
|
DeviceAPI* m_deviceAPI;
|
||||||
QMutex m_mutex;
|
QMutex m_mutex;
|
||||||
ThreadedBasebandSampleSource* m_threadedChannelizer;
|
ThreadedBasebandSampleSource* m_threadedChannelizer;
|
||||||
@ -380,6 +409,14 @@ private:
|
|||||||
QNetworkAccessManager *m_networkManager;
|
QNetworkAccessManager *m_networkManager;
|
||||||
QNetworkRequest m_networkRequest;
|
QNetworkRequest m_networkRequest;
|
||||||
|
|
||||||
|
double m_linearGain;
|
||||||
|
double m_magsq;
|
||||||
|
double m_magsqSum;
|
||||||
|
double m_magsqPeak;
|
||||||
|
int m_magsqCount;
|
||||||
|
MagSqLevelsStore m_magSqLevelStore;
|
||||||
|
MovingAverageUtil<Real, double, 16> m_movingAverage;
|
||||||
|
|
||||||
void openFileStream();
|
void openFileStream();
|
||||||
void seekFileStream(int seekMillis);
|
void seekFileStream(int seekMillis);
|
||||||
void handleEOF();
|
void handleEOF();
|
||||||
|
@ -25,6 +25,8 @@
|
|||||||
#include "device/deviceuiset.h"
|
#include "device/deviceuiset.h"
|
||||||
#include "dsp/hbfilterchainconverter.h"
|
#include "dsp/hbfilterchainconverter.h"
|
||||||
#include "gui/basicchannelsettingsdialog.h"
|
#include "gui/basicchannelsettingsdialog.h"
|
||||||
|
#include "util/db.h"
|
||||||
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
|
||||||
#include "filesource.h"
|
#include "filesource.h"
|
||||||
@ -169,7 +171,10 @@ FileSourceGUI::FileSourceGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Bas
|
|||||||
m_tickCount(0)
|
m_tickCount(0)
|
||||||
{
|
{
|
||||||
(void) channelTx;
|
(void) channelTx;
|
||||||
|
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
ui->channelPowerMeter->setColorTheme(LevelMeterSignalDB::ColorGreenAndBlue);
|
||||||
|
|
||||||
setAttribute(Qt::WA_DeleteOnClose, true);
|
setAttribute(Qt::WA_DeleteOnClose, true);
|
||||||
connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
|
connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
|
||||||
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
|
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
|
||||||
@ -307,6 +312,8 @@ void FileSourceGUI::displaySettings()
|
|||||||
setWindowTitle(m_channelMarker.getTitle());
|
setWindowTitle(m_channelMarker.getTitle());
|
||||||
|
|
||||||
blockApplySettings(true);
|
blockApplySettings(true);
|
||||||
|
ui->gain->setValue(m_settings.m_gainDB);
|
||||||
|
ui->gainText->setText(tr("%1 dB").arg(m_settings.m_gainDB));
|
||||||
ui->interpolationFactor->setCurrentIndex(m_settings.m_log2Interp);
|
ui->interpolationFactor->setCurrentIndex(m_settings.m_log2Interp);
|
||||||
applyInterpolation();
|
applyInterpolation();
|
||||||
blockApplySettings(false);
|
blockApplySettings(false);
|
||||||
@ -395,6 +402,13 @@ void FileSourceGUI::on_position_valueChanged(int value)
|
|||||||
applyPosition();
|
applyPosition();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FileSourceGUI::on_gain_valueChanged(int value)
|
||||||
|
{
|
||||||
|
ui->gainText->setText(tr("%1 dB").arg(value));
|
||||||
|
m_settings.m_gainDB = value;
|
||||||
|
applySettings();
|
||||||
|
}
|
||||||
|
|
||||||
void FileSourceGUI::on_showFileDialog_clicked(bool checked)
|
void FileSourceGUI::on_showFileDialog_clicked(bool checked)
|
||||||
{
|
{
|
||||||
(void) checked;
|
(void) checked;
|
||||||
@ -464,6 +478,21 @@ void FileSourceGUI::applyPosition()
|
|||||||
|
|
||||||
void FileSourceGUI::tick()
|
void FileSourceGUI::tick()
|
||||||
{
|
{
|
||||||
|
double magsqAvg, magsqPeak;
|
||||||
|
int nbMagsqSamples;
|
||||||
|
m_fileSource->getMagSqLevels(magsqAvg, magsqPeak, nbMagsqSamples);
|
||||||
|
double powDbAvg = CalcDb::dbPower(magsqAvg);
|
||||||
|
double powDbPeak = CalcDb::dbPower(magsqPeak);
|
||||||
|
|
||||||
|
ui->channelPowerMeter->levelChanged(
|
||||||
|
(100.0f + powDbAvg) / 100.0f,
|
||||||
|
(100.0f + powDbPeak) / 100.0f,
|
||||||
|
nbMagsqSamples);
|
||||||
|
|
||||||
|
if (m_tickCount % 4 == 0) {
|
||||||
|
ui->channelPower->setText(QString::number(powDbAvg, 'f', 1));
|
||||||
|
}
|
||||||
|
|
||||||
if (++m_tickCount == 20) // once per second
|
if (++m_tickCount == 20) // once per second
|
||||||
{
|
{
|
||||||
FileSource::MsgConfigureFileSourceStreamTiming* message = FileSource::MsgConfigureFileSourceStreamTiming::create();
|
FileSource::MsgConfigureFileSourceStreamTiming* message = FileSource::MsgConfigureFileSourceStreamTiming::create();
|
||||||
|
@ -106,6 +106,7 @@ private slots:
|
|||||||
void onMenuDialogCalled(const QPoint& p);
|
void onMenuDialogCalled(const QPoint& p);
|
||||||
void on_interpolationFactor_currentIndexChanged(int index);
|
void on_interpolationFactor_currentIndexChanged(int index);
|
||||||
void on_position_valueChanged(int value);
|
void on_position_valueChanged(int value);
|
||||||
|
void on_gain_valueChanged(int value);
|
||||||
void on_showFileDialog_clicked(bool checked);
|
void on_showFileDialog_clicked(bool checked);
|
||||||
void on_playLoop_toggled(bool checked);
|
void on_playLoop_toggled(bool checked);
|
||||||
void on_play_toggled(bool checked);
|
void on_play_toggled(bool checked);
|
||||||
|
@ -6,28 +6,22 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>320</width>
|
<width>382</width>
|
||||||
<height>177</height>
|
<height>228</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>320</width>
|
<width>382</width>
|
||||||
<height>140</height>
|
<height>140</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>320</width>
|
|
||||||
<height>16777215</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<family>Liberation Sans</family>
|
<family>Liberation Sans</family>
|
||||||
@ -40,12 +34,18 @@
|
|||||||
<widget class="QWidget" name="settingsContainer" native="true">
|
<widget class="QWidget" name="settingsContainer" native="true">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>0</x>
|
||||||
<y>10</y>
|
<y>0</y>
|
||||||
<width>301</width>
|
<width>380</width>
|
||||||
<height>161</height>
|
<height>221</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>380</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Settings</string>
|
<string>Settings</string>
|
||||||
</property>
|
</property>
|
||||||
@ -253,6 +253,117 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="powerLayer">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="powerMeterLayer">
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="channelPowerUnits">
|
||||||
|
<property name="text">
|
||||||
|
<string>dB</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="LevelMeterSignalDB" name="channelPowerMeter" native="true">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>24</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<family>Liberation Mono</family>
|
||||||
|
<pointsize>8</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="channelPower">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>-100.0</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="gainLayer">
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>10</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="gainLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Gain</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QSlider" name="gain">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Gain (dB)</string>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>-10</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>50</number>
|
||||||
|
</property>
|
||||||
|
<property name="pageStep">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="gainText">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>45</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Filter chain hash code</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>-10.0 dB</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="fileSelectionLayout">
|
<layout class="QHBoxLayout" name="fileSelectionLayout">
|
||||||
<item>
|
<item>
|
||||||
@ -299,13 +410,13 @@
|
|||||||
<widget class="QLabel" name="sampleRateText">
|
<widget class="QLabel" name="sampleRateText">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>40</width>
|
<width>54</width>
|
||||||
<height>0</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<pointsize>8</pointsize>
|
<pointsize>9</pointsize>
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
@ -330,13 +441,13 @@
|
|||||||
<widget class="QLabel" name="sampleSizeText">
|
<widget class="QLabel" name="sampleSizeText">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>22</width>
|
<width>24</width>
|
||||||
<height>0</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<pointsize>8</pointsize>
|
<pointsize>9</pointsize>
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
@ -361,7 +472,7 @@
|
|||||||
<widget class="QLabel" name="crcLabel">
|
<widget class="QLabel" name="crcLabel">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<pointsize>8</pointsize>
|
<pointsize>9</pointsize>
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
@ -595,6 +706,12 @@
|
|||||||
<extends>QToolButton</extends>
|
<extends>QToolButton</extends>
|
||||||
<header>gui/buttonswitch.h</header>
|
<header>gui/buttonswitch.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>LevelMeterSignalDB</class>
|
||||||
|
<extends>QWidget</extends>
|
||||||
|
<header>gui/levelmeter.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../../../sdrgui/resources/res.qrc"/>
|
<include location="../../../sdrgui/resources/res.qrc"/>
|
||||||
|
@ -34,6 +34,7 @@ void FileSourceSettings::resetToDefaults()
|
|||||||
m_loop = false;
|
m_loop = false;
|
||||||
m_log2Interp = 0;
|
m_log2Interp = 0;
|
||||||
m_filterChainHash = 0;
|
m_filterChainHash = 0;
|
||||||
|
m_gainDB = 0;
|
||||||
m_rgbColor = QColor(140, 4, 4).rgb();
|
m_rgbColor = QColor(140, 4, 4).rgb();
|
||||||
m_title = "File source";
|
m_title = "File source";
|
||||||
m_channelMarker = nullptr;
|
m_channelMarker = nullptr;
|
||||||
@ -51,13 +52,14 @@ QByteArray FileSourceSettings::serialize() const
|
|||||||
s.writeBool(2, m_loop);
|
s.writeBool(2, m_loop);
|
||||||
s.writeU32(3, m_log2Interp);
|
s.writeU32(3, m_log2Interp);
|
||||||
s.writeU32(4, m_filterChainHash);
|
s.writeU32(4, m_filterChainHash);
|
||||||
s.writeU32(5, m_rgbColor);
|
s.writeS32(5, m_gainDB);
|
||||||
s.writeString(6, m_title);
|
s.writeU32(6, m_rgbColor);
|
||||||
s.writeBool(7, m_useReverseAPI);
|
s.writeString(7, m_title);
|
||||||
s.writeString(8, m_reverseAPIAddress);
|
s.writeBool(8, m_useReverseAPI);
|
||||||
s.writeU32(9, m_reverseAPIPort);
|
s.writeString(9, m_reverseAPIAddress);
|
||||||
s.writeU32(10, m_reverseAPIDeviceIndex);
|
s.writeU32(10, m_reverseAPIPort);
|
||||||
s.writeU32(11, m_reverseAPIChannelIndex);
|
s.writeU32(11, m_reverseAPIDeviceIndex);
|
||||||
|
s.writeU32(12, m_reverseAPIChannelIndex);
|
||||||
|
|
||||||
return s.final();
|
return s.final();
|
||||||
}
|
}
|
||||||
@ -75,6 +77,7 @@ bool FileSourceSettings::deserialize(const QByteArray& data)
|
|||||||
if(d.getVersion() == 1)
|
if(d.getVersion() == 1)
|
||||||
{
|
{
|
||||||
uint32_t tmp;
|
uint32_t tmp;
|
||||||
|
int itmp;
|
||||||
QString strtmp;
|
QString strtmp;
|
||||||
|
|
||||||
d.readString(1, &m_fileName, "test.sdriq");
|
d.readString(1, &m_fileName, "test.sdriq");
|
||||||
@ -82,6 +85,8 @@ bool FileSourceSettings::deserialize(const QByteArray& data)
|
|||||||
d.readU32(3, &tmp, 0);
|
d.readU32(3, &tmp, 0);
|
||||||
m_log2Interp = tmp > 6 ? 6 : tmp;
|
m_log2Interp = tmp > 6 ? 6 : tmp;
|
||||||
d.readU32(4, &m_filterChainHash, 0);
|
d.readU32(4, &m_filterChainHash, 0);
|
||||||
|
d.readS32(5, &itmp, 20);
|
||||||
|
m_gainDB = itmp < -10 ? -10 : itmp > 50 ? 50 : itmp;
|
||||||
d.readU32(5, &m_rgbColor, QColor(140, 4, 4).rgb());
|
d.readU32(5, &m_rgbColor, QColor(140, 4, 4).rgb());
|
||||||
d.readString(6, &m_title, "File source");
|
d.readString(6, &m_title, "File source");
|
||||||
d.readBool(7, &m_useReverseAPI, false);
|
d.readBool(7, &m_useReverseAPI, false);
|
||||||
|
@ -29,6 +29,7 @@ struct FileSourceSettings
|
|||||||
bool m_loop;
|
bool m_loop;
|
||||||
uint32_t m_log2Interp;
|
uint32_t m_log2Interp;
|
||||||
uint32_t m_filterChainHash;
|
uint32_t m_filterChainHash;
|
||||||
|
int m_gainDB;
|
||||||
quint32 m_rgbColor;
|
quint32 m_rgbColor;
|
||||||
QString m_title;
|
QString m_title;
|
||||||
bool m_useReverseAPI;
|
bool m_useReverseAPI;
|
||||||
|
@ -2635,6 +2635,11 @@ margin-bottom: 20px;
|
|||||||
"sampleRate" : {
|
"sampleRate" : {
|
||||||
"type" : "integer",
|
"type" : "integer",
|
||||||
"description" : "Channel sample rate in S/s"
|
"description" : "Channel sample rate in S/s"
|
||||||
|
},
|
||||||
|
"channelPowerDB" : {
|
||||||
|
"type" : "number",
|
||||||
|
"format" : "float",
|
||||||
|
"description" : "power transmitted in channel (dB)"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"description" : "FileSource"
|
"description" : "FileSource"
|
||||||
@ -2655,6 +2660,9 @@ margin-bottom: 20px;
|
|||||||
"filterChainHash" : {
|
"filterChainHash" : {
|
||||||
"type" : "integer"
|
"type" : "integer"
|
||||||
},
|
},
|
||||||
|
"gainDB" : {
|
||||||
|
"type" : "integer"
|
||||||
|
},
|
||||||
"rgbColor" : {
|
"rgbColor" : {
|
||||||
"type" : "integer"
|
"type" : "integer"
|
||||||
},
|
},
|
||||||
@ -25233,7 +25241,7 @@ except ApiException as e:
|
|||||||
</div>
|
</div>
|
||||||
<div id="generator">
|
<div id="generator">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
Generated 2019-07-08T00:35:02.822+02:00
|
Generated 2019-07-10T00:43:21.317+02:00
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -11,6 +11,8 @@ FileSourceSettings:
|
|||||||
type: integer
|
type: integer
|
||||||
filterChainHash:
|
filterChainHash:
|
||||||
type: integer
|
type: integer
|
||||||
|
gainDB:
|
||||||
|
type: integer
|
||||||
rgbColor:
|
rgbColor:
|
||||||
type: integer
|
type: integer
|
||||||
title:
|
title:
|
||||||
@ -50,3 +52,7 @@ FileSourceReport:
|
|||||||
sampleRate:
|
sampleRate:
|
||||||
description: Channel sample rate in S/s
|
description: Channel sample rate in S/s
|
||||||
type: integer
|
type: integer
|
||||||
|
channelPowerDB:
|
||||||
|
description: power transmitted in channel (dB)
|
||||||
|
type: number
|
||||||
|
format: float
|
||||||
|
@ -11,6 +11,8 @@ FileSourceSettings:
|
|||||||
type: integer
|
type: integer
|
||||||
filterChainHash:
|
filterChainHash:
|
||||||
type: integer
|
type: integer
|
||||||
|
gainDB:
|
||||||
|
type: integer
|
||||||
rgbColor:
|
rgbColor:
|
||||||
type: integer
|
type: integer
|
||||||
title:
|
title:
|
||||||
@ -50,3 +52,7 @@ FileSourceReport:
|
|||||||
sampleRate:
|
sampleRate:
|
||||||
description: Channel sample rate in S/s
|
description: Channel sample rate in S/s
|
||||||
type: integer
|
type: integer
|
||||||
|
channelPowerDB:
|
||||||
|
description: power transmitted in channel (dB)
|
||||||
|
type: number
|
||||||
|
format: float
|
||||||
|
@ -2635,6 +2635,11 @@ margin-bottom: 20px;
|
|||||||
"sampleRate" : {
|
"sampleRate" : {
|
||||||
"type" : "integer",
|
"type" : "integer",
|
||||||
"description" : "Channel sample rate in S/s"
|
"description" : "Channel sample rate in S/s"
|
||||||
|
},
|
||||||
|
"channelPowerDB" : {
|
||||||
|
"type" : "number",
|
||||||
|
"format" : "float",
|
||||||
|
"description" : "power transmitted in channel (dB)"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"description" : "FileSource"
|
"description" : "FileSource"
|
||||||
@ -2655,6 +2660,9 @@ margin-bottom: 20px;
|
|||||||
"filterChainHash" : {
|
"filterChainHash" : {
|
||||||
"type" : "integer"
|
"type" : "integer"
|
||||||
},
|
},
|
||||||
|
"gainDB" : {
|
||||||
|
"type" : "integer"
|
||||||
|
},
|
||||||
"rgbColor" : {
|
"rgbColor" : {
|
||||||
"type" : "integer"
|
"type" : "integer"
|
||||||
},
|
},
|
||||||
@ -25233,7 +25241,7 @@ except ApiException as e:
|
|||||||
</div>
|
</div>
|
||||||
<div id="generator">
|
<div id="generator">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
Generated 2019-07-08T00:35:02.822+02:00
|
Generated 2019-07-10T00:43:21.317+02:00
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -42,6 +42,8 @@ SWGFileSourceReport::SWGFileSourceReport() {
|
|||||||
m_duration_time_isSet = false;
|
m_duration_time_isSet = false;
|
||||||
sample_rate = 0;
|
sample_rate = 0;
|
||||||
m_sample_rate_isSet = false;
|
m_sample_rate_isSet = false;
|
||||||
|
channel_power_db = 0.0f;
|
||||||
|
m_channel_power_db_isSet = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
SWGFileSourceReport::~SWGFileSourceReport() {
|
SWGFileSourceReport::~SWGFileSourceReport() {
|
||||||
@ -64,6 +66,8 @@ SWGFileSourceReport::init() {
|
|||||||
m_duration_time_isSet = false;
|
m_duration_time_isSet = false;
|
||||||
sample_rate = 0;
|
sample_rate = 0;
|
||||||
m_sample_rate_isSet = false;
|
m_sample_rate_isSet = false;
|
||||||
|
channel_power_db = 0.0f;
|
||||||
|
m_channel_power_db_isSet = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -83,6 +87,7 @@ SWGFileSourceReport::cleanup() {
|
|||||||
delete duration_time;
|
delete duration_time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SWGFileSourceReport*
|
SWGFileSourceReport*
|
||||||
@ -110,6 +115,8 @@ SWGFileSourceReport::fromJsonObject(QJsonObject &pJson) {
|
|||||||
|
|
||||||
::SWGSDRangel::setValue(&sample_rate, pJson["sampleRate"], "qint32", "");
|
::SWGSDRangel::setValue(&sample_rate, pJson["sampleRate"], "qint32", "");
|
||||||
|
|
||||||
|
::SWGSDRangel::setValue(&channel_power_db, pJson["channelPowerDB"], "float", "");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString
|
QString
|
||||||
@ -147,6 +154,9 @@ SWGFileSourceReport::asJsonObject() {
|
|||||||
if(m_sample_rate_isSet){
|
if(m_sample_rate_isSet){
|
||||||
obj->insert("sampleRate", QJsonValue(sample_rate));
|
obj->insert("sampleRate", QJsonValue(sample_rate));
|
||||||
}
|
}
|
||||||
|
if(m_channel_power_db_isSet){
|
||||||
|
obj->insert("channelPowerDB", QJsonValue(channel_power_db));
|
||||||
|
}
|
||||||
|
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
@ -221,6 +231,16 @@ SWGFileSourceReport::setSampleRate(qint32 sample_rate) {
|
|||||||
this->m_sample_rate_isSet = true;
|
this->m_sample_rate_isSet = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float
|
||||||
|
SWGFileSourceReport::getChannelPowerDb() {
|
||||||
|
return channel_power_db;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGFileSourceReport::setChannelPowerDb(float channel_power_db) {
|
||||||
|
this->channel_power_db = channel_power_db;
|
||||||
|
this->m_channel_power_db_isSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
SWGFileSourceReport::isSet(){
|
SWGFileSourceReport::isSet(){
|
||||||
@ -233,6 +253,7 @@ SWGFileSourceReport::isSet(){
|
|||||||
if(elapsed_time != nullptr && *elapsed_time != QString("")){ isObjectUpdated = true; break;}
|
if(elapsed_time != nullptr && *elapsed_time != QString("")){ isObjectUpdated = true; break;}
|
||||||
if(duration_time != nullptr && *duration_time != QString("")){ isObjectUpdated = true; break;}
|
if(duration_time != nullptr && *duration_time != QString("")){ isObjectUpdated = true; break;}
|
||||||
if(m_sample_rate_isSet){ isObjectUpdated = true; break;}
|
if(m_sample_rate_isSet){ isObjectUpdated = true; break;}
|
||||||
|
if(m_channel_power_db_isSet){ isObjectUpdated = true; break;}
|
||||||
}while(false);
|
}while(false);
|
||||||
return isObjectUpdated;
|
return isObjectUpdated;
|
||||||
}
|
}
|
||||||
|
@ -63,6 +63,9 @@ public:
|
|||||||
qint32 getSampleRate();
|
qint32 getSampleRate();
|
||||||
void setSampleRate(qint32 sample_rate);
|
void setSampleRate(qint32 sample_rate);
|
||||||
|
|
||||||
|
float getChannelPowerDb();
|
||||||
|
void setChannelPowerDb(float channel_power_db);
|
||||||
|
|
||||||
|
|
||||||
virtual bool isSet() override;
|
virtual bool isSet() override;
|
||||||
|
|
||||||
@ -88,6 +91,9 @@ private:
|
|||||||
qint32 sample_rate;
|
qint32 sample_rate;
|
||||||
bool m_sample_rate_isSet;
|
bool m_sample_rate_isSet;
|
||||||
|
|
||||||
|
float channel_power_db;
|
||||||
|
bool m_channel_power_db_isSet;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,8 @@ SWGFileSourceSettings::SWGFileSourceSettings() {
|
|||||||
m_log2_interp_isSet = false;
|
m_log2_interp_isSet = false;
|
||||||
filter_chain_hash = 0;
|
filter_chain_hash = 0;
|
||||||
m_filter_chain_hash_isSet = false;
|
m_filter_chain_hash_isSet = false;
|
||||||
|
gain_db = 0;
|
||||||
|
m_gain_db_isSet = false;
|
||||||
rgb_color = 0;
|
rgb_color = 0;
|
||||||
m_rgb_color_isSet = false;
|
m_rgb_color_isSet = false;
|
||||||
title = nullptr;
|
title = nullptr;
|
||||||
@ -66,6 +68,8 @@ SWGFileSourceSettings::init() {
|
|||||||
m_log2_interp_isSet = false;
|
m_log2_interp_isSet = false;
|
||||||
filter_chain_hash = 0;
|
filter_chain_hash = 0;
|
||||||
m_filter_chain_hash_isSet = false;
|
m_filter_chain_hash_isSet = false;
|
||||||
|
gain_db = 0;
|
||||||
|
m_gain_db_isSet = false;
|
||||||
rgb_color = 0;
|
rgb_color = 0;
|
||||||
m_rgb_color_isSet = false;
|
m_rgb_color_isSet = false;
|
||||||
title = new QString("");
|
title = new QString("");
|
||||||
@ -91,6 +95,7 @@ SWGFileSourceSettings::cleanup() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(title != nullptr) {
|
if(title != nullptr) {
|
||||||
delete title;
|
delete title;
|
||||||
}
|
}
|
||||||
@ -122,6 +127,8 @@ SWGFileSourceSettings::fromJsonObject(QJsonObject &pJson) {
|
|||||||
|
|
||||||
::SWGSDRangel::setValue(&filter_chain_hash, pJson["filterChainHash"], "qint32", "");
|
::SWGSDRangel::setValue(&filter_chain_hash, pJson["filterChainHash"], "qint32", "");
|
||||||
|
|
||||||
|
::SWGSDRangel::setValue(&gain_db, pJson["gainDB"], "qint32", "");
|
||||||
|
|
||||||
::SWGSDRangel::setValue(&rgb_color, pJson["rgbColor"], "qint32", "");
|
::SWGSDRangel::setValue(&rgb_color, pJson["rgbColor"], "qint32", "");
|
||||||
|
|
||||||
::SWGSDRangel::setValue(&title, pJson["title"], "QString", "QString");
|
::SWGSDRangel::setValue(&title, pJson["title"], "QString", "QString");
|
||||||
@ -164,6 +171,9 @@ SWGFileSourceSettings::asJsonObject() {
|
|||||||
if(m_filter_chain_hash_isSet){
|
if(m_filter_chain_hash_isSet){
|
||||||
obj->insert("filterChainHash", QJsonValue(filter_chain_hash));
|
obj->insert("filterChainHash", QJsonValue(filter_chain_hash));
|
||||||
}
|
}
|
||||||
|
if(m_gain_db_isSet){
|
||||||
|
obj->insert("gainDB", QJsonValue(gain_db));
|
||||||
|
}
|
||||||
if(m_rgb_color_isSet){
|
if(m_rgb_color_isSet){
|
||||||
obj->insert("rgbColor", QJsonValue(rgb_color));
|
obj->insert("rgbColor", QJsonValue(rgb_color));
|
||||||
}
|
}
|
||||||
@ -229,6 +239,16 @@ SWGFileSourceSettings::setFilterChainHash(qint32 filter_chain_hash) {
|
|||||||
this->m_filter_chain_hash_isSet = true;
|
this->m_filter_chain_hash_isSet = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qint32
|
||||||
|
SWGFileSourceSettings::getGainDb() {
|
||||||
|
return gain_db;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGFileSourceSettings::setGainDb(qint32 gain_db) {
|
||||||
|
this->gain_db = gain_db;
|
||||||
|
this->m_gain_db_isSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
qint32
|
qint32
|
||||||
SWGFileSourceSettings::getRgbColor() {
|
SWGFileSourceSettings::getRgbColor() {
|
||||||
return rgb_color;
|
return rgb_color;
|
||||||
@ -308,6 +328,7 @@ SWGFileSourceSettings::isSet(){
|
|||||||
if(m_loop_isSet){ isObjectUpdated = true; break;}
|
if(m_loop_isSet){ isObjectUpdated = true; break;}
|
||||||
if(m_log2_interp_isSet){ isObjectUpdated = true; break;}
|
if(m_log2_interp_isSet){ isObjectUpdated = true; break;}
|
||||||
if(m_filter_chain_hash_isSet){ isObjectUpdated = true; break;}
|
if(m_filter_chain_hash_isSet){ isObjectUpdated = true; break;}
|
||||||
|
if(m_gain_db_isSet){ isObjectUpdated = true; break;}
|
||||||
if(m_rgb_color_isSet){ isObjectUpdated = true; break;}
|
if(m_rgb_color_isSet){ isObjectUpdated = true; break;}
|
||||||
if(title != nullptr && *title != QString("")){ isObjectUpdated = true; break;}
|
if(title != nullptr && *title != QString("")){ isObjectUpdated = true; break;}
|
||||||
if(m_use_reverse_api_isSet){ isObjectUpdated = true; break;}
|
if(m_use_reverse_api_isSet){ isObjectUpdated = true; break;}
|
||||||
|
@ -54,6 +54,9 @@ public:
|
|||||||
qint32 getFilterChainHash();
|
qint32 getFilterChainHash();
|
||||||
void setFilterChainHash(qint32 filter_chain_hash);
|
void setFilterChainHash(qint32 filter_chain_hash);
|
||||||
|
|
||||||
|
qint32 getGainDb();
|
||||||
|
void setGainDb(qint32 gain_db);
|
||||||
|
|
||||||
qint32 getRgbColor();
|
qint32 getRgbColor();
|
||||||
void setRgbColor(qint32 rgb_color);
|
void setRgbColor(qint32 rgb_color);
|
||||||
|
|
||||||
@ -91,6 +94,9 @@ private:
|
|||||||
qint32 filter_chain_hash;
|
qint32 filter_chain_hash;
|
||||||
bool m_filter_chain_hash_isSet;
|
bool m_filter_chain_hash_isSet;
|
||||||
|
|
||||||
|
qint32 gain_db;
|
||||||
|
bool m_gain_db_isSet;
|
||||||
|
|
||||||
qint32 rgb_color;
|
qint32 rgb_color;
|
||||||
bool m_rgb_color_isSet;
|
bool m_rgb_color_isSet;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user