1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-09-27 07:16:48 -04:00

ATV Modulator: UI: reverse opposite sideband slider

This commit is contained in:
f4exb 2017-03-16 10:44:31 +01:00
parent b079fae843
commit 1e46578aad
3 changed files with 65 additions and 43 deletions

View File

@ -76,7 +76,6 @@ void ATVModGUI::resetToDefaults()
ui->inputSelect->setCurrentIndex(0); ui->inputSelect->setCurrentIndex(0);
ui->deltaFrequency->setValue(0); ui->deltaFrequency->setValue(0);
ui->modulation->setCurrentIndex(0); ui->modulation->setCurrentIndex(0);
ui->vestigial->setValue(10);
blockApplySettings(false); blockApplySettings(false);
applySettings(); applySettings();
@ -92,7 +91,7 @@ QByteArray ATVModGUI::serialize() const
s.writeS32(4, ui->standard->currentIndex()); s.writeS32(4, ui->standard->currentIndex());
s.writeS32(5, ui->inputSelect->currentIndex()); s.writeS32(5, ui->inputSelect->currentIndex());
s.writeU32(6, m_channelMarker.getColor().rgb()); s.writeU32(6, m_channelMarker.getColor().rgb());
s.writeS32(7, ui->vestigial->value()); s.writeS32(7, ui->rfOppBW->value());
s.writeS32(8, ui->modulation->currentIndex()); s.writeS32(8, ui->modulation->currentIndex());
return s.final(); return s.final();
@ -134,7 +133,7 @@ bool ATVModGUI::deserialize(const QByteArray& data)
} }
d.readS32(7, &tmp, 10); d.readS32(7, &tmp, 10);
ui->vestigial->setValue(tmp); ui->rfOppBW->setValue(tmp);
d.readS32(8, &tmp, 0); d.readS32(8, &tmp, 0);
ui->modulation->setCurrentIndex(tmp); ui->modulation->setCurrentIndex(tmp);
@ -211,10 +210,12 @@ void ATVModGUI::channelizerOutputSampleRateChanged()
(ui->modulation->currentIndex() == (int) ATVMod::ATVModulationVestigialUSB)) (ui->modulation->currentIndex() == (int) ATVMod::ATVModulationVestigialUSB))
{ {
ui->rfBW->setMaximum(m_channelizer->getOutputSampleRate() / 200000); ui->rfBW->setMaximum(m_channelizer->getOutputSampleRate() / 200000);
ui->rfOppBW->setMaximum(m_channelizer->getOutputSampleRate() / 200000);
} }
else else
{ {
ui->rfBW->setMaximum(m_channelizer->getOutputSampleRate() / 100000); ui->rfBW->setMaximum(m_channelizer->getOutputSampleRate() / 100000);
ui->rfOppBW->setMaximum(m_channelizer->getOutputSampleRate() / 100000);
} }
} }
@ -253,23 +254,38 @@ void ATVModGUI::on_deltaFrequency_changed(quint64 value)
void ATVModGUI::on_modulation_currentIndexChanged(int index) void ATVModGUI::on_modulation_currentIndexChanged(int index)
{ {
if ((index == (int) ATVMod::ATVModulationLSB) || if (index == (int) ATVMod::ATVModulationLSB)
(index == (int) ATVMod::ATVModulationVestigialLSB))
{ {
ui->rfBW->setMaximum(m_channelizer->getOutputSampleRate() / 200000); ui->rfBW->setMaximum(m_channelizer->getOutputSampleRate() / 200000);
ui->rfOppBW->setMaximum(m_channelizer->getOutputSampleRate() / 200000);
m_channelMarker.setBandwidth(-ui->rfBW->value()*200000); m_channelMarker.setBandwidth(-ui->rfBW->value()*200000);
m_channelMarker.setSidebands(ChannelMarker::lsb); m_channelMarker.setSidebands(ChannelMarker::lsb);
} }
else if ((index == (int) ATVMod::ATVModulationUSB) || else if (index == (int) ATVMod::ATVModulationVestigialLSB)
(index == (int) ATVMod::ATVModulationVestigialUSB))
{ {
ui->rfBW->setMaximum(m_channelizer->getOutputSampleRate() / 200000); ui->rfBW->setMaximum(m_channelizer->getOutputSampleRate() / 200000);
ui->rfOppBW->setMaximum(m_channelizer->getOutputSampleRate() / 200000);
m_channelMarker.setBandwidth(ui->rfBW->value()*200000); // TODO: consider asymmetrical sidebands
m_channelMarker.setSidebands(ChannelMarker::usb);
}
else if (index == (int) ATVMod::ATVModulationUSB)
{
ui->rfBW->setMaximum(m_channelizer->getOutputSampleRate() / 200000);
ui->rfOppBW->setMaximum(m_channelizer->getOutputSampleRate() / 200000);
m_channelMarker.setBandwidth(ui->rfBW->value()*200000); m_channelMarker.setBandwidth(ui->rfBW->value()*200000);
m_channelMarker.setSidebands(ChannelMarker::usb); m_channelMarker.setSidebands(ChannelMarker::usb);
} }
else if (index == (int) ATVMod::ATVModulationVestigialUSB)
{
ui->rfBW->setMaximum(m_channelizer->getOutputSampleRate() / 200000);
ui->rfOppBW->setMaximum(m_channelizer->getOutputSampleRate() / 200000);
m_channelMarker.setBandwidth(ui->rfBW->value()*200000); // TODO: consider asymmetrical sidebands
m_channelMarker.setSidebands(ChannelMarker::usb);
}
else else
{ {
ui->rfBW->setMaximum(m_channelizer->getOutputSampleRate() / 100000); ui->rfBW->setMaximum(m_channelizer->getOutputSampleRate() / 100000);
ui->rfOppBW->setMaximum(m_channelizer->getOutputSampleRate() / 100000);
m_channelMarker.setBandwidth(ui->rfBW->value()*100000); m_channelMarker.setBandwidth(ui->rfBW->value()*100000);
m_channelMarker.setSidebands(ChannelMarker::dsb); m_channelMarker.setSidebands(ChannelMarker::dsb);
} }
@ -277,12 +293,6 @@ void ATVModGUI::on_modulation_currentIndexChanged(int index)
applySettings(); applySettings();
} }
void ATVModGUI::on_vestigial_valueChanged(int value)
{
ui->vestigialText->setText(QString("%1").arg(value));
applySettings();
}
void ATVModGUI::on_rfBW_valueChanged(int value) void ATVModGUI::on_rfBW_valueChanged(int value)
{ {
ui->rfBWText->setText(QString("%1 MHz").arg(value / 10.0, 0, 'f', 1)); ui->rfBWText->setText(QString("%1 MHz").arg(value / 10.0, 0, 'f', 1));
@ -305,6 +315,26 @@ void ATVModGUI::on_rfBW_valueChanged(int value)
applySettings(); applySettings();
} }
void ATVModGUI::on_rfOppBW_valueChanged(int value)
{
ui->rfOppBWText->setText(QString("%1").arg(value / 10.0, 0, 'f', 1));
if (ui->modulation->currentIndex() == (int) ATVMod::ATVModulationVestigialLSB)
{
m_channelMarker.setBandwidth(-ui->rfBW->value()*200000); // TODO
}
else if (ui->modulation->currentIndex() == (int) ATVMod::ATVModulationVestigialUSB)
{
m_channelMarker.setBandwidth(ui->rfBW->value()*200000); // TODO
}
else
{
m_channelMarker.setBandwidth(ui->rfBW->value()*100000);
}
applySettings();
}
void ATVModGUI::on_standard_currentIndexChanged(int index) void ATVModGUI::on_standard_currentIndexChanged(int index)
{ {
applySettings(); applySettings();
@ -512,7 +542,7 @@ void ATVModGUI::applySettings()
m_atvMod->configure(m_atvMod->getInputMessageQueue(), m_atvMod->configure(m_atvMod->getInputMessageQueue(),
ui->rfBW->value() * 100000.0f, ui->rfBW->value() * 100000.0f,
(ui->vestigial->value() / 100.0f) * ui->rfBW->value() * 100000.0f, ui->rfOppBW->value() * 100000.0f,
(ATVMod::ATVStd) ui->standard->currentIndex(), (ATVMod::ATVStd) ui->standard->currentIndex(),
(ATVMod::ATVModInput) ui->inputSelect->currentIndex(), (ATVMod::ATVModInput) ui->inputSelect->currentIndex(),
ui->uniformLevel->value() / 100.0f, ui->uniformLevel->value() / 100.0f,

View File

@ -64,8 +64,8 @@ private slots:
void on_deltaMinus_toggled(bool minus); void on_deltaMinus_toggled(bool minus);
void on_channelMute_toggled(bool checked); void on_channelMute_toggled(bool checked);
void on_modulation_currentIndexChanged(int index); void on_modulation_currentIndexChanged(int index);
void on_vestigial_valueChanged(int value);
void on_rfBW_valueChanged(int value); void on_rfBW_valueChanged(int value);
void on_rfOppBW_valueChanged(int value);
void on_standard_currentIndexChanged(int index); void on_standard_currentIndexChanged(int index);
void on_uniformLevel_valueChanged(int value); void on_uniformLevel_valueChanged(int value);
void on_inputSelect_currentIndexChanged(int index); void on_inputSelect_currentIndexChanged(int index);

View File

@ -234,22 +234,32 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="vestiigialLabel"> <widget class="QLabel" name="rfBWLabel">
<property name="text"> <property name="text">
<string>V</string> <string>BW</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QDial" name="vestigial"> <widget class="QLabel" name="rfOppBWText">
<property name="maximumSize"> <property name="text">
<size> <string>1.0</string>
<width>24</width>
<height>24</height>
</size>
</property> </property>
</widget>
</item>
<item>
<widget class="QSlider" name="rfOppBW">
<property name="toolTip"> <property name="toolTip">
<string>Vestigial sideband percentage</string> <string>Opposite sideband (RF) bandwidth for vestigial SSB</string>
</property>
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>100</number>
</property> </property>
<property name="pageStep"> <property name="pageStep">
<number>1</number> <number>1</number>
@ -257,26 +267,8 @@
<property name="value"> <property name="value">
<number>10</number> <number>10</number>
</property> </property>
</widget>
</item>
<item>
<widget class="QLabel" name="vestigialText">
<property name="text">
<string>99</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_7">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="rfBWLabel">
<property name="text">
<string>BW</string>
</property> </property>
</widget> </widget>
</item> </item>