1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-22 08:04:49 -05:00

File record default file name fix (3): web API

This commit is contained in:
f4exb 2018-05-09 18:59:39 +02:00
parent 775b2a270d
commit 625f0eb72c
21 changed files with 221 additions and 1 deletions

View File

@ -527,6 +527,9 @@ int AirspyHFInput::webapiSettingsPutPatch(
if (deviceSettingsKeys.contains("bandIndex")) {
settings.m_bandIndex = response.getAirspyHfSettings()->getBandIndex() != 0;
}
if (deviceSettingsKeys.contains("fileRecordName")) {
settings.m_fileRecordName = *response.getAirspyHfSettings()->getFileRecordName();
}
MsgConfigureAirspyHF *msg = MsgConfigureAirspyHF::create(settings, force);
m_inputMessageQueue.push(msg);
@ -550,6 +553,12 @@ void AirspyHFInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& r
response.getAirspyHfSettings()->setTransverterDeltaFrequency(settings.m_transverterDeltaFrequency);
response.getAirspyHfSettings()->setTransverterMode(settings.m_transverterMode ? 1 : 0);
response.getAirspyHfSettings()->setBandIndex(settings.m_bandIndex ? 1 : 0);
if (response.getAirspyHfSettings()->getFileRecordName()) {
*response.getAirspyHfSettings()->getFileRecordName() = settings.m_fileRecordName;
} else {
response.getAirspyHfSettings()->setFileRecordName(new QString(settings.m_fileRecordName));
}
}
int AirspyHFInput::webapiRunGet(

View File

@ -639,6 +639,12 @@ void BladerfInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& re
response.getBladeRfInputSettings()->setXb200Filter((int) settings.m_xb200Filter);
response.getBladeRfInputSettings()->setDcBlock(settings.m_dcBlock ? 1 : 0);
response.getBladeRfInputSettings()->setIqCorrection(settings.m_iqCorrection ? 1 : 0);
if (response.getBladeRfInputSettings()->getFileRecordName()) {
*response.getBladeRfInputSettings()->getFileRecordName() = settings.m_fileRecordName;
} else {
response.getBladeRfInputSettings()->setFileRecordName(new QString(settings.m_fileRecordName));
}
}
int BladerfInput::webapiSettingsPutPatch(
@ -688,6 +694,9 @@ int BladerfInput::webapiSettingsPutPatch(
if (deviceSettingsKeys.contains("iqCorrection")) {
settings.m_iqCorrection = response.getBladeRfInputSettings()->getIqCorrection() != 0;
}
if (deviceSettingsKeys.contains("fileRecordName")) {
settings.m_fileRecordName = *response.getBladeRfInputSettings()->getFileRecordName();
}
MsgConfigureBladerf *msg = MsgConfigureBladerf::create(settings, force);
m_inputMessageQueue.push(msg);

View File

@ -602,6 +602,9 @@ int HackRFInput::webapiSettingsPutPatch(
if (deviceSettingsKeys.contains("linkTxFrequency")) {
settings.m_linkTxFrequency = response.getHackRfInputSettings()->getLinkTxFrequency() != 0;
}
if (deviceSettingsKeys.contains("fileRecordName")) {
settings.m_fileRecordName = *response.getHackRfInputSettings()->getFileRecordName();
}
MsgConfigureHackRF *msg = MsgConfigureHackRF::create(settings, force);
m_inputMessageQueue.push(msg);
@ -631,6 +634,12 @@ void HackRFInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& res
response.getHackRfInputSettings()->setDcBlock(settings.m_dcBlock ? 1 : 0);
response.getHackRfInputSettings()->setIqCorrection(settings.m_iqCorrection ? 1 : 0);
response.getHackRfInputSettings()->setLinkTxFrequency(settings.m_linkTxFrequency ? 1 : 0);
if (response.getHackRfInputSettings()->getFileRecordName()) {
*response.getHackRfInputSettings()->getFileRecordName() = settings.m_fileRecordName;
} else {
response.getHackRfInputSettings()->setFileRecordName(new QString(settings.m_fileRecordName));
}
}
int HackRFInput::webapiRunGet(

View File

@ -1337,6 +1337,9 @@ int LimeSDRInput::webapiSettingsPutPatch(
if (deviceSettingsKeys.contains("transverterMode")) {
settings.m_transverterMode = response.getLimeSdrInputSettings()->getTransverterMode() != 0;
}
if (deviceSettingsKeys.contains("fileRecordName")) {
settings.m_fileRecordName = *response.getLimeSdrInputSettings()->getFileRecordName();
}
MsgConfigureLimeSDR *msg = MsgConfigureLimeSDR::create(settings, force);
m_inputMessageQueue.push(msg);
@ -1374,6 +1377,12 @@ void LimeSDRInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& re
response.getLimeSdrInputSettings()->setTiaGain(settings.m_tiaGain);
response.getLimeSdrInputSettings()->setTransverterDeltaFrequency(settings.m_transverterDeltaFrequency);
response.getLimeSdrInputSettings()->setTransverterMode(settings.m_transverterMode ? 1 : 0);
if (response.getLimeSdrInputSettings()->getFileRecordName()) {
*response.getLimeSdrInputSettings()->getFileRecordName() = settings.m_fileRecordName;
} else {
response.getLimeSdrInputSettings()->setFileRecordName(new QString(settings.m_fileRecordName));
}
}
int LimeSDRInput::webapiRunGet(

View File

@ -608,6 +608,9 @@ int RTLSDRInput::webapiSettingsPutPatch(
if (deviceSettingsKeys.contains("rfBandwidth")) {
settings.m_rfBandwidth = response.getRtlSdrSettings()->getRfBandwidth() != 0;
}
if (deviceSettingsKeys.contains("fileRecordName")) {
settings.m_fileRecordName = *response.getRtlSdrSettings()->getFileRecordName();
}
MsgConfigureRTLSDR *msg = MsgConfigureRTLSDR::create(settings, force);
m_inputMessageQueue.push(msg);
@ -638,6 +641,12 @@ void RTLSDRInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& res
response.getRtlSdrSettings()->setTransverterDeltaFrequency(settings.m_transverterDeltaFrequency);
response.getRtlSdrSettings()->setTransverterMode(settings.m_transverterMode ? 1 : 0);
response.getRtlSdrSettings()->setRfBandwidth(settings.m_rfBandwidth);
if (response.getRtlSdrSettings()->getFileRecordName()) {
*response.getRtlSdrSettings()->getFileRecordName() = settings.m_fileRecordName;
} else {
response.getRtlSdrSettings()->setFileRecordName(new QString(settings.m_fileRecordName));
}
}
int RTLSDRInput::webapiRunGet(

View File

@ -17,4 +17,6 @@ AirspyHFSettings:
format: int64
bandIndex:
type: integer
fileRecordName:
type: string

View File

@ -28,6 +28,8 @@ BladeRFInputSettings:
type: integer
iqCorrection:
type: integer
fileRecordName:
type: string
BladeRFOutputSettings:
description: BladeRF

View File

@ -29,6 +29,8 @@ HackRFInputSettings:
type: integer
linkTxFrequency:
type: integer
fileRecordName:
type: string
HackRFOutputSettings:
description: HackRF

View File

@ -45,6 +45,8 @@ LimeSdrInputSettings:
transverterDeltaFrequency:
type: integer
format: int64
fileRecordName:
type: string
LimeSdrOutputSettings:
description: LimeSDR

View File

@ -31,4 +31,6 @@ RtlSdrSettings:
format: int64
rfBandwidth:
type: integer
fileRecordName:
type: string

View File

@ -936,6 +936,9 @@ margin-bottom: 20px;
},
"bandIndex" : {
"type" : "integer"
},
"fileRecordName" : {
"type" : "string"
}
},
"description" : "AirspyHF"
@ -1084,6 +1087,9 @@ margin-bottom: 20px;
},
"iqCorrection" : {
"type" : "integer"
},
"fileRecordName" : {
"type" : "string"
}
},
"description" : "BladeRF"
@ -1512,6 +1518,9 @@ margin-bottom: 20px;
},
"linkTxFrequency" : {
"type" : "integer"
},
"fileRecordName" : {
"type" : "string"
}
},
"description" : "HackRF"
@ -1688,6 +1697,9 @@ margin-bottom: 20px;
"transverterDeltaFrequency" : {
"type" : "integer",
"format" : "int64"
},
"fileRecordName" : {
"type" : "string"
}
},
"description" : "LimeSDR"
@ -2101,6 +2113,9 @@ margin-bottom: 20px;
},
"rfBandwidth" : {
"type" : "integer"
},
"fileRecordName" : {
"type" : "string"
}
},
"description" : "RTLSDR"
@ -20643,7 +20658,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2018-04-17T00:43:20.797+02:00
Generated 2018-05-09T18:07:27.088+02:00
</div>
</div>
</div>

View File

@ -42,6 +42,8 @@ SWGAirspyHFSettings::SWGAirspyHFSettings() {
m_transverter_delta_frequency_isSet = false;
band_index = 0;
m_band_index_isSet = false;
file_record_name = nullptr;
m_file_record_name_isSet = false;
}
SWGAirspyHFSettings::~SWGAirspyHFSettings() {
@ -64,6 +66,8 @@ SWGAirspyHFSettings::init() {
m_transverter_delta_frequency_isSet = false;
band_index = 0;
m_band_index_isSet = false;
file_record_name = new QString("");
m_file_record_name_isSet = false;
}
void
@ -75,6 +79,9 @@ SWGAirspyHFSettings::cleanup() {
if(file_record_name != nullptr) {
delete file_record_name;
}
}
SWGAirspyHFSettings*
@ -102,6 +109,8 @@ SWGAirspyHFSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&band_index, pJson["bandIndex"], "qint32", "");
::SWGSDRangel::setValue(&file_record_name, pJson["fileRecordName"], "QString", "QString");
}
QString
@ -139,6 +148,9 @@ SWGAirspyHFSettings::asJsonObject() {
if(m_band_index_isSet){
obj->insert("bandIndex", QJsonValue(band_index));
}
if(file_record_name != nullptr && *file_record_name != QString("")){
toJsonValue(QString("fileRecordName"), file_record_name, obj, QString("QString"));
}
return obj;
}
@ -213,6 +225,16 @@ SWGAirspyHFSettings::setBandIndex(qint32 band_index) {
this->m_band_index_isSet = true;
}
QString*
SWGAirspyHFSettings::getFileRecordName() {
return file_record_name;
}
void
SWGAirspyHFSettings::setFileRecordName(QString* file_record_name) {
this->file_record_name = file_record_name;
this->m_file_record_name_isSet = true;
}
bool
SWGAirspyHFSettings::isSet(){
@ -225,6 +247,7 @@ SWGAirspyHFSettings::isSet(){
if(m_transverter_mode_isSet){ isObjectUpdated = true; break;}
if(m_transverter_delta_frequency_isSet){ isObjectUpdated = true; break;}
if(m_band_index_isSet){ isObjectUpdated = true; break;}
if(file_record_name != nullptr && *file_record_name != QString("")){ isObjectUpdated = true; break;}
}while(false);
return isObjectUpdated;
}

View File

@ -22,6 +22,7 @@
#include <QJsonObject>
#include <QString>
#include "SWGObject.h"
#include "export.h"
@ -62,6 +63,9 @@ public:
qint32 getBandIndex();
void setBandIndex(qint32 band_index);
QString* getFileRecordName();
void setFileRecordName(QString* file_record_name);
virtual bool isSet() override;
@ -87,6 +91,9 @@ private:
qint32 band_index;
bool m_band_index_isSet;
QString* file_record_name;
bool m_file_record_name_isSet;
};
}

View File

@ -54,6 +54,8 @@ SWGBladeRFInputSettings::SWGBladeRFInputSettings() {
m_dc_block_isSet = false;
iq_correction = 0;
m_iq_correction_isSet = false;
file_record_name = nullptr;
m_file_record_name_isSet = false;
}
SWGBladeRFInputSettings::~SWGBladeRFInputSettings() {
@ -88,6 +90,8 @@ SWGBladeRFInputSettings::init() {
m_dc_block_isSet = false;
iq_correction = 0;
m_iq_correction_isSet = false;
file_record_name = new QString("");
m_file_record_name_isSet = false;
}
void
@ -105,6 +109,9 @@ SWGBladeRFInputSettings::cleanup() {
if(file_record_name != nullptr) {
delete file_record_name;
}
}
SWGBladeRFInputSettings*
@ -144,6 +151,8 @@ SWGBladeRFInputSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&iq_correction, pJson["iqCorrection"], "qint32", "");
::SWGSDRangel::setValue(&file_record_name, pJson["fileRecordName"], "QString", "QString");
}
QString
@ -199,6 +208,9 @@ SWGBladeRFInputSettings::asJsonObject() {
if(m_iq_correction_isSet){
obj->insert("iqCorrection", QJsonValue(iq_correction));
}
if(file_record_name != nullptr && *file_record_name != QString("")){
toJsonValue(QString("fileRecordName"), file_record_name, obj, QString("QString"));
}
return obj;
}
@ -333,6 +345,16 @@ SWGBladeRFInputSettings::setIqCorrection(qint32 iq_correction) {
this->m_iq_correction_isSet = true;
}
QString*
SWGBladeRFInputSettings::getFileRecordName() {
return file_record_name;
}
void
SWGBladeRFInputSettings::setFileRecordName(QString* file_record_name) {
this->file_record_name = file_record_name;
this->m_file_record_name_isSet = true;
}
bool
SWGBladeRFInputSettings::isSet(){
@ -351,6 +373,7 @@ SWGBladeRFInputSettings::isSet(){
if(m_xb200_filter_isSet){ isObjectUpdated = true; break;}
if(m_dc_block_isSet){ isObjectUpdated = true; break;}
if(m_iq_correction_isSet){ isObjectUpdated = true; break;}
if(file_record_name != nullptr && *file_record_name != QString("")){ isObjectUpdated = true; break;}
}while(false);
return isObjectUpdated;
}

View File

@ -22,6 +22,7 @@
#include <QJsonObject>
#include <QString>
#include "SWGObject.h"
#include "export.h"
@ -80,6 +81,9 @@ public:
qint32 getIqCorrection();
void setIqCorrection(qint32 iq_correction);
QString* getFileRecordName();
void setFileRecordName(QString* file_record_name);
virtual bool isSet() override;
@ -123,6 +127,9 @@ private:
qint32 iq_correction;
bool m_iq_correction_isSet;
QString* file_record_name;
bool m_file_record_name_isSet;
};
}

View File

@ -54,6 +54,8 @@ SWGHackRFInputSettings::SWGHackRFInputSettings() {
m_iq_correction_isSet = false;
link_tx_frequency = 0;
m_link_tx_frequency_isSet = false;
file_record_name = nullptr;
m_file_record_name_isSet = false;
}
SWGHackRFInputSettings::~SWGHackRFInputSettings() {
@ -88,6 +90,8 @@ SWGHackRFInputSettings::init() {
m_iq_correction_isSet = false;
link_tx_frequency = 0;
m_link_tx_frequency_isSet = false;
file_record_name = new QString("");
m_file_record_name_isSet = false;
}
void
@ -105,6 +109,9 @@ SWGHackRFInputSettings::cleanup() {
if(file_record_name != nullptr) {
delete file_record_name;
}
}
SWGHackRFInputSettings*
@ -144,6 +151,8 @@ SWGHackRFInputSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&link_tx_frequency, pJson["linkTxFrequency"], "qint32", "");
::SWGSDRangel::setValue(&file_record_name, pJson["fileRecordName"], "QString", "QString");
}
QString
@ -199,6 +208,9 @@ SWGHackRFInputSettings::asJsonObject() {
if(m_link_tx_frequency_isSet){
obj->insert("linkTxFrequency", QJsonValue(link_tx_frequency));
}
if(file_record_name != nullptr && *file_record_name != QString("")){
toJsonValue(QString("fileRecordName"), file_record_name, obj, QString("QString"));
}
return obj;
}
@ -333,6 +345,16 @@ SWGHackRFInputSettings::setLinkTxFrequency(qint32 link_tx_frequency) {
this->m_link_tx_frequency_isSet = true;
}
QString*
SWGHackRFInputSettings::getFileRecordName() {
return file_record_name;
}
void
SWGHackRFInputSettings::setFileRecordName(QString* file_record_name) {
this->file_record_name = file_record_name;
this->m_file_record_name_isSet = true;
}
bool
SWGHackRFInputSettings::isSet(){
@ -351,6 +373,7 @@ SWGHackRFInputSettings::isSet(){
if(m_dc_block_isSet){ isObjectUpdated = true; break;}
if(m_iq_correction_isSet){ isObjectUpdated = true; break;}
if(m_link_tx_frequency_isSet){ isObjectUpdated = true; break;}
if(file_record_name != nullptr && *file_record_name != QString("")){ isObjectUpdated = true; break;}
}while(false);
return isObjectUpdated;
}

View File

@ -22,6 +22,7 @@
#include <QJsonObject>
#include <QString>
#include "SWGObject.h"
#include "export.h"
@ -80,6 +81,9 @@ public:
qint32 getLinkTxFrequency();
void setLinkTxFrequency(qint32 link_tx_frequency);
QString* getFileRecordName();
void setFileRecordName(QString* file_record_name);
virtual bool isSet() override;
@ -123,6 +127,9 @@ private:
qint32 link_tx_frequency;
bool m_link_tx_frequency_isSet;
QString* file_record_name;
bool m_file_record_name_isSet;
};
}

View File

@ -70,6 +70,8 @@ SWGLimeSdrInputSettings::SWGLimeSdrInputSettings() {
m_transverter_mode_isSet = false;
transverter_delta_frequency = 0L;
m_transverter_delta_frequency_isSet = false;
file_record_name = nullptr;
m_file_record_name_isSet = false;
}
SWGLimeSdrInputSettings::~SWGLimeSdrInputSettings() {
@ -120,6 +122,8 @@ SWGLimeSdrInputSettings::init() {
m_transverter_mode_isSet = false;
transverter_delta_frequency = 0L;
m_transverter_delta_frequency_isSet = false;
file_record_name = new QString("");
m_file_record_name_isSet = false;
}
void
@ -145,6 +149,9 @@ SWGLimeSdrInputSettings::cleanup() {
if(file_record_name != nullptr) {
delete file_record_name;
}
}
SWGLimeSdrInputSettings*
@ -200,6 +207,8 @@ SWGLimeSdrInputSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&transverter_delta_frequency, pJson["transverterDeltaFrequency"], "qint64", "");
::SWGSDRangel::setValue(&file_record_name, pJson["fileRecordName"], "QString", "QString");
}
QString
@ -279,6 +288,9 @@ SWGLimeSdrInputSettings::asJsonObject() {
if(m_transverter_delta_frequency_isSet){
obj->insert("transverterDeltaFrequency", QJsonValue(transverter_delta_frequency));
}
if(file_record_name != nullptr && *file_record_name != QString("")){
toJsonValue(QString("fileRecordName"), file_record_name, obj, QString("QString"));
}
return obj;
}
@ -493,6 +505,16 @@ SWGLimeSdrInputSettings::setTransverterDeltaFrequency(qint64 transverter_delta_f
this->m_transverter_delta_frequency_isSet = true;
}
QString*
SWGLimeSdrInputSettings::getFileRecordName() {
return file_record_name;
}
void
SWGLimeSdrInputSettings::setFileRecordName(QString* file_record_name) {
this->file_record_name = file_record_name;
this->m_file_record_name_isSet = true;
}
bool
SWGLimeSdrInputSettings::isSet(){
@ -519,6 +541,7 @@ SWGLimeSdrInputSettings::isSet(){
if(m_ext_clock_freq_isSet){ isObjectUpdated = true; break;}
if(m_transverter_mode_isSet){ isObjectUpdated = true; break;}
if(m_transverter_delta_frequency_isSet){ isObjectUpdated = true; break;}
if(file_record_name != nullptr && *file_record_name != QString("")){ isObjectUpdated = true; break;}
}while(false);
return isObjectUpdated;
}

View File

@ -22,6 +22,7 @@
#include <QJsonObject>
#include <QString>
#include "SWGObject.h"
#include "export.h"
@ -104,6 +105,9 @@ public:
qint64 getTransverterDeltaFrequency();
void setTransverterDeltaFrequency(qint64 transverter_delta_frequency);
QString* getFileRecordName();
void setFileRecordName(QString* file_record_name);
virtual bool isSet() override;
@ -171,6 +175,9 @@ private:
qint64 transverter_delta_frequency;
bool m_transverter_delta_frequency_isSet;
QString* file_record_name;
bool m_file_record_name_isSet;
};
}

View File

@ -56,6 +56,8 @@ SWGRtlSdrSettings::SWGRtlSdrSettings() {
m_transverter_delta_frequency_isSet = false;
rf_bandwidth = 0;
m_rf_bandwidth_isSet = false;
file_record_name = nullptr;
m_file_record_name_isSet = false;
}
SWGRtlSdrSettings::~SWGRtlSdrSettings() {
@ -92,6 +94,8 @@ SWGRtlSdrSettings::init() {
m_transverter_delta_frequency_isSet = false;
rf_bandwidth = 0;
m_rf_bandwidth_isSet = false;
file_record_name = new QString("");
m_file_record_name_isSet = false;
}
void
@ -110,6 +114,9 @@ SWGRtlSdrSettings::cleanup() {
if(file_record_name != nullptr) {
delete file_record_name;
}
}
SWGRtlSdrSettings*
@ -151,6 +158,8 @@ SWGRtlSdrSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&rf_bandwidth, pJson["rfBandwidth"], "qint32", "");
::SWGSDRangel::setValue(&file_record_name, pJson["fileRecordName"], "QString", "QString");
}
QString
@ -209,6 +218,9 @@ SWGRtlSdrSettings::asJsonObject() {
if(m_rf_bandwidth_isSet){
obj->insert("rfBandwidth", QJsonValue(rf_bandwidth));
}
if(file_record_name != nullptr && *file_record_name != QString("")){
toJsonValue(QString("fileRecordName"), file_record_name, obj, QString("QString"));
}
return obj;
}
@ -353,6 +365,16 @@ SWGRtlSdrSettings::setRfBandwidth(qint32 rf_bandwidth) {
this->m_rf_bandwidth_isSet = true;
}
QString*
SWGRtlSdrSettings::getFileRecordName() {
return file_record_name;
}
void
SWGRtlSdrSettings::setFileRecordName(QString* file_record_name) {
this->file_record_name = file_record_name;
this->m_file_record_name_isSet = true;
}
bool
SWGRtlSdrSettings::isSet(){
@ -372,6 +394,7 @@ SWGRtlSdrSettings::isSet(){
if(m_transverter_mode_isSet){ isObjectUpdated = true; break;}
if(m_transverter_delta_frequency_isSet){ isObjectUpdated = true; break;}
if(m_rf_bandwidth_isSet){ isObjectUpdated = true; break;}
if(file_record_name != nullptr && *file_record_name != QString("")){ isObjectUpdated = true; break;}
}while(false);
return isObjectUpdated;
}

View File

@ -22,6 +22,7 @@
#include <QJsonObject>
#include <QString>
#include "SWGObject.h"
#include "export.h"
@ -83,6 +84,9 @@ public:
qint32 getRfBandwidth();
void setRfBandwidth(qint32 rf_bandwidth);
QString* getFileRecordName();
void setFileRecordName(QString* file_record_name);
virtual bool isSet() override;
@ -129,6 +133,9 @@ private:
qint32 rf_bandwidth;
bool m_rf_bandwidth_isSet;
QString* file_record_name;
bool m_file_record_name_isSet;
};
}