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

Fix typos in ChannelAnalyzer settings

With this fix, corresponding settings updates are now properly
communicated via reverse API.
This commit is contained in:
Mykola Dvornik 2024-04-18 22:46:21 +02:00
parent 6b41a77e31
commit f55adc481d
2 changed files with 12 additions and 12 deletions

View File

@ -380,13 +380,13 @@ void ChannelAnalyzer::webapiUpdateChannelSettings(
const QStringList& channelSettingsKeys, const QStringList& channelSettingsKeys,
SWGSDRangel::SWGChannelSettings& response) SWGSDRangel::SWGChannelSettings& response)
{ {
if (channelSettingsKeys.contains("frequency")) { if (channelSettingsKeys.contains("inputFrequencyOffset")) {
settings.m_inputFrequencyOffset = response.getChannelAnalyzerSettings()->getFrequency(); settings.m_inputFrequencyOffset = response.getChannelAnalyzerSettings()->getFrequency();
} }
if (channelSettingsKeys.contains("downSample")) { if (channelSettingsKeys.contains("rationalDownSample ")) {
settings.m_rationalDownSample = response.getChannelAnalyzerSettings()->getDownSample() != 0; settings.m_rationalDownSample = response.getChannelAnalyzerSettings()->getDownSample() != 0;
} }
if (channelSettingsKeys.contains("downSampleRate")) { if (channelSettingsKeys.contains("rationalDownSamplerRate")) {
settings.m_rationalDownSamplerRate = response.getChannelAnalyzerSettings()->getDownSampleRate(); settings.m_rationalDownSamplerRate = response.getChannelAnalyzerSettings()->getDownSampleRate();
} }
if (channelSettingsKeys.contains("bandwidth")) { if (channelSettingsKeys.contains("bandwidth")) {
@ -639,13 +639,13 @@ void ChannelAnalyzer::webapiFormatChannelSettings(
// transfer data that has been modified. When force is on transfer all data except reverse API data // transfer data that has been modified. When force is on transfer all data except reverse API data
if (channelSettingsKeys.contains("frequency") || force) { if (channelSettingsKeys.contains("inputFrequencyOffset") || force) {
swgChannelAnalyzerSettings->setFrequency(settings.m_inputFrequencyOffset); swgChannelAnalyzerSettings->setFrequency(settings.m_inputFrequencyOffset);
} }
if (channelSettingsKeys.contains("downSample")) { if (channelSettingsKeys.contains("rationalDownSample")) {
swgChannelAnalyzerSettings->setDownSample(settings.m_rationalDownSample ? 1 : 0); swgChannelAnalyzerSettings->setDownSample(settings.m_rationalDownSample ? 1 : 0);
} }
if (channelSettingsKeys.contains("downSampleRate")) { if (channelSettingsKeys.contains("rationalDownSamplerRate")) {
swgChannelAnalyzerSettings->setDownSampleRate(settings.m_rationalDownSamplerRate); swgChannelAnalyzerSettings->setDownSampleRate(settings.m_rationalDownSamplerRate);
} }
if (channelSettingsKeys.contains("bandwidth")) { if (channelSettingsKeys.contains("bandwidth")) {

View File

@ -210,11 +210,11 @@ SWGChannelAnalyzerSettings::fromJson(QString &json) {
void void
SWGChannelAnalyzerSettings::fromJsonObject(QJsonObject &pJson) { SWGChannelAnalyzerSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&frequency, pJson["frequency"], "qint32", ""); ::SWGSDRangel::setValue(&frequency, pJson["inputFrequencyOffset"], "qint32", "");
::SWGSDRangel::setValue(&down_sample, pJson["downSample"], "qint32", ""); ::SWGSDRangel::setValue(&down_sample, pJson["rationalDownSample"], "qint32", "");
::SWGSDRangel::setValue(&down_sample_rate, pJson["downSampleRate"], "qint32", ""); ::SWGSDRangel::setValue(&down_sample_rate, pJson["rationalDownSamplerRate"], "qint32", "");
::SWGSDRangel::setValue(&bandwidth, pJson["bandwidth"], "qint32", ""); ::SWGSDRangel::setValue(&bandwidth, pJson["bandwidth"], "qint32", "");
@ -285,13 +285,13 @@ QJsonObject*
SWGChannelAnalyzerSettings::asJsonObject() { SWGChannelAnalyzerSettings::asJsonObject() {
QJsonObject* obj = new QJsonObject(); QJsonObject* obj = new QJsonObject();
if(m_frequency_isSet){ if(m_frequency_isSet){
obj->insert("frequency", QJsonValue(frequency)); obj->insert("inputFrequencyOffset", QJsonValue(frequency));
} }
if(m_down_sample_isSet){ if(m_down_sample_isSet){
obj->insert("downSample", QJsonValue(down_sample)); obj->insert("rationalDownSample", QJsonValue(down_sample));
} }
if(m_down_sample_rate_isSet){ if(m_down_sample_rate_isSet){
obj->insert("downSampleRate", QJsonValue(down_sample_rate)); obj->insert("rationalDownSamplerRate", QJsonValue(down_sample_rate));
} }
if(m_bandwidth_isSet){ if(m_bandwidth_isSet){
obj->insert("bandwidth", QJsonValue(bandwidth)); obj->insert("bandwidth", QJsonValue(bandwidth));