summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHoernchen <la@tfc-server.de>2014-11-07 19:55:56 +0100
committerHoernchen <la@tfc-server.de>2014-11-07 19:55:56 +0100
commit7117971eede2fa3755b750f68d2d4cc4fd8da933 (patch)
treea53e1e21dfa88cefb94c94b7fea98ea0652920fd
parentf43c4f6ea2fb40cec5d27c3d390707144b7fc606 (diff)
direct sampling supportdirect_sampling
-rw-r--r--plugins/samplesource/rtlsdr/rtlsdrgui.cpp31
-rw-r--r--plugins/samplesource/rtlsdr/rtlsdrgui.h3
-rw-r--r--plugins/samplesource/rtlsdr/rtlsdrgui.ui59
-rw-r--r--plugins/samplesource/rtlsdr/rtlsdrinput.cpp5
-rw-r--r--plugins/samplesource/rtlsdr/rtlsdrinput.h3
5 files changed, 100 insertions, 1 deletions
diff --git a/plugins/samplesource/rtlsdr/rtlsdrgui.cpp b/plugins/samplesource/rtlsdr/rtlsdrgui.cpp
index 5706565..269fe1f 100644
--- a/plugins/samplesource/rtlsdr/rtlsdrgui.cpp
+++ b/plugins/samplesource/rtlsdr/rtlsdrgui.cpp
@@ -152,3 +152,34 @@ void RTLSDRGui::updateHardware()
message->submit(m_pluginAPI->getDSPEngineMessageQueue());
m_updateTimer.stop();
}
+
+void RTLSDRGui::on_checkBox_stateChanged(int state) {
+ if (state == Qt::Checked){
+ ((RTLSDRInput*)m_sampleSource)->set_ds_mode((ui->radioButton->isChecked()) ? true : false);
+ ui->radioButton->setEnabled(true);
+ ui->radioButton_2->setEnabled(true);
+ ui->gain->setEnabled(false);
+ //ui->decimation->setMaximum(6);
+
+ ui->centerFrequency->setValueRange(5, 0U, 30000U);
+ ui->centerFrequency->setValue(0);
+ }
+ else {
+ ((RTLSDRInput*)m_sampleSource)->set_ds_mode(0);
+ ui->radioButton->setEnabled(false);
+ ui->radioButton_2->setEnabled(false);
+ ui->gain->setEnabled(true);
+ //ui->decimation->setMaximum(4);
+
+ ui->centerFrequency->setValueRange(7, 20000U, 2200000U);
+ }
+}
+
+void RTLSDRGui::on_radioButton_toggled(bool checked){
+ if (checked)
+ ((RTLSDRInput*)m_sampleSource)->set_ds_mode(1);
+}
+void RTLSDRGui::on_radioButton_2_toggled(bool checked){
+ if (checked)
+ ((RTLSDRInput*)m_sampleSource)->set_ds_mode(2);
+} \ No newline at end of file
diff --git a/plugins/samplesource/rtlsdr/rtlsdrgui.h b/plugins/samplesource/rtlsdr/rtlsdrgui.h
index 46b248b..1c7c269 100644
--- a/plugins/samplesource/rtlsdr/rtlsdrgui.h
+++ b/plugins/samplesource/rtlsdr/rtlsdrgui.h
@@ -46,6 +46,9 @@ private slots:
void on_centerFrequency_changed(quint64 value);
void on_gain_valueChanged(int value);
void on_decimation_valueChanged(int value);
+ void on_checkBox_stateChanged(int state);
+ void on_radioButton_toggled(bool checked);
+ void on_radioButton_2_toggled(bool checked);
void updateHardware();
};
diff --git a/plugins/samplesource/rtlsdr/rtlsdrgui.ui b/plugins/samplesource/rtlsdr/rtlsdrgui.ui
index ce2ea4c..9a09002 100644
--- a/plugins/samplesource/rtlsdr/rtlsdrgui.ui
+++ b/plugins/samplesource/rtlsdr/rtlsdrgui.ui
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>132</width>
- <height>82</height>
+ <height>119</height>
</rect>
</property>
<property name="sizePolicy">
@@ -214,6 +214,63 @@
</item>
</layout>
</item>
+ <item>
+ <widget class="Line" name="line">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QCheckBox" name="checkBox">
+ <property name="text">
+ <string>ds</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="radioButton">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>i</string>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="radioButton_2">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>q</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_3">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
</layout>
</widget>
<customwidgets>
diff --git a/plugins/samplesource/rtlsdr/rtlsdrinput.cpp b/plugins/samplesource/rtlsdr/rtlsdrinput.cpp
index a5d1d95..e9258c4 100644
--- a/plugins/samplesource/rtlsdr/rtlsdrinput.cpp
+++ b/plugins/samplesource/rtlsdr/rtlsdrinput.cpp
@@ -228,3 +228,8 @@ bool RTLSDRInput::applySettings(const GeneralSettings& generalSettings, const Se
}
return true;
}
+
+
+void RTLSDRInput::set_ds_mode(int on){
+ rtlsdr_set_direct_sampling(m_dev, on);
+} \ No newline at end of file
diff --git a/plugins/samplesource/rtlsdr/rtlsdrinput.h b/plugins/samplesource/rtlsdr/rtlsdrinput.h
index ec9f804..35592b2 100644
--- a/plugins/samplesource/rtlsdr/rtlsdrinput.h
+++ b/plugins/samplesource/rtlsdr/rtlsdrinput.h
@@ -91,6 +91,9 @@ public:
bool handleMessage(Message* message);
+
+ void set_ds_mode(int on);
+
private:
QMutex m_mutex;
Settings m_settings;