1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-16 13:21:50 -05:00

ATV demod: use ValueDialZ for channel delta frequency value dial

This commit is contained in:
f4exb 2017-05-17 23:47:08 +02:00
parent a11d8617b5
commit 14b7cb093e
3 changed files with 20 additions and 42 deletions

View File

@ -295,8 +295,9 @@ ATVDemodGUI::ATVDemodGUI(PluginAPI* objPluginAPI, DeviceSourceAPI *objDeviceAPI,
ui->glScope->connectTimer(m_objPluginAPI->getMainWindow()->getMasterTimer());
connect(&m_objPluginAPI->getMainWindow()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); // 50 ms
ui->deltaFrequencyLabel->setText(QString("%1f").arg(QChar(0x94, 0x03)));
ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
ui->deltaFrequency->setValueRange(7, 0U, 9999999U);
ui->deltaFrequency->setValueRange(false, 7, -9999999, 9999999);
connect(m_objChannelizer, SIGNAL(inputSampleRateChanged()), this, SLOT(channelSampleRateChanged()));
@ -363,8 +364,7 @@ void ATVDemodGUI::applySettings()
{
if (m_blnDoApplySettings)
{
ui->deltaFrequency->setValue(abs(m_objChannelMarker.getCenterFrequency()));
ui->deltaFrequencyMinus->setChecked(m_objChannelMarker.getCenterFrequency() < 0);
ui->deltaFrequency->setValue(m_objChannelMarker.getCenterFrequency());
m_objChannelizer->configure(m_objChannelizer->getInputMessageQueue(),
m_objChannelizer->getInputSampleRate(), // always use maximum available bandwidth
@ -606,24 +606,9 @@ void ATVDemodGUI::on_decimatorEnable_toggled(bool checked)
applyRFSettings();
}
void ATVDemodGUI::on_deltaFrequency_changed(quint64 value)
void ATVDemodGUI::on_deltaFrequency_changed(qint64 value)
{
if (ui->deltaFrequencyMinus->isChecked()) {
m_objChannelMarker.setCenterFrequency(-value);
} else {
m_objChannelMarker.setCenterFrequency(value);
}
}
void ATVDemodGUI::on_deltaFrequencyMinus_toggled(bool minus)
{
int deltaFrequency = m_objChannelMarker.getCenterFrequency();
bool minusDelta = (deltaFrequency < 0);
if (minus ^ minusDelta) // sign change
{
m_objChannelMarker.setCenterFrequency(-deltaFrequency);
}
m_objChannelMarker.setCenterFrequency(value);
}
void ATVDemodGUI::on_bfo_valueChanged(int value)

View File

@ -81,8 +81,7 @@ private slots:
void on_rfOppBW_valueChanged(int value);
void on_rfFiltering_toggled(bool checked);
void on_decimatorEnable_toggled(bool checked);
void on_deltaFrequency_changed(quint64 value);
void on_deltaFrequencyMinus_toggled(bool minus);
void on_deltaFrequency_changed(qint64 value);
void on_bfo_valueChanged(int value);
void on_fmDeviation_valueChanged(int value);
void on_screenTabWidget_currentChanged(int index);

View File

@ -58,26 +58,20 @@
<item>
<layout class="QHBoxLayout" name="deltaFrequencyLayout">
<item>
<widget class="QToolButton" name="deltaFrequencyMinus">
<property name="toolTip">
<string>Channel center frequency shift direction</string>
<widget class="QLabel" name="deltaFrequencyLabel">
<property name="minimumSize">
<size>
<width>16</width>
<height>0</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset>
<selectedoff>:/plus.png</selectedoff>
<selectedon>:/minus.png</selectedon>
</iconset>
</property>
<property name="checkable">
<bool>true</bool>
<string>Df</string>
</property>
</widget>
</item>
<item>
<widget class="ValueDial" name="deltaFrequency" native="true">
<widget class="ValueDialZ" name="deltaFrequency" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
<horstretch>0</horstretch>
@ -1117,12 +1111,6 @@
<header>gui/rollupwidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ValueDial</class>
<extends>QWidget</extends>
<header>gui/valuedial.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ButtonSwitch</class>
<extends>QToolButton</extends>
@ -1146,6 +1134,12 @@
<header>gui/glscopenggui.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ValueDialZ</class>
<extends>QWidget</extends>
<header>gui/valuedialz.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
<include location="../../../sdrbase/resources/res.qrc"/>