KiwiSDR: added a DC block

pull/375/head
f4exb 2019-06-09 20:56:22 +02:00
rodzic 58ee095194
commit 7f97826c58
17 zmienionych plików z 80 dodań i 7 usunięć

Wyświetl plik

@ -31,7 +31,7 @@ sdrangel (4.8.2-1) unstable; urgency=medium
sdrangel (4.8.1-1) unstable; urgency=medium
* AM demod: fixed audio interpolator. Issue #354
* Implemented interpolation to audio for NFM and SSB demods allowing the use of a 48k audio sink regardless of the channel sample rate
* Interpolation to audio for NFM and SSB demods allowing the use of a 48k audio sink regardless of the channel sample rate
* AM demod: implemented low pass filter after the demod. Issue #352
* Spectrum window: added ability to use the mouse wheel to move the central channel marker line. Issue #343
* Frequency Tracker: make lock converge faster

2
debian/changelog vendored
Wyświetl plik

@ -31,7 +31,7 @@ sdrangel (4.8.2-1) unstable; urgency=medium
sdrangel (4.8.1-1) unstable; urgency=medium
* AM demod: fixed audio interpolator. Issue #354
* Implemented interpolation to audio for NFM and SSB demods allowing the use of a 48k audio sink regardless of the channel sample rate
* Interpolation to audio for NFM and SSB demods allowing the use of a 48k audio sink regardless of the channel sample rate
* AM demod: implemented low pass filter after the demod. Issue #352
* Spectrum window: added ability to use the mouse wheel to move the central channel marker line. Issue #343
* Frequency Tracker: make lock converge faster

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 17 KiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 18 KiB

Plik binarny nie jest wyświetlany.

Wyświetl plik

@ -165,6 +165,12 @@ void KiwiSDRGui::on_serverAddressApplyButton_clicked()
sendSettings();
}
void KiwiSDRGui::on_dcBlock_toggled(bool checked)
{
m_settings.m_dcBlock = checked;
sendSettings();
}
void KiwiSDRGui::on_record_toggled(bool checked)
{
if (checked) {

Wyświetl plik

@ -85,6 +85,7 @@ private slots:
void on_agc_toggled(bool checked);
void on_serverAddress_returnPressed();
void on_serverAddressApplyButton_clicked();
void on_dcBlock_toggled(bool checked);
void openDeviceSettingsDialog(const QPoint& p);
void updateStatus();
void updateHardware();

Wyświetl plik

@ -32,7 +32,7 @@
</font>
</property>
<property name="windowTitle">
<string>Test source</string>
<string>KiwiSDR</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
@ -310,6 +310,16 @@
</property>
</widget>
</item>
<item>
<widget class="ButtonSwitch" name="dcBlock">
<property name="toolTip">
<string>Automatic DC offset removal</string>
</property>
<property name="text">
<string>DC</string>
</property>
</widget>
</item>
</layout>
</item>
<item>

Wyświetl plik

@ -302,6 +302,12 @@ bool KiwiSDRInput::applySettings(const KiwiSDRSettings& settings, bool force)
emit setWorkerGain(settings.m_gain, settings.m_useAGC);
}
if (m_settings.m_dcBlock != settings.m_dcBlock)
{
reverseAPIKeys.append("dcBlock");
m_deviceAPI->configureCorrections(settings.m_dcBlock, false);
}
if (m_settings.m_centerFrequency != settings.m_centerFrequency || force)
{
reverseAPIKeys.append("centerFrequency");
@ -382,6 +388,9 @@ int KiwiSDRInput::webapiSettingsPutPatch(
if (deviceSettingsKeys.contains("useAGC")) {
settings.m_useAGC = response.getKiwiSdrSettings()->getUseAgc();
}
if (deviceSettingsKeys.contains("dcBlock")) {
settings.m_dcBlock = response.getKiwiSdrSettings()->getDcBlock() != 0;
}
if (deviceSettingsKeys.contains("centerFrequency")) {
settings.m_centerFrequency = response.getKiwiSdrSettings()->getCenterFrequency();
}
@ -432,6 +441,7 @@ void KiwiSDRInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& re
{
response.getKiwiSdrSettings()->setGain(settings.m_gain);
response.getKiwiSdrSettings()->setUseAgc(settings.m_useAGC ? 1 : 0);
response.getKiwiSdrSettings()->setDcBlock(settings.m_dcBlock ? 1 : 0);
response.getKiwiSdrSettings()->setCenterFrequency(settings.m_centerFrequency);
if (response.getKiwiSdrSettings()->getServerAddress()) {
@ -480,6 +490,9 @@ void KiwiSDRInput::webapiReverseSendSettings(QList<QString>& deviceSettingsKeys,
if (deviceSettingsKeys.contains("useAGC")) {
swgKiwiSDRSettings->setUseAgc(settings.m_useAGC ? 1 : 0);
}
if (deviceSettingsKeys.contains("dcBlock") || force) {
swgKiwiSDRSettings->setDcBlock(settings.m_dcBlock ? 1 : 0);
}
if (deviceSettingsKeys.contains("centerFrequency") || force) {
swgKiwiSDRSettings->setCenterFrequency(settings.m_centerFrequency);
}

Wyświetl plik

@ -30,6 +30,7 @@ void KiwiSDRSettings::resetToDefaults()
m_gain = 20;
m_useAGC = true;
m_dcBlock = false;
m_serverAddress = "127.0.0.1:8073";

Wyświetl plik

@ -25,6 +25,7 @@
struct KiwiSDRSettings {
uint32_t m_gain;
bool m_useAGC;
bool m_dcBlock;
quint64 m_centerFrequency;
QString m_serverAddress;

Wyświetl plik

@ -2,7 +2,7 @@
<h2>Introduction</h2>
This plugin is designed to enable connection to publicly available [KiwiSDR](http://kiwisdr.com/) receivers. A list of on-line receiver is available [here](https://sdr.hu/?q=kiwisdr)
This plugin is designed to enable connection to publicly available [KiwiSDR](http://kiwisdr.com/) receivers. A list of on-line receivers is available [here](https://sdr.hu/?q=kiwisdr)
<h2>Interface</h2>
@ -57,4 +57,8 @@ This is the RF gain control sent to the remote
<h3>9: AGC</h3>
Use this button to switch on or off the AGC in the remote
Use this button to switch on or off the AGC in the remote
<h3>10: DC block</h3>
Some remote receivers exhibit a peak at DC. Use this button to filter DC out.

Wyświetl plik

@ -3098,6 +3098,9 @@ margin-bottom: 20px;
"type" : "integer",
"description" : "AGC active (1 for yes, 0 for no)"
},
"dcBlock" : {
"type" : "integer"
},
"centerFrequency" : {
"type" : "integer",
"format" : "int64"
@ -25151,7 +25154,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2019-06-09T01:28:52.118+02:00
Generated 2019-06-09T20:39:26.572+02:00
</div>
</div>
</div>

Wyświetl plik

@ -6,6 +6,8 @@ KiwiSDRSettings:
useAGC:
description: AGC active (1 for yes, 0 for no)
type: integer
dcBlock:
type: integer
centerFrequency:
type: integer
format: int64

Wyświetl plik

@ -6,6 +6,8 @@ KiwiSDRSettings:
useAGC:
description: AGC active (1 for yes, 0 for no)
type: integer
dcBlock:
type: integer
centerFrequency:
type: integer
format: int64

Wyświetl plik

@ -3098,6 +3098,9 @@ margin-bottom: 20px;
"type" : "integer",
"description" : "AGC active (1 for yes, 0 for no)"
},
"dcBlock" : {
"type" : "integer"
},
"centerFrequency" : {
"type" : "integer",
"format" : "int64"
@ -25151,7 +25154,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2019-06-09T01:28:52.118+02:00
Generated 2019-06-09T20:39:26.572+02:00
</div>
</div>
</div>

Wyświetl plik

@ -32,6 +32,8 @@ SWGKiwiSDRSettings::SWGKiwiSDRSettings() {
m_gain_isSet = false;
use_agc = 0;
m_use_agc_isSet = false;
dc_block = 0;
m_dc_block_isSet = false;
center_frequency = 0L;
m_center_frequency_isSet = false;
server_address = nullptr;
@ -58,6 +60,8 @@ SWGKiwiSDRSettings::init() {
m_gain_isSet = false;
use_agc = 0;
m_use_agc_isSet = false;
dc_block = 0;
m_dc_block_isSet = false;
center_frequency = 0L;
m_center_frequency_isSet = false;
server_address = new QString("");
@ -79,6 +83,7 @@ SWGKiwiSDRSettings::cleanup() {
if(server_address != nullptr) {
delete server_address;
}
@ -108,6 +113,8 @@ SWGKiwiSDRSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&use_agc, pJson["useAGC"], "qint32", "");
::SWGSDRangel::setValue(&dc_block, pJson["dcBlock"], "qint32", "");
::SWGSDRangel::setValue(&center_frequency, pJson["centerFrequency"], "qint64", "");
::SWGSDRangel::setValue(&server_address, pJson["serverAddress"], "QString", "QString");
@ -144,6 +151,9 @@ SWGKiwiSDRSettings::asJsonObject() {
if(m_use_agc_isSet){
obj->insert("useAGC", QJsonValue(use_agc));
}
if(m_dc_block_isSet){
obj->insert("dcBlock", QJsonValue(dc_block));
}
if(m_center_frequency_isSet){
obj->insert("centerFrequency", QJsonValue(center_frequency));
}
@ -189,6 +199,16 @@ SWGKiwiSDRSettings::setUseAgc(qint32 use_agc) {
this->m_use_agc_isSet = true;
}
qint32
SWGKiwiSDRSettings::getDcBlock() {
return dc_block;
}
void
SWGKiwiSDRSettings::setDcBlock(qint32 dc_block) {
this->dc_block = dc_block;
this->m_dc_block_isSet = true;
}
qint64
SWGKiwiSDRSettings::getCenterFrequency() {
return center_frequency;
@ -266,6 +286,7 @@ SWGKiwiSDRSettings::isSet(){
do{
if(m_gain_isSet){ isObjectUpdated = true; break;}
if(m_use_agc_isSet){ isObjectUpdated = true; break;}
if(m_dc_block_isSet){ isObjectUpdated = true; break;}
if(m_center_frequency_isSet){ isObjectUpdated = true; break;}
if(server_address != nullptr && *server_address != QString("")){ isObjectUpdated = true; break;}
if(file_record_name != nullptr && *file_record_name != QString("")){ isObjectUpdated = true; break;}

Wyświetl plik

@ -48,6 +48,9 @@ public:
qint32 getUseAgc();
void setUseAgc(qint32 use_agc);
qint32 getDcBlock();
void setDcBlock(qint32 dc_block);
qint64 getCenterFrequency();
void setCenterFrequency(qint64 center_frequency);
@ -79,6 +82,9 @@ private:
qint32 use_agc;
bool m_use_agc_isSet;
qint32 dc_block;
bool m_dc_block_isSet;
qint64 center_frequency;
bool m_center_frequency_isSet;