From 0b0985f9189016f8e31894214ca5a6d3c6d7af09 Mon Sep 17 00:00:00 2001 From: f4exb Date: Wed, 10 Jul 2019 01:58:29 +0200 Subject: [PATCH] FileSource channel: final changes. Bumped version and updated changelogs --- CHANGELOG | 7 + CMakeLists.txt | 4 +- debian/changelog | 7 + plugins/channelrx/demodssb/ssbdemodgui.ui | 6 +- plugins/channeltx/filesource/filesource.cpp | 134 ++++++++++----- plugins/channeltx/filesource/filesource.h | 39 ++++- .../channeltx/filesource/filesourcegui.cpp | 29 ++++ plugins/channeltx/filesource/filesourcegui.h | 1 + plugins/channeltx/filesource/filesourcegui.ui | 155 +++++++++++++++--- .../filesource/filesourcesettings.cpp | 19 ++- .../channeltx/filesource/filesourcesettings.h | 1 + sdrbase/resources/webapi/doc/html2/index.html | 10 +- .../doc/swagger/include/FileSource.yaml | 6 + .../api/swagger/include/FileSource.yaml | 6 + swagger/sdrangel/code/html2/index.html | 10 +- .../code/qt5/client/SWGFileSourceReport.cpp | 21 +++ .../code/qt5/client/SWGFileSourceReport.h | 6 + .../code/qt5/client/SWGFileSourceSettings.cpp | 21 +++ .../code/qt5/client/SWGFileSourceSettings.h | 6 + 19 files changed, 413 insertions(+), 75 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 8f598a712..8df03cead 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,10 @@ +sdrangel (4.11.0-1) unstable; urgency=medium + + * File Source channel plugin + * Flatpak build update + + -- Edouard Griffiths, F4EXB Tue, 09 Jul 2019 23:04:06 +0200 + sdrangel (4.10.5-1) unstable; urgency=medium * Windows: removed console display diff --git a/CMakeLists.txt b/CMakeLists.txt index 9ef1b47cd..f1b31ed42 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,8 +17,8 @@ set(CMAKE_CXX_EXTENSIONS OFF) # configure version set(sdrangel_VERSION_MAJOR "4") -set(sdrangel_VERSION_MINOR "10") -set(sdrangel_VERSION_PATCH "5") +set(sdrangel_VERSION_MINOR "11") +set(sdrangel_VERSION_PATCH "0") set(sdrangel_VERSION_SUFFIX "") # SDRAngel cmake options diff --git a/debian/changelog b/debian/changelog index 8f598a712..8df03cead 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +sdrangel (4.11.0-1) unstable; urgency=medium + + * File Source channel plugin + * Flatpak build update + + -- Edouard Griffiths, F4EXB Tue, 09 Jul 2019 23:04:06 +0200 + sdrangel (4.10.5-1) unstable; urgency=medium * Windows: removed console display diff --git a/plugins/channelrx/demodssb/ssbdemodgui.ui b/plugins/channelrx/demodssb/ssbdemodgui.ui index 6b29df55c..6eb9bd307 100644 --- a/plugins/channelrx/demodssb/ssbdemodgui.ui +++ b/plugins/channelrx/demodssb/ssbdemodgui.ui @@ -36,13 +36,13 @@ 0 0 - 415 - 171 + 412 + 181 - 415 + 412 0 diff --git a/plugins/channeltx/filesource/filesource.cpp b/plugins/channeltx/filesource/filesource.cpp index ea8ecc616..edfb48a9f 100644 --- a/plugins/channeltx/filesource/filesource.cpp +++ b/plugins/channeltx/filesource/filesource.cpp @@ -41,6 +41,7 @@ #include "dsp/threadedbasebandsamplesource.h" #include "dsp/hbfilterchainconverter.h" #include "dsp/filerecord.h" +#include "util/db.h" MESSAGE_CLASS_DEFINITION(FileSource::MsgConfigureChannelizer, Message) MESSAGE_CLASS_DEFINITION(FileSource::MsgSampleRateNotification, Message) @@ -82,6 +83,12 @@ FileSource::FileSource(DeviceAPI *deviceAPI) : m_networkManager = new QNetworkAccessManager(); 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() @@ -96,6 +103,9 @@ FileSource::~FileSource() void FileSource::pull(Sample& sample) { + Real re; + Real im; + struct Sample16 { int16_t real; @@ -110,12 +120,10 @@ void FileSource::pull(Sample& sample) if (!m_running) { - sample.setReal(0); - sample.setImag(0); - return; + re = 0; + im = 0; } - - if (m_sampleSize == 16) + else if (m_sampleSize == 16) { Sample16 sample16; m_ifstream.read(reinterpret_cast(&sample16), sizeof(Sample16)); @@ -126,24 +134,12 @@ void FileSource::pull(Sample& sample) m_samplesCount++; } - if (SDR_TX_SAMP_SZ == 16) - { - sample.setReal(sample16.real); - sample.setImag(sample16.imag); - } - 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) - { + // scale to +/-1.0 + re = (sample16.real * m_linearGain) / 32760.0f; + im = (sample16.imag * m_linearGain) / 32760.0f; + } + else if (m_sampleSize == 24) + { Sample24 sample24; m_ifstream.read(reinterpret_cast(&sample24), sizeof(Sample24)); @@ -153,27 +149,43 @@ void FileSource::pull(Sample& sample) m_samplesCount++; } - if (SDR_TX_SAMP_SZ == 24) - { - sample.setReal(sample24.real); - sample.setImag(sample24.imag); - } - else if (SDR_TX_SAMP_SZ == 16) - { - sample.setReal(sample24.real >> 8); - sample.setImag(sample24.imag >> 8); - } - else - { - sample.setReal(0); - sample.setImag(0); - } - } + // scale to +/-1.0 + re = (sample24.real * m_linearGain) / 8388608.0f; + im = (sample24.imag * m_linearGain) / 8388608.0f; + } + else + { + re = 0; + im = 0; + } + + + if (SDR_TX_SAMP_SZ == 16) + { + 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 { sample.setReal(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) @@ -457,13 +469,19 @@ void FileSource::applySettings(const FileSourceSettings& settings, bool force) QList reverseAPIKeys; - if ((m_settings.m_loop != settings.m_loop)) { + if ((m_settings.m_loop != settings.m_loop) || force) { reverseAPIKeys.append("loop"); } - if ((m_settings.m_fileName != settings.m_fileName)) { + if ((m_settings.m_fileName != settings.m_fileName) || force) { 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) { bool fullUpdate = ((m_settings.m_useReverseAPI != settings.m_useReverseAPI) && settings.m_useReverseAPI) || @@ -530,6 +548,9 @@ int FileSource::webapiSettingsPutPatch( if (channelSettingsKeys.contains("title")) { settings.m_title = *response.getFileSourceSettings()->getTitle(); } + if (channelSettingsKeys.contains("gainDB")) { + settings.m_gainDB = response.getFileSourceSettings()->getGainDb(); + } if (channelSettingsKeys.contains("useReverseAPI")) { 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()->setFilterChainHash(settings.m_filterChainHash); + response.getFileSourceSettings()->setGainDb(settings.m_gainDB); response.getFileSourceSettings()->setRgbColor(settings.m_rgbColor); if (response.getFileSourceSettings()->getTitle()) { @@ -599,9 +621,36 @@ void FileSource::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& re 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()->setFileSampleSize(m_sampleSize); response.getFileSourceReport()->setSampleRate(m_sampleRate); + response.getFileSourceReport()->setChannelPowerDb(CalcDb::dbPower(getMagSq())); } void FileSource::webapiReverseSendSettings(QList& channelSettingsKeys, const FileSourceSettings& settings, bool force) @@ -622,6 +671,9 @@ void FileSource::webapiReverseSendSettings(QList& channelSettingsKeys, if (channelSettingsKeys.contains("filterChainHash") || force) { swgFileSourceSettings->setFilterChainHash(settings.m_filterChainHash); } + if (channelSettingsKeys.contains("gainDB") || force) { + swgFileSourceSettings->setGainDb(settings.m_gainDB); + } if (channelSettingsKeys.contains("rgbColor") || force) { swgFileSourceSettings->setRgbColor(settings.m_rgbColor); } diff --git a/plugins/channeltx/filesource/filesource.h b/plugins/channeltx/filesource/filesource.h index c373a3efe..46404e330 100644 --- a/plugins/channeltx/filesource/filesource.h +++ b/plugins/channeltx/filesource/filesource.h @@ -31,7 +31,7 @@ #include "dsp/basebandsamplesource.h" #include "channel/channelapi.h" #include "util/message.h" - +#include "util/movingaverage.h" #include "filesourcesettings.h" class ThreadedBasebandSampleSource; @@ -354,11 +354,40 @@ public: void setSampleRate(uint32_t sampleRate) { m_sampleRate = sampleRate; } 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_channelId; private: + struct MagSqLevelsStore + { + MagSqLevelsStore() : + m_magsq(1e-12), + m_magsqPeak(1e-12) + {} + double m_magsq; + double m_magsqPeak; + }; + DeviceAPI* m_deviceAPI; QMutex m_mutex; ThreadedBasebandSampleSource* m_threadedChannelizer; @@ -380,6 +409,14 @@ private: QNetworkAccessManager *m_networkManager; QNetworkRequest m_networkRequest; + double m_linearGain; + double m_magsq; + double m_magsqSum; + double m_magsqPeak; + int m_magsqCount; + MagSqLevelsStore m_magSqLevelStore; + MovingAverageUtil m_movingAverage; + void openFileStream(); void seekFileStream(int seekMillis); void handleEOF(); diff --git a/plugins/channeltx/filesource/filesourcegui.cpp b/plugins/channeltx/filesource/filesourcegui.cpp index afd6a3d08..c7390bbba 100644 --- a/plugins/channeltx/filesource/filesourcegui.cpp +++ b/plugins/channeltx/filesource/filesourcegui.cpp @@ -25,6 +25,8 @@ #include "device/deviceuiset.h" #include "dsp/hbfilterchainconverter.h" #include "gui/basicchannelsettingsdialog.h" +#include "util/db.h" + #include "mainwindow.h" #include "filesource.h" @@ -169,7 +171,10 @@ FileSourceGUI::FileSourceGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Bas m_tickCount(0) { (void) channelTx; + ui->setupUi(this); + ui->channelPowerMeter->setColorTheme(LevelMeterSignalDB::ColorGreenAndBlue); + setAttribute(Qt::WA_DeleteOnClose, true); connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &))); @@ -307,6 +312,8 @@ void FileSourceGUI::displaySettings() setWindowTitle(m_channelMarker.getTitle()); 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); applyInterpolation(); blockApplySettings(false); @@ -395,6 +402,13 @@ void FileSourceGUI::on_position_valueChanged(int value) 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) checked; @@ -464,6 +478,21 @@ void FileSourceGUI::applyPosition() 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 { FileSource::MsgConfigureFileSourceStreamTiming* message = FileSource::MsgConfigureFileSourceStreamTiming::create(); diff --git a/plugins/channeltx/filesource/filesourcegui.h b/plugins/channeltx/filesource/filesourcegui.h index a0b4b8ffe..710f6709d 100644 --- a/plugins/channeltx/filesource/filesourcegui.h +++ b/plugins/channeltx/filesource/filesourcegui.h @@ -106,6 +106,7 @@ private slots: void onMenuDialogCalled(const QPoint& p); void on_interpolationFactor_currentIndexChanged(int index); void on_position_valueChanged(int value); + void on_gain_valueChanged(int value); void on_showFileDialog_clicked(bool checked); void on_playLoop_toggled(bool checked); void on_play_toggled(bool checked); diff --git a/plugins/channeltx/filesource/filesourcegui.ui b/plugins/channeltx/filesource/filesourcegui.ui index ba627999a..e2da8dcd1 100644 --- a/plugins/channeltx/filesource/filesourcegui.ui +++ b/plugins/channeltx/filesource/filesourcegui.ui @@ -6,28 +6,22 @@ 0 0 - 320 - 177 + 382 + 228 - + 0 0 - 320 + 382 140 - - - 320 - 16777215 - - Liberation Sans @@ -40,12 +34,18 @@ - 10 - 10 - 301 - 161 + 0 + 0 + 380 + 221 + + + 380 + 0 + + Settings @@ -253,6 +253,117 @@ + + + + 3 + + + + + 6 + + + + + dB + + + + + + + + 0 + 0 + + + + + 0 + 24 + + + + + Liberation Mono + 8 + + + + + + + + + 40 + 0 + + + + -100.0 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + 10 + + + + + Gain + + + + + + + Gain (dB) + + + -10 + + + 50 + + + 1 + + + Qt::Horizontal + + + + + + + + 45 + 0 + + + + Filter chain hash code + + + -10.0 dB + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + @@ -299,13 +410,13 @@ - 40 + 54 0 - 8 + 9 @@ -330,13 +441,13 @@ - 22 + 24 0 - 8 + 9 @@ -361,7 +472,7 @@ - 8 + 9 @@ -595,6 +706,12 @@ QToolButton
gui/buttonswitch.h
+ + LevelMeterSignalDB + QWidget +
gui/levelmeter.h
+ 1 +
diff --git a/plugins/channeltx/filesource/filesourcesettings.cpp b/plugins/channeltx/filesource/filesourcesettings.cpp index 71281c856..4647a51dc 100644 --- a/plugins/channeltx/filesource/filesourcesettings.cpp +++ b/plugins/channeltx/filesource/filesourcesettings.cpp @@ -34,6 +34,7 @@ void FileSourceSettings::resetToDefaults() m_loop = false; m_log2Interp = 0; m_filterChainHash = 0; + m_gainDB = 0; m_rgbColor = QColor(140, 4, 4).rgb(); m_title = "File source"; m_channelMarker = nullptr; @@ -51,13 +52,14 @@ QByteArray FileSourceSettings::serialize() const s.writeBool(2, m_loop); s.writeU32(3, m_log2Interp); s.writeU32(4, m_filterChainHash); - s.writeU32(5, m_rgbColor); - s.writeString(6, m_title); - s.writeBool(7, m_useReverseAPI); - s.writeString(8, m_reverseAPIAddress); - s.writeU32(9, m_reverseAPIPort); - s.writeU32(10, m_reverseAPIDeviceIndex); - s.writeU32(11, m_reverseAPIChannelIndex); + s.writeS32(5, m_gainDB); + s.writeU32(6, m_rgbColor); + s.writeString(7, m_title); + s.writeBool(8, m_useReverseAPI); + s.writeString(9, m_reverseAPIAddress); + s.writeU32(10, m_reverseAPIPort); + s.writeU32(11, m_reverseAPIDeviceIndex); + s.writeU32(12, m_reverseAPIChannelIndex); return s.final(); } @@ -75,6 +77,7 @@ bool FileSourceSettings::deserialize(const QByteArray& data) if(d.getVersion() == 1) { uint32_t tmp; + int itmp; QString strtmp; d.readString(1, &m_fileName, "test.sdriq"); @@ -82,6 +85,8 @@ bool FileSourceSettings::deserialize(const QByteArray& data) d.readU32(3, &tmp, 0); m_log2Interp = tmp > 6 ? 6 : tmp; 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.readString(6, &m_title, "File source"); d.readBool(7, &m_useReverseAPI, false); diff --git a/plugins/channeltx/filesource/filesourcesettings.h b/plugins/channeltx/filesource/filesourcesettings.h index f009f1f84..9b202ee01 100644 --- a/plugins/channeltx/filesource/filesourcesettings.h +++ b/plugins/channeltx/filesource/filesourcesettings.h @@ -29,6 +29,7 @@ struct FileSourceSettings bool m_loop; uint32_t m_log2Interp; uint32_t m_filterChainHash; + int m_gainDB; quint32 m_rgbColor; QString m_title; bool m_useReverseAPI; diff --git a/sdrbase/resources/webapi/doc/html2/index.html b/sdrbase/resources/webapi/doc/html2/index.html index 8773837ff..0486b2f11 100644 --- a/sdrbase/resources/webapi/doc/html2/index.html +++ b/sdrbase/resources/webapi/doc/html2/index.html @@ -2635,6 +2635,11 @@ margin-bottom: 20px; "sampleRate" : { "type" : "integer", "description" : "Channel sample rate in S/s" + }, + "channelPowerDB" : { + "type" : "number", + "format" : "float", + "description" : "power transmitted in channel (dB)" } }, "description" : "FileSource" @@ -2655,6 +2660,9 @@ margin-bottom: 20px; "filterChainHash" : { "type" : "integer" }, + "gainDB" : { + "type" : "integer" + }, "rgbColor" : { "type" : "integer" }, @@ -25233,7 +25241,7 @@ except ApiException as e:
- Generated 2019-07-08T00:35:02.822+02:00 + Generated 2019-07-10T00:43:21.317+02:00
diff --git a/sdrbase/resources/webapi/doc/swagger/include/FileSource.yaml b/sdrbase/resources/webapi/doc/swagger/include/FileSource.yaml index 084cc94ca..11e2f702e 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/FileSource.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/FileSource.yaml @@ -11,6 +11,8 @@ FileSourceSettings: type: integer filterChainHash: type: integer + gainDB: + type: integer rgbColor: type: integer title: @@ -50,3 +52,7 @@ FileSourceReport: sampleRate: description: Channel sample rate in S/s type: integer + channelPowerDB: + description: power transmitted in channel (dB) + type: number + format: float diff --git a/swagger/sdrangel/api/swagger/include/FileSource.yaml b/swagger/sdrangel/api/swagger/include/FileSource.yaml index 084cc94ca..11e2f702e 100644 --- a/swagger/sdrangel/api/swagger/include/FileSource.yaml +++ b/swagger/sdrangel/api/swagger/include/FileSource.yaml @@ -11,6 +11,8 @@ FileSourceSettings: type: integer filterChainHash: type: integer + gainDB: + type: integer rgbColor: type: integer title: @@ -50,3 +52,7 @@ FileSourceReport: sampleRate: description: Channel sample rate in S/s type: integer + channelPowerDB: + description: power transmitted in channel (dB) + type: number + format: float diff --git a/swagger/sdrangel/code/html2/index.html b/swagger/sdrangel/code/html2/index.html index 8773837ff..0486b2f11 100644 --- a/swagger/sdrangel/code/html2/index.html +++ b/swagger/sdrangel/code/html2/index.html @@ -2635,6 +2635,11 @@ margin-bottom: 20px; "sampleRate" : { "type" : "integer", "description" : "Channel sample rate in S/s" + }, + "channelPowerDB" : { + "type" : "number", + "format" : "float", + "description" : "power transmitted in channel (dB)" } }, "description" : "FileSource" @@ -2655,6 +2660,9 @@ margin-bottom: 20px; "filterChainHash" : { "type" : "integer" }, + "gainDB" : { + "type" : "integer" + }, "rgbColor" : { "type" : "integer" }, @@ -25233,7 +25241,7 @@ except ApiException as e:
- Generated 2019-07-08T00:35:02.822+02:00 + Generated 2019-07-10T00:43:21.317+02:00
diff --git a/swagger/sdrangel/code/qt5/client/SWGFileSourceReport.cpp b/swagger/sdrangel/code/qt5/client/SWGFileSourceReport.cpp index 7dbeb08a8..a70890445 100644 --- a/swagger/sdrangel/code/qt5/client/SWGFileSourceReport.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGFileSourceReport.cpp @@ -42,6 +42,8 @@ SWGFileSourceReport::SWGFileSourceReport() { m_duration_time_isSet = false; sample_rate = 0; m_sample_rate_isSet = false; + channel_power_db = 0.0f; + m_channel_power_db_isSet = false; } SWGFileSourceReport::~SWGFileSourceReport() { @@ -64,6 +66,8 @@ SWGFileSourceReport::init() { m_duration_time_isSet = false; sample_rate = 0; m_sample_rate_isSet = false; + channel_power_db = 0.0f; + m_channel_power_db_isSet = false; } void @@ -83,6 +87,7 @@ SWGFileSourceReport::cleanup() { delete duration_time; } + } SWGFileSourceReport* @@ -110,6 +115,8 @@ SWGFileSourceReport::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&sample_rate, pJson["sampleRate"], "qint32", ""); + ::SWGSDRangel::setValue(&channel_power_db, pJson["channelPowerDB"], "float", ""); + } QString @@ -147,6 +154,9 @@ SWGFileSourceReport::asJsonObject() { if(m_sample_rate_isSet){ obj->insert("sampleRate", QJsonValue(sample_rate)); } + if(m_channel_power_db_isSet){ + obj->insert("channelPowerDB", QJsonValue(channel_power_db)); + } return obj; } @@ -221,6 +231,16 @@ SWGFileSourceReport::setSampleRate(qint32 sample_rate) { 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 SWGFileSourceReport::isSet(){ @@ -233,6 +253,7 @@ SWGFileSourceReport::isSet(){ if(elapsed_time != nullptr && *elapsed_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_channel_power_db_isSet){ isObjectUpdated = true; break;} }while(false); return isObjectUpdated; } diff --git a/swagger/sdrangel/code/qt5/client/SWGFileSourceReport.h b/swagger/sdrangel/code/qt5/client/SWGFileSourceReport.h index 34bb1a45f..05a9311e2 100644 --- a/swagger/sdrangel/code/qt5/client/SWGFileSourceReport.h +++ b/swagger/sdrangel/code/qt5/client/SWGFileSourceReport.h @@ -63,6 +63,9 @@ public: qint32 getSampleRate(); void setSampleRate(qint32 sample_rate); + float getChannelPowerDb(); + void setChannelPowerDb(float channel_power_db); + virtual bool isSet() override; @@ -88,6 +91,9 @@ private: qint32 sample_rate; bool m_sample_rate_isSet; + float channel_power_db; + bool m_channel_power_db_isSet; + }; } diff --git a/swagger/sdrangel/code/qt5/client/SWGFileSourceSettings.cpp b/swagger/sdrangel/code/qt5/client/SWGFileSourceSettings.cpp index b0d0017ab..82037a161 100644 --- a/swagger/sdrangel/code/qt5/client/SWGFileSourceSettings.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGFileSourceSettings.cpp @@ -36,6 +36,8 @@ SWGFileSourceSettings::SWGFileSourceSettings() { m_log2_interp_isSet = false; filter_chain_hash = 0; m_filter_chain_hash_isSet = false; + gain_db = 0; + m_gain_db_isSet = false; rgb_color = 0; m_rgb_color_isSet = false; title = nullptr; @@ -66,6 +68,8 @@ SWGFileSourceSettings::init() { m_log2_interp_isSet = false; filter_chain_hash = 0; m_filter_chain_hash_isSet = false; + gain_db = 0; + m_gain_db_isSet = false; rgb_color = 0; m_rgb_color_isSet = false; title = new QString(""); @@ -91,6 +95,7 @@ SWGFileSourceSettings::cleanup() { + if(title != nullptr) { delete title; } @@ -122,6 +127,8 @@ SWGFileSourceSettings::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&filter_chain_hash, pJson["filterChainHash"], "qint32", ""); + ::SWGSDRangel::setValue(&gain_db, pJson["gainDB"], "qint32", ""); + ::SWGSDRangel::setValue(&rgb_color, pJson["rgbColor"], "qint32", ""); ::SWGSDRangel::setValue(&title, pJson["title"], "QString", "QString"); @@ -164,6 +171,9 @@ SWGFileSourceSettings::asJsonObject() { if(m_filter_chain_hash_isSet){ obj->insert("filterChainHash", QJsonValue(filter_chain_hash)); } + if(m_gain_db_isSet){ + obj->insert("gainDB", QJsonValue(gain_db)); + } if(m_rgb_color_isSet){ obj->insert("rgbColor", QJsonValue(rgb_color)); } @@ -229,6 +239,16 @@ SWGFileSourceSettings::setFilterChainHash(qint32 filter_chain_hash) { 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 SWGFileSourceSettings::getRgbColor() { return rgb_color; @@ -308,6 +328,7 @@ SWGFileSourceSettings::isSet(){ if(m_loop_isSet){ isObjectUpdated = true; break;} if(m_log2_interp_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(title != nullptr && *title != QString("")){ isObjectUpdated = true; break;} if(m_use_reverse_api_isSet){ isObjectUpdated = true; break;} diff --git a/swagger/sdrangel/code/qt5/client/SWGFileSourceSettings.h b/swagger/sdrangel/code/qt5/client/SWGFileSourceSettings.h index abdd3c278..b40596b70 100644 --- a/swagger/sdrangel/code/qt5/client/SWGFileSourceSettings.h +++ b/swagger/sdrangel/code/qt5/client/SWGFileSourceSettings.h @@ -54,6 +54,9 @@ public: qint32 getFilterChainHash(); void setFilterChainHash(qint32 filter_chain_hash); + qint32 getGainDb(); + void setGainDb(qint32 gain_db); + qint32 getRgbColor(); void setRgbColor(qint32 rgb_color); @@ -91,6 +94,9 @@ private: qint32 filter_chain_hash; bool m_filter_chain_hash_isSet; + qint32 gain_db; + bool m_gain_db_isSet; + qint32 rgb_color; bool m_rgb_color_isSet;