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

Web API: AM demod: added pll and syncAMOperation settings processing

This commit is contained in:
f4exb 2018-08-02 23:27:22 +02:00
parent eef1ce9a64
commit 8dd65e70f2
8 changed files with 99 additions and 2 deletions

1
debian/changelog vendored
View File

@ -1,6 +1,7 @@
sdrangel (4.0.6-1) unstable; urgency=medium sdrangel (4.0.6-1) unstable; urgency=medium
* Web API: RTL-SDR: fixed RF bandwidth setting * Web API: RTL-SDR: fixed RF bandwidth setting
* Web API: enhnaced DV serial and AM demod interfaces
-- Edouard Griffiths, F4EXB <f4exb06@gmail.com> Sun, 05 Aug 2018 09:14:18 +0200 -- Edouard Griffiths, F4EXB <f4exb06@gmail.com> Sun, 05 Aug 2018 09:14:18 +0200

View File

@ -549,6 +549,17 @@ int AMDemod::webapiSettingsPutPatch(
settings.m_audioDeviceName = *response.getAmDemodSettings()->getAudioDeviceName(); settings.m_audioDeviceName = *response.getAmDemodSettings()->getAudioDeviceName();
} }
if (channelSettingsKeys.contains("pll")) {
settings.m_pll = response.getAmDemodSettings()->getPll();
}
if (channelSettingsKeys.contains("syncAMOperation")) {
qint32 syncAMOperationCode = response.getAmDemodSettings()->getSyncAmOperation();
settings.m_syncAMOperation = syncAMOperationCode < 0 ?
AMDemodSettings::SyncAMDSB : syncAMOperationCode > 2 ?
AMDemodSettings::SyncAMDSB : (AMDemodSettings::SyncAMOperation) syncAMOperationCode;
}
if (frequencyOffsetChanged) if (frequencyOffsetChanged)
{ {
MsgConfigureChannelizer* channelConfigMsg = MsgConfigureChannelizer::create( MsgConfigureChannelizer* channelConfigMsg = MsgConfigureChannelizer::create(
@ -602,6 +613,9 @@ void AMDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& respo
} else { } else {
response.getAmDemodSettings()->setAudioDeviceName(new QString(settings.m_audioDeviceName)); response.getAmDemodSettings()->setAudioDeviceName(new QString(settings.m_audioDeviceName));
} }
response.getAmDemodSettings()->setPll(settings.m_pll ? 1 : 0);
response.getAmDemodSettings()->setSyncAmOperation((int) m_settings.m_syncAMOperation);
} }
void AMDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response) void AMDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)

View File

@ -752,6 +752,14 @@ margin-bottom: 20px;
}, },
"audioDeviceName" : { "audioDeviceName" : {
"type" : "string" "type" : "string"
},
"pll" : {
"type" : "integer",
"description" : "PLL active (for synchronous AM)"
},
"syncAMOperation" : {
"type" : "integer",
"description" : "Synchronous AM sidebands mode (DSB, USB, LSB)"
} }
}, },
"description" : "AMDemod" "description" : "AMDemod"
@ -22947,7 +22955,7 @@ except ApiException as e:
</div> </div>
<div id="generator"> <div id="generator">
<div class="content"> <div class="content">
Generated 2018-08-02T21:39:46.879+02:00 Generated 2018-08-02T23:13:51.054+02:00
</div> </div>
</div> </div>
</div> </div>

View File

@ -27,6 +27,12 @@ AMDemodSettings:
type: string type: string
audioDeviceName: audioDeviceName:
type: string type: string
pll:
description: PLL active (for synchronous AM)
type: integer
syncAMOperation:
description: Synchronous AM sidebands mode (DSB, USB, LSB)
type: integer
AMDemodReport: AMDemodReport:
description: AMDemod description: AMDemod

View File

@ -27,6 +27,12 @@ AMDemodSettings:
type: string type: string
audioDeviceName: audioDeviceName:
type: string type: string
pll:
description: PLL active (for synchronous AM)
type: integer
syncAMOperation:
description: Synchronous AM sidebands mode (DSB, USB, LSB)
type: integer
AMDemodReport: AMDemodReport:
description: AMDemod description: AMDemod

View File

@ -752,6 +752,14 @@ margin-bottom: 20px;
}, },
"audioDeviceName" : { "audioDeviceName" : {
"type" : "string" "type" : "string"
},
"pll" : {
"type" : "integer",
"description" : "PLL active (for synchronous AM)"
},
"syncAMOperation" : {
"type" : "integer",
"description" : "Synchronous AM sidebands mode (DSB, USB, LSB)"
} }
}, },
"description" : "AMDemod" "description" : "AMDemod"
@ -22947,7 +22955,7 @@ except ApiException as e:
</div> </div>
<div id="generator"> <div id="generator">
<div class="content"> <div class="content">
Generated 2018-08-02T21:39:46.879+02:00 Generated 2018-08-02T23:13:51.054+02:00
</div> </div>
</div> </div>
</div> </div>

View File

@ -46,6 +46,10 @@ SWGAMDemodSettings::SWGAMDemodSettings() {
m_title_isSet = false; m_title_isSet = false;
audio_device_name = nullptr; audio_device_name = nullptr;
m_audio_device_name_isSet = false; m_audio_device_name_isSet = false;
pll = 0;
m_pll_isSet = false;
sync_am_operation = 0;
m_sync_am_operation_isSet = false;
} }
SWGAMDemodSettings::~SWGAMDemodSettings() { SWGAMDemodSettings::~SWGAMDemodSettings() {
@ -72,6 +76,10 @@ SWGAMDemodSettings::init() {
m_title_isSet = false; m_title_isSet = false;
audio_device_name = new QString(""); audio_device_name = new QString("");
m_audio_device_name_isSet = false; m_audio_device_name_isSet = false;
pll = 0;
m_pll_isSet = false;
sync_am_operation = 0;
m_sync_am_operation_isSet = false;
} }
void void
@ -89,6 +97,8 @@ SWGAMDemodSettings::cleanup() {
if(audio_device_name != nullptr) { if(audio_device_name != nullptr) {
delete audio_device_name; delete audio_device_name;
} }
} }
SWGAMDemodSettings* SWGAMDemodSettings*
@ -120,6 +130,10 @@ SWGAMDemodSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&audio_device_name, pJson["audioDeviceName"], "QString", "QString"); ::SWGSDRangel::setValue(&audio_device_name, pJson["audioDeviceName"], "QString", "QString");
::SWGSDRangel::setValue(&pll, pJson["pll"], "qint32", "");
::SWGSDRangel::setValue(&sync_am_operation, pJson["syncAMOperation"], "qint32", "");
} }
QString QString
@ -163,6 +177,12 @@ SWGAMDemodSettings::asJsonObject() {
if(audio_device_name != nullptr && *audio_device_name != QString("")){ if(audio_device_name != nullptr && *audio_device_name != QString("")){
toJsonValue(QString("audioDeviceName"), audio_device_name, obj, QString("QString")); toJsonValue(QString("audioDeviceName"), audio_device_name, obj, QString("QString"));
} }
if(m_pll_isSet){
obj->insert("pll", QJsonValue(pll));
}
if(m_sync_am_operation_isSet){
obj->insert("syncAMOperation", QJsonValue(sync_am_operation));
}
return obj; return obj;
} }
@ -257,6 +277,26 @@ SWGAMDemodSettings::setAudioDeviceName(QString* audio_device_name) {
this->m_audio_device_name_isSet = true; this->m_audio_device_name_isSet = true;
} }
qint32
SWGAMDemodSettings::getPll() {
return pll;
}
void
SWGAMDemodSettings::setPll(qint32 pll) {
this->pll = pll;
this->m_pll_isSet = true;
}
qint32
SWGAMDemodSettings::getSyncAmOperation() {
return sync_am_operation;
}
void
SWGAMDemodSettings::setSyncAmOperation(qint32 sync_am_operation) {
this->sync_am_operation = sync_am_operation;
this->m_sync_am_operation_isSet = true;
}
bool bool
SWGAMDemodSettings::isSet(){ SWGAMDemodSettings::isSet(){
@ -271,6 +311,8 @@ SWGAMDemodSettings::isSet(){
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(audio_device_name != nullptr && *audio_device_name != QString("")){ isObjectUpdated = true; break;} if(audio_device_name != nullptr && *audio_device_name != QString("")){ isObjectUpdated = true; break;}
if(m_pll_isSet){ isObjectUpdated = true; break;}
if(m_sync_am_operation_isSet){ isObjectUpdated = true; break;}
}while(false); }while(false);
return isObjectUpdated; return isObjectUpdated;
} }

View File

@ -69,6 +69,12 @@ public:
QString* getAudioDeviceName(); QString* getAudioDeviceName();
void setAudioDeviceName(QString* audio_device_name); void setAudioDeviceName(QString* audio_device_name);
qint32 getPll();
void setPll(qint32 pll);
qint32 getSyncAmOperation();
void setSyncAmOperation(qint32 sync_am_operation);
virtual bool isSet() override; virtual bool isSet() override;
@ -100,6 +106,12 @@ private:
QString* audio_device_name; QString* audio_device_name;
bool m_audio_device_name_isSet; bool m_audio_device_name_isSet;
qint32 pll;
bool m_pll_isSet;
qint32 sync_am_operation;
bool m_sync_am_operation_isSet;
}; };
} }