mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-26 01:39:05 -05:00
REST API: config: GET (2) presets channels and devices loop
This commit is contained in:
parent
233a84c2b3
commit
b95fa98e5a
@ -1765,10 +1765,6 @@ margin-bottom: 20px;
|
|||||||
"type" : "string",
|
"type" : "string",
|
||||||
"description" : "Channel type ID in URI form"
|
"description" : "Channel type ID in URI form"
|
||||||
},
|
},
|
||||||
"channelId" : {
|
|
||||||
"type" : "string",
|
|
||||||
"description" : "Channel type ID in short form from object name"
|
|
||||||
},
|
|
||||||
"config" : {
|
"config" : {
|
||||||
"$ref" : "#/definitions/ChannelSettings"
|
"$ref" : "#/definitions/ChannelSettings"
|
||||||
}
|
}
|
||||||
@ -4340,11 +4336,13 @@ margin-bottom: 20px;
|
|||||||
};
|
};
|
||||||
defs.Preferences = {
|
defs.Preferences = {
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"sourceType" : {
|
|
||||||
"type" : "string"
|
|
||||||
},
|
|
||||||
"sourceDevice" : {
|
"sourceDevice" : {
|
||||||
"type" : "string"
|
"type" : "string",
|
||||||
|
"description" : "Identification of the source used in R0 tab (GUI flavor) at startup"
|
||||||
|
},
|
||||||
|
"sourceIndex" : {
|
||||||
|
"type" : "integer",
|
||||||
|
"description" : "Index of the source used in R0 tab (GUI flavor) at startup"
|
||||||
},
|
},
|
||||||
"audioType" : {
|
"audioType" : {
|
||||||
"type" : "string"
|
"type" : "string"
|
||||||
@ -4352,9 +4350,6 @@ margin-bottom: 20px;
|
|||||||
"audioDevice" : {
|
"audioDevice" : {
|
||||||
"type" : "string"
|
"type" : "string"
|
||||||
},
|
},
|
||||||
"sourceIndex" : {
|
|
||||||
"type" : "integer"
|
|
||||||
},
|
|
||||||
"latitude" : {
|
"latitude" : {
|
||||||
"type" : "number",
|
"type" : "number",
|
||||||
"format" : "float"
|
"format" : "float"
|
||||||
@ -4397,7 +4392,7 @@ margin-bottom: 20px;
|
|||||||
"type" : "integer",
|
"type" : "integer",
|
||||||
"format" : "int64"
|
"format" : "int64"
|
||||||
},
|
},
|
||||||
"m_spectrumConfig" : {
|
"spectrumConfig" : {
|
||||||
"$ref" : "#/definitions/GLSpectrum"
|
"$ref" : "#/definitions/GLSpectrum"
|
||||||
},
|
},
|
||||||
"dcOffsetCorrection" : {
|
"dcOffsetCorrection" : {
|
||||||
@ -26960,7 +26955,7 @@ except ApiException as e:
|
|||||||
</div>
|
</div>
|
||||||
<div id="generator">
|
<div id="generator">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
Generated 2019-07-31T23:30:54.359+02:00
|
Generated 2019-08-01T08:47:20.086+02:00
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
Preferences:
|
Preferences:
|
||||||
description: Repreents a Prefernce object
|
description: Repreents a Prefernce object
|
||||||
properties:
|
properties:
|
||||||
sourceType:
|
|
||||||
type: string
|
|
||||||
sourceDevice:
|
sourceDevice:
|
||||||
|
description: Identification of the source used in R0 tab (GUI flavor) at startup
|
||||||
type: string
|
type: string
|
||||||
|
sourceIndex:
|
||||||
|
description: Index of the source used in R0 tab (GUI flavor) at startup
|
||||||
|
type: integer
|
||||||
audioType:
|
audioType:
|
||||||
type: string
|
type: string
|
||||||
audioDevice:
|
audioDevice:
|
||||||
type: string
|
type: string
|
||||||
sourceIndex:
|
|
||||||
type: integer
|
|
||||||
latitude:
|
latitude:
|
||||||
type: number
|
type: number
|
||||||
format: float
|
format: float
|
||||||
|
@ -16,9 +16,6 @@ ChannelConfig:
|
|||||||
channelIdURI:
|
channelIdURI:
|
||||||
description: Channel type ID in URI form
|
description: Channel type ID in URI form
|
||||||
type: string
|
type: string
|
||||||
channelId:
|
|
||||||
description: Channel type ID in short form from object name
|
|
||||||
type: string
|
|
||||||
config:
|
config:
|
||||||
$ref: "/doc/swagger/include/ChannelSettings.yaml#/ChannelSettings"
|
$ref: "/doc/swagger/include/ChannelSettings.yaml#/ChannelSettings"
|
||||||
|
|
||||||
@ -35,7 +32,7 @@ Preset:
|
|||||||
centerFrequency:
|
centerFrequency:
|
||||||
type: integer
|
type: integer
|
||||||
format: int64
|
format: int64
|
||||||
m_spectrumConfig:
|
spectrumConfig:
|
||||||
$ref: "/doc/swagger/include/GLSpectrum.yaml#/GLSpectrum"
|
$ref: "/doc/swagger/include/GLSpectrum.yaml#/GLSpectrum"
|
||||||
dcOffsetCorrection:
|
dcOffsetCorrection:
|
||||||
description: boolean
|
description: boolean
|
||||||
|
@ -29,7 +29,6 @@ class SDRBASE_API Preset {
|
|||||||
public:
|
public:
|
||||||
struct ChannelConfig {
|
struct ChannelConfig {
|
||||||
QString m_channelIdURI; //!< Channel type ID in URI form
|
QString m_channelIdURI; //!< Channel type ID in URI form
|
||||||
QString m_channelId; //!< Channel type ID in short form from object name TODO: use in the future
|
|
||||||
QByteArray m_config;
|
QByteArray m_config;
|
||||||
|
|
||||||
ChannelConfig(const QString& channelIdURI, const QByteArray& config) :
|
ChannelConfig(const QString& channelIdURI, const QByteArray& config) :
|
||||||
@ -86,10 +85,12 @@ public:
|
|||||||
int getChannelCount() const { return m_channelConfigs.count(); }
|
int getChannelCount() const { return m_channelConfigs.count(); }
|
||||||
const ChannelConfig& getChannelConfig(int index) const { return m_channelConfigs.at(index); }
|
const ChannelConfig& getChannelConfig(int index) const { return m_channelConfigs.at(index); }
|
||||||
|
|
||||||
void setDeviceConfig(const QString& deviceId, const QString& deviceSerial, int deviceSequence, const QByteArray& config)
|
void clearDevices() { m_deviceConfigs.clear(); }
|
||||||
{
|
void setDeviceConfig(const QString& deviceId, const QString& deviceSerial, int deviceSequence, const QByteArray& config) {
|
||||||
addOrUpdateDeviceConfig(deviceId, deviceSerial, deviceSequence, config);
|
addOrUpdateDeviceConfig(deviceId, deviceSerial, deviceSequence, config);
|
||||||
}
|
}
|
||||||
|
int getDeviceCount() const { return m_deviceConfigs.count(); }
|
||||||
|
const DeviceConfig& getDeviceConfig(int index) const { return m_deviceConfigs.at(index); }
|
||||||
|
|
||||||
void addOrUpdateDeviceConfig(const QString& deviceId,
|
void addOrUpdateDeviceConfig(const QString& deviceId,
|
||||||
const QString& deviceSerial,
|
const QString& deviceSerial,
|
||||||
|
@ -46,9 +46,27 @@ void WebAPIAdapterBase::webapiFormatPreset(
|
|||||||
apiPreset->setGroup(new QString(preset.m_group));
|
apiPreset->setGroup(new QString(preset.m_group));
|
||||||
apiPreset->setDescription(new QString(preset.m_description));
|
apiPreset->setDescription(new QString(preset.m_description));
|
||||||
apiPreset->setCenterFrequency(preset.m_centerFrequency);
|
apiPreset->setCenterFrequency(preset.m_centerFrequency);
|
||||||
apiPreset->getMSpectrumConfig()->init(); // TODO when spectrum config is extracted to sdrbase
|
apiPreset->getSpectrumConfig()->init(); // TODO when spectrum config is extracted to sdrbase
|
||||||
apiPreset->setDcOffsetCorrection(preset.m_dcOffsetCorrection ? 1 : 0);
|
apiPreset->setDcOffsetCorrection(preset.m_dcOffsetCorrection ? 1 : 0);
|
||||||
apiPreset->setIqImbalanceCorrection(preset.m_iqImbalanceCorrection ? 1 : 0);
|
apiPreset->setIqImbalanceCorrection(preset.m_iqImbalanceCorrection ? 1 : 0);
|
||||||
// TODO: channel configs
|
|
||||||
// TODO: device configs
|
int nbChannels = preset.getChannelCount();
|
||||||
|
for (int i = 0; i < nbChannels; i++)
|
||||||
|
{
|
||||||
|
const Preset::ChannelConfig& channelConfig = preset.getChannelConfig(i);
|
||||||
|
QList<SWGSDRangel::SWGChannelConfig *> *swgChannelConfigs = apiPreset->getChannelConfigs();
|
||||||
|
swgChannelConfigs->append(new SWGSDRangel::SWGChannelConfig);
|
||||||
|
swgChannelConfigs->back()->setChannelIdUri(new QString(channelConfig.m_channelIdURI));
|
||||||
|
}
|
||||||
|
|
||||||
|
int nbDevices = preset.getDeviceCount();
|
||||||
|
for (int i = 0; i < nbDevices; i++)
|
||||||
|
{
|
||||||
|
const Preset::DeviceConfig& deviceConfig = preset.getDeviceConfig(i);
|
||||||
|
QList<SWGSDRangel::SWGDeviceConfig *> *swgdeviceConfigs = apiPreset->getDeviceConfigs();
|
||||||
|
swgdeviceConfigs->append(new SWGSDRangel::SWGDeviceConfig);
|
||||||
|
swgdeviceConfigs->back()->setDeviceId(new QString(deviceConfig.m_deviceId));
|
||||||
|
swgdeviceConfigs->back()->setDeviceSerial(new QString(deviceConfig.m_deviceSerial));
|
||||||
|
swgdeviceConfigs->back()->setDeviceSequence(deviceConfig.m_deviceSequence);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,9 +16,6 @@ ChannelConfig:
|
|||||||
channelIdURI:
|
channelIdURI:
|
||||||
description: Channel type ID in URI form
|
description: Channel type ID in URI form
|
||||||
type: string
|
type: string
|
||||||
channelId:
|
|
||||||
description: Channel type ID in short form from object name
|
|
||||||
type: string
|
|
||||||
config:
|
config:
|
||||||
$ref: "http://localhost:8081/api/swagger/include/ChannelSettings.yaml#/ChannelSettings"
|
$ref: "http://localhost:8081/api/swagger/include/ChannelSettings.yaml#/ChannelSettings"
|
||||||
|
|
||||||
|
@ -1765,10 +1765,6 @@ margin-bottom: 20px;
|
|||||||
"type" : "string",
|
"type" : "string",
|
||||||
"description" : "Channel type ID in URI form"
|
"description" : "Channel type ID in URI form"
|
||||||
},
|
},
|
||||||
"channelId" : {
|
|
||||||
"type" : "string",
|
|
||||||
"description" : "Channel type ID in short form from object name"
|
|
||||||
},
|
|
||||||
"config" : {
|
"config" : {
|
||||||
"$ref" : "#/definitions/ChannelSettings"
|
"$ref" : "#/definitions/ChannelSettings"
|
||||||
}
|
}
|
||||||
@ -4340,11 +4336,13 @@ margin-bottom: 20px;
|
|||||||
};
|
};
|
||||||
defs.Preferences = {
|
defs.Preferences = {
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"sourceType" : {
|
|
||||||
"type" : "string"
|
|
||||||
},
|
|
||||||
"sourceDevice" : {
|
"sourceDevice" : {
|
||||||
"type" : "string"
|
"type" : "string",
|
||||||
|
"description" : "Identification of the source used in R0 tab (GUI flavor) at startup"
|
||||||
|
},
|
||||||
|
"sourceIndex" : {
|
||||||
|
"type" : "integer",
|
||||||
|
"description" : "Index of the source used in R0 tab (GUI flavor) at startup"
|
||||||
},
|
},
|
||||||
"audioType" : {
|
"audioType" : {
|
||||||
"type" : "string"
|
"type" : "string"
|
||||||
@ -4352,9 +4350,6 @@ margin-bottom: 20px;
|
|||||||
"audioDevice" : {
|
"audioDevice" : {
|
||||||
"type" : "string"
|
"type" : "string"
|
||||||
},
|
},
|
||||||
"sourceIndex" : {
|
|
||||||
"type" : "integer"
|
|
||||||
},
|
|
||||||
"latitude" : {
|
"latitude" : {
|
||||||
"type" : "number",
|
"type" : "number",
|
||||||
"format" : "float"
|
"format" : "float"
|
||||||
@ -4397,7 +4392,7 @@ margin-bottom: 20px;
|
|||||||
"type" : "integer",
|
"type" : "integer",
|
||||||
"format" : "int64"
|
"format" : "int64"
|
||||||
},
|
},
|
||||||
"m_spectrumConfig" : {
|
"spectrumConfig" : {
|
||||||
"$ref" : "#/definitions/GLSpectrum"
|
"$ref" : "#/definitions/GLSpectrum"
|
||||||
},
|
},
|
||||||
"dcOffsetCorrection" : {
|
"dcOffsetCorrection" : {
|
||||||
@ -26960,7 +26955,7 @@ except ApiException as e:
|
|||||||
</div>
|
</div>
|
||||||
<div id="generator">
|
<div id="generator">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
Generated 2019-07-31T23:30:54.359+02:00
|
Generated 2019-08-01T08:47:20.086+02:00
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -30,8 +30,6 @@ SWGChannelConfig::SWGChannelConfig(QString* json) {
|
|||||||
SWGChannelConfig::SWGChannelConfig() {
|
SWGChannelConfig::SWGChannelConfig() {
|
||||||
channel_id_uri = nullptr;
|
channel_id_uri = nullptr;
|
||||||
m_channel_id_uri_isSet = false;
|
m_channel_id_uri_isSet = false;
|
||||||
channel_id = nullptr;
|
|
||||||
m_channel_id_isSet = false;
|
|
||||||
config = nullptr;
|
config = nullptr;
|
||||||
m_config_isSet = false;
|
m_config_isSet = false;
|
||||||
}
|
}
|
||||||
@ -44,8 +42,6 @@ void
|
|||||||
SWGChannelConfig::init() {
|
SWGChannelConfig::init() {
|
||||||
channel_id_uri = new QString("");
|
channel_id_uri = new QString("");
|
||||||
m_channel_id_uri_isSet = false;
|
m_channel_id_uri_isSet = false;
|
||||||
channel_id = new QString("");
|
|
||||||
m_channel_id_isSet = false;
|
|
||||||
config = new SWGChannelSettings();
|
config = new SWGChannelSettings();
|
||||||
m_config_isSet = false;
|
m_config_isSet = false;
|
||||||
}
|
}
|
||||||
@ -55,9 +51,6 @@ SWGChannelConfig::cleanup() {
|
|||||||
if(channel_id_uri != nullptr) {
|
if(channel_id_uri != nullptr) {
|
||||||
delete channel_id_uri;
|
delete channel_id_uri;
|
||||||
}
|
}
|
||||||
if(channel_id != nullptr) {
|
|
||||||
delete channel_id;
|
|
||||||
}
|
|
||||||
if(config != nullptr) {
|
if(config != nullptr) {
|
||||||
delete config;
|
delete config;
|
||||||
}
|
}
|
||||||
@ -76,8 +69,6 @@ void
|
|||||||
SWGChannelConfig::fromJsonObject(QJsonObject &pJson) {
|
SWGChannelConfig::fromJsonObject(QJsonObject &pJson) {
|
||||||
::SWGSDRangel::setValue(&channel_id_uri, pJson["channelIdURI"], "QString", "QString");
|
::SWGSDRangel::setValue(&channel_id_uri, pJson["channelIdURI"], "QString", "QString");
|
||||||
|
|
||||||
::SWGSDRangel::setValue(&channel_id, pJson["channelId"], "QString", "QString");
|
|
||||||
|
|
||||||
::SWGSDRangel::setValue(&config, pJson["config"], "SWGChannelSettings", "SWGChannelSettings");
|
::SWGSDRangel::setValue(&config, pJson["config"], "SWGChannelSettings", "SWGChannelSettings");
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -99,9 +90,6 @@ SWGChannelConfig::asJsonObject() {
|
|||||||
if(channel_id_uri != nullptr && *channel_id_uri != QString("")){
|
if(channel_id_uri != nullptr && *channel_id_uri != QString("")){
|
||||||
toJsonValue(QString("channelIdURI"), channel_id_uri, obj, QString("QString"));
|
toJsonValue(QString("channelIdURI"), channel_id_uri, obj, QString("QString"));
|
||||||
}
|
}
|
||||||
if(channel_id != nullptr && *channel_id != QString("")){
|
|
||||||
toJsonValue(QString("channelId"), channel_id, obj, QString("QString"));
|
|
||||||
}
|
|
||||||
if((config != nullptr) && (config->isSet())){
|
if((config != nullptr) && (config->isSet())){
|
||||||
toJsonValue(QString("config"), config, obj, QString("SWGChannelSettings"));
|
toJsonValue(QString("config"), config, obj, QString("SWGChannelSettings"));
|
||||||
}
|
}
|
||||||
@ -119,16 +107,6 @@ SWGChannelConfig::setChannelIdUri(QString* channel_id_uri) {
|
|||||||
this->m_channel_id_uri_isSet = true;
|
this->m_channel_id_uri_isSet = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString*
|
|
||||||
SWGChannelConfig::getChannelId() {
|
|
||||||
return channel_id;
|
|
||||||
}
|
|
||||||
void
|
|
||||||
SWGChannelConfig::setChannelId(QString* channel_id) {
|
|
||||||
this->channel_id = channel_id;
|
|
||||||
this->m_channel_id_isSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
SWGChannelSettings*
|
SWGChannelSettings*
|
||||||
SWGChannelConfig::getConfig() {
|
SWGChannelConfig::getConfig() {
|
||||||
return config;
|
return config;
|
||||||
@ -145,7 +123,6 @@ SWGChannelConfig::isSet(){
|
|||||||
bool isObjectUpdated = false;
|
bool isObjectUpdated = false;
|
||||||
do{
|
do{
|
||||||
if(channel_id_uri != nullptr && *channel_id_uri != QString("")){ isObjectUpdated = true; break;}
|
if(channel_id_uri != nullptr && *channel_id_uri != QString("")){ isObjectUpdated = true; break;}
|
||||||
if(channel_id != nullptr && *channel_id != QString("")){ isObjectUpdated = true; break;}
|
|
||||||
if(config != nullptr && config->isSet()){ isObjectUpdated = true; break;}
|
if(config != nullptr && config->isSet()){ isObjectUpdated = true; break;}
|
||||||
}while(false);
|
}while(false);
|
||||||
return isObjectUpdated;
|
return isObjectUpdated;
|
||||||
|
@ -46,9 +46,6 @@ public:
|
|||||||
QString* getChannelIdUri();
|
QString* getChannelIdUri();
|
||||||
void setChannelIdUri(QString* channel_id_uri);
|
void setChannelIdUri(QString* channel_id_uri);
|
||||||
|
|
||||||
QString* getChannelId();
|
|
||||||
void setChannelId(QString* channel_id);
|
|
||||||
|
|
||||||
SWGChannelSettings* getConfig();
|
SWGChannelSettings* getConfig();
|
||||||
void setConfig(SWGChannelSettings* config);
|
void setConfig(SWGChannelSettings* config);
|
||||||
|
|
||||||
@ -59,9 +56,6 @@ private:
|
|||||||
QString* channel_id_uri;
|
QString* channel_id_uri;
|
||||||
bool m_channel_id_uri_isSet;
|
bool m_channel_id_uri_isSet;
|
||||||
|
|
||||||
QString* channel_id;
|
|
||||||
bool m_channel_id_isSet;
|
|
||||||
|
|
||||||
SWGChannelSettings* config;
|
SWGChannelSettings* config;
|
||||||
bool m_config_isSet;
|
bool m_config_isSet;
|
||||||
|
|
||||||
|
@ -28,16 +28,14 @@ SWGPreferences::SWGPreferences(QString* json) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SWGPreferences::SWGPreferences() {
|
SWGPreferences::SWGPreferences() {
|
||||||
source_type = nullptr;
|
|
||||||
m_source_type_isSet = false;
|
|
||||||
source_device = nullptr;
|
source_device = nullptr;
|
||||||
m_source_device_isSet = false;
|
m_source_device_isSet = false;
|
||||||
|
source_index = 0;
|
||||||
|
m_source_index_isSet = false;
|
||||||
audio_type = nullptr;
|
audio_type = nullptr;
|
||||||
m_audio_type_isSet = false;
|
m_audio_type_isSet = false;
|
||||||
audio_device = nullptr;
|
audio_device = nullptr;
|
||||||
m_audio_device_isSet = false;
|
m_audio_device_isSet = false;
|
||||||
source_index = 0;
|
|
||||||
m_source_index_isSet = false;
|
|
||||||
latitude = 0.0f;
|
latitude = 0.0f;
|
||||||
m_latitude_isSet = false;
|
m_latitude_isSet = false;
|
||||||
longitude = 0.0f;
|
longitude = 0.0f;
|
||||||
@ -58,16 +56,14 @@ SWGPreferences::~SWGPreferences() {
|
|||||||
|
|
||||||
void
|
void
|
||||||
SWGPreferences::init() {
|
SWGPreferences::init() {
|
||||||
source_type = new QString("");
|
|
||||||
m_source_type_isSet = false;
|
|
||||||
source_device = new QString("");
|
source_device = new QString("");
|
||||||
m_source_device_isSet = false;
|
m_source_device_isSet = false;
|
||||||
|
source_index = 0;
|
||||||
|
m_source_index_isSet = false;
|
||||||
audio_type = new QString("");
|
audio_type = new QString("");
|
||||||
m_audio_type_isSet = false;
|
m_audio_type_isSet = false;
|
||||||
audio_device = new QString("");
|
audio_device = new QString("");
|
||||||
m_audio_device_isSet = false;
|
m_audio_device_isSet = false;
|
||||||
source_index = 0;
|
|
||||||
m_source_index_isSet = false;
|
|
||||||
latitude = 0.0f;
|
latitude = 0.0f;
|
||||||
m_latitude_isSet = false;
|
m_latitude_isSet = false;
|
||||||
longitude = 0.0f;
|
longitude = 0.0f;
|
||||||
@ -84,12 +80,10 @@ SWGPreferences::init() {
|
|||||||
|
|
||||||
void
|
void
|
||||||
SWGPreferences::cleanup() {
|
SWGPreferences::cleanup() {
|
||||||
if(source_type != nullptr) {
|
|
||||||
delete source_type;
|
|
||||||
}
|
|
||||||
if(source_device != nullptr) {
|
if(source_device != nullptr) {
|
||||||
delete source_device;
|
delete source_device;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(audio_type != nullptr) {
|
if(audio_type != nullptr) {
|
||||||
delete audio_type;
|
delete audio_type;
|
||||||
}
|
}
|
||||||
@ -100,7 +94,6 @@ SWGPreferences::cleanup() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(log_file_name != nullptr) {
|
if(log_file_name != nullptr) {
|
||||||
delete log_file_name;
|
delete log_file_name;
|
||||||
}
|
}
|
||||||
@ -118,16 +111,14 @@ SWGPreferences::fromJson(QString &json) {
|
|||||||
|
|
||||||
void
|
void
|
||||||
SWGPreferences::fromJsonObject(QJsonObject &pJson) {
|
SWGPreferences::fromJsonObject(QJsonObject &pJson) {
|
||||||
::SWGSDRangel::setValue(&source_type, pJson["sourceType"], "QString", "QString");
|
|
||||||
|
|
||||||
::SWGSDRangel::setValue(&source_device, pJson["sourceDevice"], "QString", "QString");
|
::SWGSDRangel::setValue(&source_device, pJson["sourceDevice"], "QString", "QString");
|
||||||
|
|
||||||
|
::SWGSDRangel::setValue(&source_index, pJson["sourceIndex"], "qint32", "");
|
||||||
|
|
||||||
::SWGSDRangel::setValue(&audio_type, pJson["audioType"], "QString", "QString");
|
::SWGSDRangel::setValue(&audio_type, pJson["audioType"], "QString", "QString");
|
||||||
|
|
||||||
::SWGSDRangel::setValue(&audio_device, pJson["audioDevice"], "QString", "QString");
|
::SWGSDRangel::setValue(&audio_device, pJson["audioDevice"], "QString", "QString");
|
||||||
|
|
||||||
::SWGSDRangel::setValue(&source_index, pJson["sourceIndex"], "qint32", "");
|
|
||||||
|
|
||||||
::SWGSDRangel::setValue(&latitude, pJson["latitude"], "float", "");
|
::SWGSDRangel::setValue(&latitude, pJson["latitude"], "float", "");
|
||||||
|
|
||||||
::SWGSDRangel::setValue(&longitude, pJson["longitude"], "float", "");
|
::SWGSDRangel::setValue(&longitude, pJson["longitude"], "float", "");
|
||||||
@ -156,21 +147,18 @@ SWGPreferences::asJson ()
|
|||||||
QJsonObject*
|
QJsonObject*
|
||||||
SWGPreferences::asJsonObject() {
|
SWGPreferences::asJsonObject() {
|
||||||
QJsonObject* obj = new QJsonObject();
|
QJsonObject* obj = new QJsonObject();
|
||||||
if(source_type != nullptr && *source_type != QString("")){
|
|
||||||
toJsonValue(QString("sourceType"), source_type, obj, QString("QString"));
|
|
||||||
}
|
|
||||||
if(source_device != nullptr && *source_device != QString("")){
|
if(source_device != nullptr && *source_device != QString("")){
|
||||||
toJsonValue(QString("sourceDevice"), source_device, obj, QString("QString"));
|
toJsonValue(QString("sourceDevice"), source_device, obj, QString("QString"));
|
||||||
}
|
}
|
||||||
|
if(m_source_index_isSet){
|
||||||
|
obj->insert("sourceIndex", QJsonValue(source_index));
|
||||||
|
}
|
||||||
if(audio_type != nullptr && *audio_type != QString("")){
|
if(audio_type != nullptr && *audio_type != QString("")){
|
||||||
toJsonValue(QString("audioType"), audio_type, obj, QString("QString"));
|
toJsonValue(QString("audioType"), audio_type, obj, QString("QString"));
|
||||||
}
|
}
|
||||||
if(audio_device != nullptr && *audio_device != QString("")){
|
if(audio_device != nullptr && *audio_device != QString("")){
|
||||||
toJsonValue(QString("audioDevice"), audio_device, obj, QString("QString"));
|
toJsonValue(QString("audioDevice"), audio_device, obj, QString("QString"));
|
||||||
}
|
}
|
||||||
if(m_source_index_isSet){
|
|
||||||
obj->insert("sourceIndex", QJsonValue(source_index));
|
|
||||||
}
|
|
||||||
if(m_latitude_isSet){
|
if(m_latitude_isSet){
|
||||||
obj->insert("latitude", QJsonValue(latitude));
|
obj->insert("latitude", QJsonValue(latitude));
|
||||||
}
|
}
|
||||||
@ -193,16 +181,6 @@ SWGPreferences::asJsonObject() {
|
|||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString*
|
|
||||||
SWGPreferences::getSourceType() {
|
|
||||||
return source_type;
|
|
||||||
}
|
|
||||||
void
|
|
||||||
SWGPreferences::setSourceType(QString* source_type) {
|
|
||||||
this->source_type = source_type;
|
|
||||||
this->m_source_type_isSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString*
|
QString*
|
||||||
SWGPreferences::getSourceDevice() {
|
SWGPreferences::getSourceDevice() {
|
||||||
return source_device;
|
return source_device;
|
||||||
@ -213,6 +191,16 @@ SWGPreferences::setSourceDevice(QString* source_device) {
|
|||||||
this->m_source_device_isSet = true;
|
this->m_source_device_isSet = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qint32
|
||||||
|
SWGPreferences::getSourceIndex() {
|
||||||
|
return source_index;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGPreferences::setSourceIndex(qint32 source_index) {
|
||||||
|
this->source_index = source_index;
|
||||||
|
this->m_source_index_isSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
QString*
|
QString*
|
||||||
SWGPreferences::getAudioType() {
|
SWGPreferences::getAudioType() {
|
||||||
return audio_type;
|
return audio_type;
|
||||||
@ -233,16 +221,6 @@ SWGPreferences::setAudioDevice(QString* audio_device) {
|
|||||||
this->m_audio_device_isSet = true;
|
this->m_audio_device_isSet = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
qint32
|
|
||||||
SWGPreferences::getSourceIndex() {
|
|
||||||
return source_index;
|
|
||||||
}
|
|
||||||
void
|
|
||||||
SWGPreferences::setSourceIndex(qint32 source_index) {
|
|
||||||
this->source_index = source_index;
|
|
||||||
this->m_source_index_isSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
float
|
float
|
||||||
SWGPreferences::getLatitude() {
|
SWGPreferences::getLatitude() {
|
||||||
return latitude;
|
return latitude;
|
||||||
@ -308,11 +286,10 @@ bool
|
|||||||
SWGPreferences::isSet(){
|
SWGPreferences::isSet(){
|
||||||
bool isObjectUpdated = false;
|
bool isObjectUpdated = false;
|
||||||
do{
|
do{
|
||||||
if(source_type != nullptr && *source_type != QString("")){ isObjectUpdated = true; break;}
|
|
||||||
if(source_device != nullptr && *source_device != QString("")){ isObjectUpdated = true; break;}
|
if(source_device != nullptr && *source_device != QString("")){ isObjectUpdated = true; break;}
|
||||||
|
if(m_source_index_isSet){ isObjectUpdated = true; break;}
|
||||||
if(audio_type != nullptr && *audio_type != QString("")){ isObjectUpdated = true; break;}
|
if(audio_type != nullptr && *audio_type != QString("")){ isObjectUpdated = true; break;}
|
||||||
if(audio_device != nullptr && *audio_device != QString("")){ isObjectUpdated = true; break;}
|
if(audio_device != nullptr && *audio_device != QString("")){ isObjectUpdated = true; break;}
|
||||||
if(m_source_index_isSet){ isObjectUpdated = true; break;}
|
|
||||||
if(m_latitude_isSet){ isObjectUpdated = true; break;}
|
if(m_latitude_isSet){ isObjectUpdated = true; break;}
|
||||||
if(m_longitude_isSet){ isObjectUpdated = true; break;}
|
if(m_longitude_isSet){ isObjectUpdated = true; break;}
|
||||||
if(m_console_min_log_level_isSet){ isObjectUpdated = true; break;}
|
if(m_console_min_log_level_isSet){ isObjectUpdated = true; break;}
|
||||||
|
@ -42,21 +42,18 @@ public:
|
|||||||
virtual void fromJsonObject(QJsonObject &json) override;
|
virtual void fromJsonObject(QJsonObject &json) override;
|
||||||
virtual SWGPreferences* fromJson(QString &jsonString) override;
|
virtual SWGPreferences* fromJson(QString &jsonString) override;
|
||||||
|
|
||||||
QString* getSourceType();
|
|
||||||
void setSourceType(QString* source_type);
|
|
||||||
|
|
||||||
QString* getSourceDevice();
|
QString* getSourceDevice();
|
||||||
void setSourceDevice(QString* source_device);
|
void setSourceDevice(QString* source_device);
|
||||||
|
|
||||||
|
qint32 getSourceIndex();
|
||||||
|
void setSourceIndex(qint32 source_index);
|
||||||
|
|
||||||
QString* getAudioType();
|
QString* getAudioType();
|
||||||
void setAudioType(QString* audio_type);
|
void setAudioType(QString* audio_type);
|
||||||
|
|
||||||
QString* getAudioDevice();
|
QString* getAudioDevice();
|
||||||
void setAudioDevice(QString* audio_device);
|
void setAudioDevice(QString* audio_device);
|
||||||
|
|
||||||
qint32 getSourceIndex();
|
|
||||||
void setSourceIndex(qint32 source_index);
|
|
||||||
|
|
||||||
float getLatitude();
|
float getLatitude();
|
||||||
void setLatitude(float latitude);
|
void setLatitude(float latitude);
|
||||||
|
|
||||||
@ -79,21 +76,18 @@ public:
|
|||||||
virtual bool isSet() override;
|
virtual bool isSet() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString* source_type;
|
|
||||||
bool m_source_type_isSet;
|
|
||||||
|
|
||||||
QString* source_device;
|
QString* source_device;
|
||||||
bool m_source_device_isSet;
|
bool m_source_device_isSet;
|
||||||
|
|
||||||
|
qint32 source_index;
|
||||||
|
bool m_source_index_isSet;
|
||||||
|
|
||||||
QString* audio_type;
|
QString* audio_type;
|
||||||
bool m_audio_type_isSet;
|
bool m_audio_type_isSet;
|
||||||
|
|
||||||
QString* audio_device;
|
QString* audio_device;
|
||||||
bool m_audio_device_isSet;
|
bool m_audio_device_isSet;
|
||||||
|
|
||||||
qint32 source_index;
|
|
||||||
bool m_source_index_isSet;
|
|
||||||
|
|
||||||
float latitude;
|
float latitude;
|
||||||
bool m_latitude_isSet;
|
bool m_latitude_isSet;
|
||||||
|
|
||||||
|
@ -36,8 +36,8 @@ SWGPreset::SWGPreset() {
|
|||||||
m_description_isSet = false;
|
m_description_isSet = false;
|
||||||
center_frequency = 0L;
|
center_frequency = 0L;
|
||||||
m_center_frequency_isSet = false;
|
m_center_frequency_isSet = false;
|
||||||
m_spectrum_config = nullptr;
|
spectrum_config = nullptr;
|
||||||
m_m_spectrum_config_isSet = false;
|
m_spectrum_config_isSet = false;
|
||||||
dc_offset_correction = 0;
|
dc_offset_correction = 0;
|
||||||
m_dc_offset_correction_isSet = false;
|
m_dc_offset_correction_isSet = false;
|
||||||
iq_imbalance_correction = 0;
|
iq_imbalance_correction = 0;
|
||||||
@ -64,8 +64,8 @@ SWGPreset::init() {
|
|||||||
m_description_isSet = false;
|
m_description_isSet = false;
|
||||||
center_frequency = 0L;
|
center_frequency = 0L;
|
||||||
m_center_frequency_isSet = false;
|
m_center_frequency_isSet = false;
|
||||||
m_spectrum_config = new SWGGLSpectrum();
|
spectrum_config = new SWGGLSpectrum();
|
||||||
m_m_spectrum_config_isSet = false;
|
m_spectrum_config_isSet = false;
|
||||||
dc_offset_correction = 0;
|
dc_offset_correction = 0;
|
||||||
m_dc_offset_correction_isSet = false;
|
m_dc_offset_correction_isSet = false;
|
||||||
iq_imbalance_correction = 0;
|
iq_imbalance_correction = 0;
|
||||||
@ -88,8 +88,8 @@ SWGPreset::cleanup() {
|
|||||||
delete description;
|
delete description;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_spectrum_config != nullptr) {
|
if(spectrum_config != nullptr) {
|
||||||
delete m_spectrum_config;
|
delete spectrum_config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -131,7 +131,7 @@ SWGPreset::fromJsonObject(QJsonObject &pJson) {
|
|||||||
|
|
||||||
::SWGSDRangel::setValue(¢er_frequency, pJson["centerFrequency"], "qint64", "");
|
::SWGSDRangel::setValue(¢er_frequency, pJson["centerFrequency"], "qint64", "");
|
||||||
|
|
||||||
::SWGSDRangel::setValue(&m_spectrum_config, pJson["m_spectrumConfig"], "SWGGLSpectrum", "SWGGLSpectrum");
|
::SWGSDRangel::setValue(&spectrum_config, pJson["spectrumConfig"], "SWGGLSpectrum", "SWGGLSpectrum");
|
||||||
|
|
||||||
::SWGSDRangel::setValue(&dc_offset_correction, pJson["dcOffsetCorrection"], "qint32", "");
|
::SWGSDRangel::setValue(&dc_offset_correction, pJson["dcOffsetCorrection"], "qint32", "");
|
||||||
|
|
||||||
@ -171,8 +171,8 @@ SWGPreset::asJsonObject() {
|
|||||||
if(m_center_frequency_isSet){
|
if(m_center_frequency_isSet){
|
||||||
obj->insert("centerFrequency", QJsonValue(center_frequency));
|
obj->insert("centerFrequency", QJsonValue(center_frequency));
|
||||||
}
|
}
|
||||||
if((m_spectrum_config != nullptr) && (m_spectrum_config->isSet())){
|
if((spectrum_config != nullptr) && (spectrum_config->isSet())){
|
||||||
toJsonValue(QString("m_spectrumConfig"), m_spectrum_config, obj, QString("SWGGLSpectrum"));
|
toJsonValue(QString("spectrumConfig"), spectrum_config, obj, QString("SWGGLSpectrum"));
|
||||||
}
|
}
|
||||||
if(m_dc_offset_correction_isSet){
|
if(m_dc_offset_correction_isSet){
|
||||||
obj->insert("dcOffsetCorrection", QJsonValue(dc_offset_correction));
|
obj->insert("dcOffsetCorrection", QJsonValue(dc_offset_correction));
|
||||||
@ -234,13 +234,13 @@ SWGPreset::setCenterFrequency(qint64 center_frequency) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SWGGLSpectrum*
|
SWGGLSpectrum*
|
||||||
SWGPreset::getMSpectrumConfig() {
|
SWGPreset::getSpectrumConfig() {
|
||||||
return m_spectrum_config;
|
return spectrum_config;
|
||||||
}
|
}
|
||||||
void
|
void
|
||||||
SWGPreset::setMSpectrumConfig(SWGGLSpectrum* m_spectrum_config) {
|
SWGPreset::setSpectrumConfig(SWGGLSpectrum* spectrum_config) {
|
||||||
this->m_spectrum_config = m_spectrum_config;
|
this->spectrum_config = spectrum_config;
|
||||||
this->m_m_spectrum_config_isSet = true;
|
this->m_spectrum_config_isSet = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
qint32
|
qint32
|
||||||
@ -302,7 +302,7 @@ SWGPreset::isSet(){
|
|||||||
if(group != nullptr && *group != QString("")){ isObjectUpdated = true; break;}
|
if(group != nullptr && *group != QString("")){ isObjectUpdated = true; break;}
|
||||||
if(description != nullptr && *description != QString("")){ isObjectUpdated = true; break;}
|
if(description != nullptr && *description != QString("")){ isObjectUpdated = true; break;}
|
||||||
if(m_center_frequency_isSet){ isObjectUpdated = true; break;}
|
if(m_center_frequency_isSet){ isObjectUpdated = true; break;}
|
||||||
if(m_spectrum_config != nullptr && m_spectrum_config->isSet()){ isObjectUpdated = true; break;}
|
if(spectrum_config != nullptr && spectrum_config->isSet()){ isObjectUpdated = true; break;}
|
||||||
if(m_dc_offset_correction_isSet){ isObjectUpdated = true; break;}
|
if(m_dc_offset_correction_isSet){ isObjectUpdated = true; break;}
|
||||||
if(m_iq_imbalance_correction_isSet){ isObjectUpdated = true; break;}
|
if(m_iq_imbalance_correction_isSet){ isObjectUpdated = true; break;}
|
||||||
if(channel_configs->size() > 0){ isObjectUpdated = true; break;}
|
if(channel_configs->size() > 0){ isObjectUpdated = true; break;}
|
||||||
|
@ -58,8 +58,8 @@ public:
|
|||||||
qint64 getCenterFrequency();
|
qint64 getCenterFrequency();
|
||||||
void setCenterFrequency(qint64 center_frequency);
|
void setCenterFrequency(qint64 center_frequency);
|
||||||
|
|
||||||
SWGGLSpectrum* getMSpectrumConfig();
|
SWGGLSpectrum* getSpectrumConfig();
|
||||||
void setMSpectrumConfig(SWGGLSpectrum* m_spectrum_config);
|
void setSpectrumConfig(SWGGLSpectrum* spectrum_config);
|
||||||
|
|
||||||
qint32 getDcOffsetCorrection();
|
qint32 getDcOffsetCorrection();
|
||||||
void setDcOffsetCorrection(qint32 dc_offset_correction);
|
void setDcOffsetCorrection(qint32 dc_offset_correction);
|
||||||
@ -92,8 +92,8 @@ private:
|
|||||||
qint64 center_frequency;
|
qint64 center_frequency;
|
||||||
bool m_center_frequency_isSet;
|
bool m_center_frequency_isSet;
|
||||||
|
|
||||||
SWGGLSpectrum* m_spectrum_config;
|
SWGGLSpectrum* spectrum_config;
|
||||||
bool m_m_spectrum_config_isSet;
|
bool m_spectrum_config_isSet;
|
||||||
|
|
||||||
qint32 dc_offset_correction;
|
qint32 dc_offset_correction;
|
||||||
bool m_dc_offset_correction_isSet;
|
bool m_dc_offset_correction_isSet;
|
||||||
|
Loading…
Reference in New Issue
Block a user