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->deltaFrequency->setValue(0);
ui->modulation->setCurrentIndex(0);
ui->vestigial->setValue(10);
blockApplySettings(false);
applySettings();
@ -92,7 +91,7 @@ QByteArray ATVModGUI::serialize() const
s.writeS32(4, ui->standard->currentIndex());
s.writeS32(5, ui->inputSelect->currentIndex());
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());
return s.final();
@ -134,7 +133,7 @@ bool ATVModGUI::deserialize(const QByteArray& data)
}
d.readS32(7, &tmp, 10);
ui->vestigial->setValue(tmp);
ui->rfOppBW->setValue(tmp);
d.readS32(8, &tmp, 0);
ui->modulation->setCurrentIndex(tmp);
@ -211,10 +210,12 @@ void ATVModGUI::channelizerOutputSampleRateChanged()
(ui->modulation->currentIndex() == (int) ATVMod::ATVModulationVestigialUSB))
{
ui->rfBW->setMaximum(m_channelizer->getOutputSampleRate() / 200000);
ui->rfOppBW->setMaximum(m_channelizer->getOutputSampleRate() / 200000);
}
else
{
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)
{
if ((index == (int) ATVMod::ATVModulationLSB) ||
(index == (int) ATVMod::ATVModulationVestigialLSB))
if (index == (int) ATVMod::ATVModulationLSB)
{
ui->rfBW->setMaximum(m_channelizer->getOutputSampleRate() / 200000);
ui->rfOppBW->setMaximum(m_channelizer->getOutputSampleRate() / 200000);
m_channelMarker.setBandwidth(-ui->rfBW->value()*200000);
m_channelMarker.setSidebands(ChannelMarker::lsb);
}
else if ((index == (int) ATVMod::ATVModulationUSB) ||
(index == (int) ATVMod::ATVModulationVestigialUSB))
else if (index == (int) ATVMod::ATVModulationVestigialLSB)
{
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.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
{
ui->rfBW->setMaximum(m_channelizer->getOutputSampleRate() / 100000);
ui->rfOppBW->setMaximum(m_channelizer->getOutputSampleRate() / 100000);
m_channelMarker.setBandwidth(ui->rfBW->value()*100000);
m_channelMarker.setSidebands(ChannelMarker::dsb);
}
@ -277,12 +293,6 @@ void ATVModGUI::on_modulation_currentIndexChanged(int index)
applySettings();
}
void ATVModGUI::on_vestigial_valueChanged(int value)
{
ui->vestigialText->setText(QString("%1").arg(value));
applySettings();
}
void ATVModGUI::on_rfBW_valueChanged(int value)
{
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();
}
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)
{
applySettings();
@ -512,7 +542,7 @@ void ATVModGUI::applySettings()
m_atvMod->configure(m_atvMod->getInputMessageQueue(),
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::ATVModInput) ui->inputSelect->currentIndex(),
ui->uniformLevel->value() / 100.0f,

View File

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

View File

@ -234,22 +234,32 @@
</widget>
</item>
<item>
<widget class="QLabel" name="vestiigialLabel">
<widget class="QLabel" name="rfBWLabel">
<property name="text">
<string>V</string>
<string>BW</string>
</property>
</widget>
</item>
<item>
<widget class="QDial" name="vestigial">
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
</size>
<widget class="QLabel" name="rfOppBWText">
<property name="text">
<string>1.0</string>
</property>
</widget>
</item>
<item>
<widget class="QSlider" name="rfOppBW">
<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 name="pageStep">
<number>1</number>
@ -257,26 +267,8 @@
<property name="value">
<number>10</number>
</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">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="rfBWLabel">
<property name="text">
<string>BW</string>
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>