Make submode switching more robust, and fix a long-standing bug where the Tx audio frequency spin box remained red when coming from some Q65 submodes.

This commit is contained in:
Uwe Risse 2022-07-07 18:11:29 +02:00
parent 1f575bbe67
commit f84ba8a0d0

View File

@ -6480,7 +6480,7 @@ void MainWindow::displayWidgets(qint64 n)
void MainWindow::on_actionFST4_triggered() void MainWindow::on_actionFST4_triggered()
{ {
m_mode="FST4"; QTimer::singleShot (50, [=] {on_sbSubmode_valueChanged(ui->sbSubmode->value());});
m_mode="FST4"; m_mode="FST4";
ui->actionFST4->setChecked(true); ui->actionFST4->setChecked(true);
m_bFast9=false; m_bFast9=false;
@ -6553,6 +6553,7 @@ void MainWindow::on_actionFST4W_triggered()
void MainWindow::on_actionFT4_triggered() void MainWindow::on_actionFT4_triggered()
{ {
QTimer::singleShot (50, [=] {on_sbSubmode_valueChanged(ui->sbSubmode->value());});
m_mode="FT4"; m_mode="FT4";
m_TRperiod=7.5; m_TRperiod=7.5;
bool bVHF=m_config.enable_VHF_features(); bool bVHF=m_config.enable_VHF_features();
@ -6596,6 +6597,7 @@ void MainWindow::on_actionFT4_triggered()
void MainWindow::on_actionFT8_triggered() void MainWindow::on_actionFT8_triggered()
{ {
QTimer::singleShot (50, [=] {on_sbSubmode_valueChanged(ui->sbSubmode->value());});
m_mode="FT8"; m_mode="FT8";
bool bVHF=m_config.enable_VHF_features(); bool bVHF=m_config.enable_VHF_features();
m_bFast9=false; m_bFast9=false;
@ -6736,8 +6738,9 @@ void MainWindow::on_actionJT4_triggered()
ui->rh_decodes_headings_label->setText("UTC dB DT Freq " + tr ("Message")); ui->rh_decodes_headings_label->setText("UTC dB DT Freq " + tr ("Message"));
if(bVHF) { if(bVHF) {
// ui->sbSubmode->setValue(m_nSubMode); // ui->sbSubmode->setValue(m_nSubMode);
m_nSubMode=m_settings->value("SubMode_JT4",0).toInt(); QTimer::singleShot (50, [=] {m_nSubMode=m_settings->value("SubMode_JT4",0).toInt();});
QTimer::singleShot (50, [=] {ui->sbSubmode->setValue(m_settings->value("SubMode_JT4",0).toInt());}); QTimer::singleShot (75, [=] {ui->sbSubmode->setValue(m_settings->value("SubMode_JT4",0).toInt());});
QTimer::singleShot (100, [=] {on_sbSubmode_valueChanged(m_nSubMode);});
} else { } else {
ui->sbSubmode->setValue(0); ui->sbSubmode->setValue(0);
} }
@ -6753,6 +6756,7 @@ void MainWindow::on_actionJT4_triggered()
void MainWindow::on_actionJT9_triggered() void MainWindow::on_actionJT9_triggered()
{ {
QTimer::singleShot (50, [=] {on_sbSubmode_valueChanged(ui->sbSubmode->value());});
m_mode="JT9"; m_mode="JT9";
bool bVHF=m_config.enable_VHF_features(); bool bVHF=m_config.enable_VHF_features();
m_bFast9=ui->cbFast9->isChecked(); m_bFast9=ui->cbFast9->isChecked();
@ -6839,8 +6843,9 @@ void MainWindow::on_actionJT65_triggered()
ui->sbSubmode->setMaximum(2); ui->sbSubmode->setMaximum(2);
if(bVHF) { if(bVHF) {
// ui->sbSubmode->setValue(m_nSubMode); // ui->sbSubmode->setValue(m_nSubMode);
m_nSubMode=m_settings->value("SubMode_JT65",0).toInt(); QTimer::singleShot (50, [=] {m_nSubMode=m_settings->value("SubMode_JT65",0).toInt();});
QTimer::singleShot (50, [=] {ui->sbSubmode->setValue(m_settings->value("SubMode_JT65",0).toInt());}); QTimer::singleShot (75, [=] {ui->sbSubmode->setValue(m_settings->value("SubMode_JT65",0).toInt());});
QTimer::singleShot (100, [=] {on_sbSubmode_valueChanged(m_nSubMode);});
ui->lh_decodes_title_label->setText(tr ("Single-Period Decodes")); ui->lh_decodes_title_label->setText(tr ("Single-Period Decodes"));
ui->rh_decodes_title_label->setText(tr ("Average Decodes")); ui->rh_decodes_title_label->setText(tr ("Average Decodes"));
} else { } else {
@ -6879,8 +6884,9 @@ void MainWindow::on_actionQ65_triggered()
ui->sbTR->setValue (m_settings->value ("TRPeriod_Q65", 30).toInt()); // remember sbTR settings by mode ui->sbTR->setValue (m_settings->value ("TRPeriod_Q65", 30).toInt()); // remember sbTR settings by mode
QTimer::singleShot (50, [=] {on_sbTR_valueChanged (ui->sbTR->value());}); QTimer::singleShot (50, [=] {on_sbTR_valueChanged (ui->sbTR->value());});
// ui->sbSubmode->setValue(m_nSubMode); // ui->sbSubmode->setValue(m_nSubMode);
m_nSubMode=m_settings->value("SubMode_Q65",0).toInt(); QTimer::singleShot (50, [=] {m_nSubMode=m_settings->value("SubMode_Q65",0).toInt();});
QTimer::singleShot (50, [=] {ui->sbSubmode->setValue(m_settings->value("SubMode_Q65",0).toInt());}); QTimer::singleShot (75, [=] {ui->sbSubmode->setValue(m_settings->value("SubMode_Q65",0).toInt());});
QTimer::singleShot (100, [=] {on_sbSubmode_valueChanged(m_nSubMode);});
QString fname {QDir::toNativeSeparators(m_config.temp_dir().absoluteFilePath ("red.dat"))}; QString fname {QDir::toNativeSeparators(m_config.temp_dir().absoluteFilePath ("red.dat"))};
m_wideGraph->setRedFile(fname); m_wideGraph->setRedFile(fname);
m_wideGraph->setMode(m_mode); m_wideGraph->setMode(m_mode);
@ -6951,7 +6957,10 @@ void MainWindow::on_actionMSK144_triggered()
m_bFast9=false; m_bFast9=false;
ui->sbTR->values ({5, 10, 15, 30}); ui->sbTR->values ({5, 10, 15, 30});
ui->sbTR->setValue (m_settings->value ("TRPeriod_MSK144", 15).toInt()); // remember sbTR settings by mode ui->sbTR->setValue (m_settings->value ("TRPeriod_MSK144", 15).toInt()); // remember sbTR settings by mode
QTimer::singleShot (50, [=] {on_sbTR_valueChanged (ui->sbTR->value());}); QTimer::singleShot (50, [=] {
on_sbTR_valueChanged (ui->sbTR->value());
on_sbSubmode_valueChanged(ui->sbSubmode->value());
});
m_wideGraph->hide(); m_wideGraph->hide();
m_fastGraph->showNormal(); m_fastGraph->showNormal();
ui->TxFreqSpinBox->setValue(1500); ui->TxFreqSpinBox->setValue(1500);
@ -8134,6 +8143,7 @@ void MainWindow::on_sbSubmode_valueChanged(int n)
if(m_bFast9) ui->TxFreqSpinBox->setValue(700); if(m_bFast9) ui->TxFreqSpinBox->setValue(700);
} }
if(m_transmitting and m_bFast9 and m_nSubMode>=4) transmit (99.0); if(m_transmitting and m_bFast9 and m_nSubMode>=4) transmit (99.0);
if (m_mode !="Q65") ui->TxFreqSpinBox->setStyleSheet("");
if (m_mode=="Q65") {QTimer::singleShot (200, [=] {m_settings->setValue("SubMode_Q65",ui->sbSubmode->value());});} if (m_mode=="Q65") {QTimer::singleShot (200, [=] {m_settings->setValue("SubMode_Q65",ui->sbSubmode->value());});}
if (m_mode=="JT65") {QTimer::singleShot (200, [=] {m_settings->setValue("SubMode_JT65",ui->sbSubmode->value());});} if (m_mode=="JT65") {QTimer::singleShot (200, [=] {m_settings->setValue("SubMode_JT65",ui->sbSubmode->value());});}
if (m_mode=="JT4") {QTimer::singleShot (200, [=] {m_settings->setValue("SubMode_JT4",ui->sbSubmode->value());});} if (m_mode=="JT4") {QTimer::singleShot (200, [=] {m_settings->setValue("SubMode_JT4",ui->sbSubmode->value());});}