1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-09-27 15:26:33 -04:00

Fix unshift on space

This commit is contained in:
srcejon 2023-09-07 09:43:40 +01:00
parent 3f906baf1f
commit 150e107520
6 changed files with 24 additions and 7 deletions

View File

@ -307,12 +307,19 @@ void RttyDemodGUI::on_spaceHigh_clicked(bool checked)
m_settings.m_spaceHigh = checked;
if (checked) {
ui->spaceHigh->setText("M-S");
} else {
}
else {
ui->spaceHigh->setText("S-M");
}
applySettings();
}
void RttyDemodGUI::on_unshiftOnSpace_clicked(bool checked)
{
m_settings.m_unshiftOnSpace = checked;
applySettings();
}
void RttyDemodGUI::on_clearTable_clicked()
{
ui->text->clear();
@ -571,6 +578,7 @@ void RttyDemodGUI::displaySettings()
} else {
ui->spaceHigh->setText("S-M");
}
ui->unshiftOnSpace->setChecked(m_settings.m_unshiftOnSpace);
updateIndexLabel();
@ -657,6 +665,7 @@ void RttyDemodGUI::makeUIConnections()
QObject::connect(ui->atc, &QCheckBox::clicked, this, &RttyDemodGUI::on_atc_clicked);
QObject::connect(ui->endian, &QCheckBox::clicked, this, &RttyDemodGUI::on_endian_clicked);
QObject::connect(ui->spaceHigh, &QCheckBox::clicked, this, &RttyDemodGUI::on_spaceHigh_clicked);
QObject::connect(ui->unshiftOnSpace, &QCheckBox::clicked, this, &RttyDemodGUI::on_unshiftOnSpace_clicked);
QObject::connect(ui->clearTable, &QPushButton::clicked, this, &RttyDemodGUI::on_clearTable_clicked);
QObject::connect(ui->udpEnabled, &QCheckBox::clicked, this, &RttyDemodGUI::on_udpEnabled_clicked);
QObject::connect(ui->udpAddress, &QLineEdit::editingFinished, this, &RttyDemodGUI::on_udpAddress_editingFinished);

View File

@ -112,6 +112,7 @@ private slots:
void on_atc_clicked(bool checked);
void on_endian_clicked(bool checked);
void on_spaceHigh_clicked(bool checked);
void on_unshiftOnSpace_clicked(bool checked);
void on_clearTable_clicked();
void on_udpEnabled_clicked(bool checked);
void on_udpAddress_editingFinished();

View File

@ -42,6 +42,7 @@ void RttyDemodSettings::resetToDefaults()
m_udpPort = 9999;
m_characterSet = Baudot::ITA2;
m_suppressCRLF = false;
m_unshiftOnSpace = false;
m_filter = LOWPASS;
m_atc = true;
m_msbFirst = false;

View File

@ -264,6 +264,12 @@ void RttyModGUI::on_spaceHigh_clicked(bool checked)
applySettings();
}
void RttyModGUI::on_unshiftOnSpace_clicked(bool checked)
{
m_settings.m_unshiftOnSpace = checked;
applySettings();
}
void RttyModGUI::on_clearTransmittedText_clicked()
{
ui->transmittedText->clear();
@ -567,7 +573,6 @@ void RttyModGUI::displaySettings()
ui->baudRate->setCurrentIndex(ui->baudRate->findText(baudRate));
ui->frequencyShiftText->setText(formatFrequency(m_settings.m_frequencyShift));
ui->frequencyShift->setValue(m_settings.m_frequencyShift);
ui->frequencyShift->setValue(m_settings.m_frequencyShift);
ui->characterSet->setCurrentIndex((int)m_settings.m_characterSet);
ui->endian->setChecked(m_settings.m_msbFirst);
@ -582,12 +587,13 @@ void RttyModGUI::displaySettings()
} else {
ui->spaceHigh->setText("S-M");
}
ui->unshiftOnSpace->setChecked(m_settings.m_unshiftOnSpace);
ui->udpEnabled->setChecked(m_settings.m_udpEnabled);
ui->udpAddress->setText(m_settings.m_udpAddress);
ui->udpPort->setText(QString::number(m_settings.m_udpPort));
ui->gainText->setText(QString("%1").arg((double)m_settings.m_gain, 0, 'f', 1));
ui->gainText->setText(QString("%1dB").arg((double)m_settings.m_gain, 0, 'f', 1));
ui->gain->setValue(m_settings.m_gain);
ui->channelMute->setChecked(m_settings.m_channelMute);
@ -633,6 +639,7 @@ void RttyModGUI::makeUIConnections()
QObject::connect(ui->characterSet, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &RttyModGUI::on_characterSet_currentIndexChanged);
QObject::connect(ui->endian, &QCheckBox::clicked, this, &RttyModGUI::on_endian_clicked);
QObject::connect(ui->spaceHigh, &QCheckBox::clicked, this, &RttyModGUI::on_spaceHigh_clicked);
QObject::connect(ui->unshiftOnSpace, &QCheckBox::clicked, this, &RttyModGUI::on_unshiftOnSpace_clicked);
QObject::connect(ui->clearTransmittedText, &QToolButton::clicked, this, &RttyModGUI::on_clearTransmittedText_clicked);
QObject::connect(ui->gain, &QDial::valueChanged, this, &RttyModGUI::on_gain_valueChanged);
QObject::connect(ui->channelMute, &QToolButton::toggled, this, &RttyModGUI::on_channelMute_toggled);

View File

@ -77,7 +77,7 @@ private:
QString m_initialToolTip;
RttyMod* m_rttyMod;
MovingAverageUtil<double, double, 2> m_channelPowerDbAvg; // Less than other mods, as packets are short
MovingAverageUtil<double, double, 20> m_channelPowerDbAvg;
MessageQueue m_inputMessageQueue;
@ -110,6 +110,7 @@ private slots:
void on_characterSet_currentIndexChanged(int index);
void on_endian_clicked(bool checked);
void on_spaceHigh_clicked(bool checked);
void on_unshiftOnSpace_clicked(bool checked);
void on_clearTransmittedText_clicked();
void on_txButton_clicked();
void on_text_editingFinished();

View File

@ -44,9 +44,9 @@ void RttyModSettings::resetToDefaults()
m_repeatCount = 10;
m_lpfTaps = 301;
m_rfNoise = false;
m_writeToFile = false;
m_text = "CQ CQ CQ DE SDRangel CQ";
m_characterSet = Baudot::ITA2;
m_unshiftOnSpace = false;
m_msbFirst = false;
m_spaceHigh = false;
m_prefixCRLF = true;
@ -94,7 +94,6 @@ QByteArray RttyModSettings::serialize() const
s.writeS32(9, m_repeatCount);
s.writeS32(23, m_lpfTaps);
s.writeBool(25, m_rfNoise);
s.writeBool(26, m_writeToFile);
s.writeString(30, m_text);
s.writeS32(60, (int)m_characterSet);
@ -164,7 +163,6 @@ bool RttyModSettings::deserialize(const QByteArray& data)
d.readS32(9, &m_repeatCount, -1);
d.readS32(23, &m_lpfTaps, 301);
d.readBool(25, &m_rfNoise, false);
d.readBool(26, &m_writeToFile, false);
d.readString(30, &m_text, "CQ CQ CQ anyone using SDRangel");
d.readS32(60, (int*)&m_characterSet, (int)Baudot::ITA2);