1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-07-31 21:12:28 -04:00

DSD demod: use ValueDialZ for channel delta frequency value dial

This commit is contained in:
f4exb 2017-05-17 23:22:17 +02:00
parent 83e44739b1
commit 048ef1bf67
3 changed files with 32 additions and 51 deletions

View File

@ -187,27 +187,9 @@ void DSDDemodGUI::viewChanged()
applySettings(); applySettings();
} }
void DSDDemodGUI::on_deltaMinus_toggled(bool minus) void DSDDemodGUI::on_deltaFrequency_changed(qint64 value)
{ {
int deltaFrequency = m_channelMarker.getCenterFrequency(); m_channelMarker.setCenterFrequency(-value);
bool minusDelta = (deltaFrequency < 0);
if (minus ^ minusDelta) // sign change
{
m_channelMarker.setCenterFrequency(-deltaFrequency);
}
}
void DSDDemodGUI::on_deltaFrequency_changed(quint64 value)
{
if (ui->deltaMinus->isChecked())
{
m_channelMarker.setCenterFrequency(-value);
}
else
{
m_channelMarker.setCenterFrequency(value);
}
} }
void DSDDemodGUI::on_rfBW_valueChanged(int value) void DSDDemodGUI::on_rfBW_valueChanged(int value)
@ -349,7 +331,9 @@ DSDDemodGUI::DSDDemodGUI(PluginAPI* pluginAPI, DeviceSourceAPI *deviceAPI, QWidg
ui->audioMute->setStyleSheet("QToolButton { background:rgb(79,79,79); }"); ui->audioMute->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
ui->deltaFrequencyLabel->setText(QString("%1f").arg(QChar(0x94, 0x03)));
ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold)); ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
ui->deltaFrequency->setValueRange(false, 7, -9999999, 9999999);
ui->channelPowerMeter->setColorTheme(LevelMeterSignalDB::ColorGreenAndBlue); ui->channelPowerMeter->setColorTheme(LevelMeterSignalDB::ColorGreenAndBlue);
m_channelizer = new DownChannelizer(m_dsdDemod); m_channelizer = new DownChannelizer(m_dsdDemod);
@ -410,8 +394,7 @@ void DSDDemodGUI::applySettings()
48000, 48000,
m_channelMarker.getCenterFrequency()); m_channelMarker.getCenterFrequency());
ui->deltaFrequency->setValue(abs(m_channelMarker.getCenterFrequency())); ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
ui->deltaMinus->setChecked(m_channelMarker.getCenterFrequency() < 0);
ui->rfBWText->setText(QString("%1k").arg(ui->rfBW->value() / 10.0, 0, 'f', 1)); ui->rfBWText->setText(QString("%1k").arg(ui->rfBW->value() / 10.0, 0, 'f', 1));
ui->demodGainText->setText(QString("%1").arg(ui->demodGain->value() / 100.0, 0, 'f', 2)); ui->demodGainText->setText(QString("%1").arg(ui->demodGain->value() / 100.0, 0, 'f', 2));
ui->fmDeviationText->setText(QString("%1k").arg(ui->fmDeviation->value() / 10.0, 0, 'f', 1)); ui->fmDeviationText->setText(QString("%1k").arg(ui->fmDeviation->value() / 10.0, 0, 'f', 1));

View File

@ -59,8 +59,7 @@ public:
private slots: private slots:
void viewChanged(); void viewChanged();
void formatStatusText(); void formatStatusText();
void on_deltaFrequency_changed(quint64 value); void on_deltaFrequency_changed(qint64 value);
void on_deltaMinus_toggled(bool minus);
void on_rfBW_valueChanged(int index); void on_rfBW_valueChanged(int index);
void on_demodGain_valueChanged(int value); void on_demodGain_valueChanged(int value);
void on_volume_valueChanged(int value); void on_volume_valueChanged(int value);

View File

@ -6,19 +6,19 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>647</width> <width>680</width>
<height>841</height> <height>841</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>640</width> <width>680</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
@ -36,19 +36,19 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>640</width> <width>678</width>
<height>171</height> <height>172</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Minimum"> <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>632</width> <width>678</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
@ -78,27 +78,24 @@
</property> </property>
<item> <item>
<layout class="QHBoxLayout" name="DeltaFrequencyLayout"> <layout class="QHBoxLayout" name="DeltaFrequencyLayout">
<property name="leftMargin">
<number>6</number>
</property>
<item> <item>
<widget class="QToolButton" name="deltaMinus"> <widget class="QLabel" name="deltaFrequencyLabel">
<property name="toolTip"> <property name="minimumSize">
<string>Frequency shift direction</string> <size>
<width>16</width>
<height>0</height>
</size>
</property> </property>
<property name="text"> <property name="text">
<string>...</string> <string>Df</string>
</property>
<property name="icon">
<iconset>
<selectedoff>:/plus.png</selectedoff>
<selectedon>:/minus.png</selectedon>
</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="ValueDial" name="deltaFrequency" native="true"> <widget class="ValueDialZ" name="deltaFrequency" native="true">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Maximum"> <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -126,6 +123,8 @@
<property name="toolTip"> <property name="toolTip">
<string>Demod shift frequency from center in Hz</string> <string>Demod shift frequency from center in Hz</string>
</property> </property>
<zorder>deltaFrequencyLabel</zorder>
<zorder>deltaFrequencyLabel</zorder>
</widget> </widget>
</item> </item>
<item> <item>
@ -972,12 +971,6 @@
<header>gui/rollupwidget.h</header> <header>gui/rollupwidget.h</header>
<container>1</container> <container>1</container>
</customwidget> </customwidget>
<customwidget>
<class>ValueDial</class>
<extends>QWidget</extends>
<header>gui/valuedial.h</header>
<container>1</container>
</customwidget>
<customwidget> <customwidget>
<class>ButtonSwitch</class> <class>ButtonSwitch</class>
<extends>QToolButton</extends> <extends>QToolButton</extends>
@ -1001,6 +994,12 @@
<header>gui/glscopegui.h</header> <header>gui/glscopegui.h</header>
<container>1</container> <container>1</container>
</customwidget> </customwidget>
<customwidget>
<class>ValueDialZ</class>
<extends>QWidget</extends>
<header>gui/valuedialz.h</header>
<container>1</container>
</customwidget>
</customwidgets> </customwidgets>
<resources> <resources>
<include location="../../../sdrbase/resources/res.qrc"/> <include location="../../../sdrbase/resources/res.qrc"/>