mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-05-23 18:02:29 -04:00
Repair a long-standing defect with 72-bit modes message generation
This defect caused source messages to be incorrectly generated when using a compound callsign. This repair also fixes some issues with Q65 mode related to source message generation.
This commit is contained in:
parent
588e862346
commit
37bbcbc7cf
@ -754,10 +754,6 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
|
|||||||
ui->bandComboBox->setModel (m_config.frequencies ());
|
ui->bandComboBox->setModel (m_config.frequencies ());
|
||||||
ui->bandComboBox->setModelColumn (FrequencyList_v2::frequency_mhz_column);
|
ui->bandComboBox->setModelColumn (FrequencyList_v2::frequency_mhz_column);
|
||||||
|
|
||||||
// combo box drop down width defaults to the line edit + decorator width,
|
|
||||||
// here we change that to the column width size hint of the model column
|
|
||||||
ui->bandComboBox->view ()->setMinimumWidth (ui->bandComboBox->view ()->sizeHintForColumn (FrequencyList_v2::frequency_mhz_column));
|
|
||||||
|
|
||||||
// Enable live band combo box entry validation and action.
|
// Enable live band combo box entry validation and action.
|
||||||
auto band_validator = new LiveFrequencyValidator {ui->bandComboBox
|
auto band_validator = new LiveFrequencyValidator {ui->bandComboBox
|
||||||
, m_config.bands ()
|
, m_config.bands ()
|
||||||
@ -5243,27 +5239,32 @@ void MainWindow::setTxMsg(int n)
|
|||||||
|
|
||||||
void MainWindow::genCQMsg ()
|
void MainWindow::genCQMsg ()
|
||||||
{
|
{
|
||||||
if(m_config.my_callsign().size () && m_config.my_grid().size ()) {
|
auto const& my_callsign = m_config.my_callsign ();
|
||||||
QString grid{m_config.my_grid()};
|
auto is_compound = my_callsign != m_baseCall;
|
||||||
|
auto is_type_two = !is77BitMode () && is_compound && stdCall (m_baseCall) && !shortList (my_callsign);
|
||||||
|
if(my_callsign.size () && m_config.my_grid().size ()) {
|
||||||
|
auto const& grid = m_config.my_grid ();
|
||||||
if (ui->cbCQTx->isEnabled () && ui->cbCQTx->isVisible () && ui->cbCQTx->isChecked ()) {
|
if (ui->cbCQTx->isEnabled () && ui->cbCQTx->isVisible () && ui->cbCQTx->isChecked ()) {
|
||||||
if(stdCall(m_config.my_callsign())) {
|
if(stdCall (my_callsign)
|
||||||
|
|| is_type_two) {
|
||||||
msgtype (QString {"CQ %1 %2 %3"}
|
msgtype (QString {"CQ %1 %2 %3"}
|
||||||
.arg (m_freqNominal / 1000 - m_freqNominal / 1000000 * 1000, 3, 10, QChar {'0'})
|
.arg (m_freqNominal / 1000 - m_freqNominal / 1000000 * 1000, 3, 10, QChar {'0'})
|
||||||
.arg (m_config.my_callsign())
|
.arg (my_callsign)
|
||||||
.arg (grid.left (4)),
|
.arg (grid.left (4)),
|
||||||
ui->tx6);
|
ui->tx6);
|
||||||
} else {
|
} else {
|
||||||
msgtype (QString {"CQ %1 %2"}
|
msgtype (QString {"CQ %1 %2"}
|
||||||
.arg (m_freqNominal / 1000 - m_freqNominal / 1000000 * 1000, 3, 10, QChar {'0'})
|
.arg (m_freqNominal / 1000 - m_freqNominal / 1000000 * 1000, 3, 10, QChar {'0'})
|
||||||
.arg (m_config.my_callsign()),
|
.arg (my_callsign),
|
||||||
ui->tx6);
|
ui->tx6);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(stdCall(m_config.my_callsign())) {
|
if (stdCall (my_callsign)
|
||||||
msgtype (QString {"%1 %2 %3"}.arg(m_CQtype).arg(m_config.my_callsign())
|
|| is_type_two) {
|
||||||
|
msgtype (QString {"%1 %2 %3"}.arg(m_CQtype).arg(my_callsign)
|
||||||
.arg(grid.left(4)),ui->tx6);
|
.arg(grid.left(4)),ui->tx6);
|
||||||
} else {
|
} else {
|
||||||
msgtype (QString {"%1 %2"}.arg(m_CQtype).arg(m_config.my_callsign()),ui->tx6);
|
msgtype (QString {"%1 %2"}.arg(m_CQtype).arg(my_callsign),ui->tx6);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((m_mode=="JT4" or m_mode=="Q65") and ui->cbShMsgs->isChecked()) {
|
if ((m_mode=="JT4" or m_mode=="Q65") and ui->cbShMsgs->isChecked()) {
|
||||||
@ -5278,15 +5279,15 @@ void MainWindow::genCQMsg ()
|
|||||||
QStringList tlist=t.split(" ");
|
QStringList tlist=t.split(" ");
|
||||||
if((m_mode=="FT4" or m_mode=="FT8" or m_mode=="MSK144") and
|
if((m_mode=="FT4" or m_mode=="FT8" or m_mode=="MSK144") and
|
||||||
SpecOp::NONE != m_config.special_op_id() and
|
SpecOp::NONE != m_config.special_op_id() and
|
||||||
( tlist.at(1)==m_config.my_callsign() or
|
( tlist.at(1)==my_callsign or
|
||||||
tlist.at(2)==m_config.my_callsign() ) and
|
tlist.at(2)==my_callsign ) and
|
||||||
stdCall(m_config.my_callsign())) {
|
stdCall(my_callsign)) {
|
||||||
if(SpecOp::NA_VHF == m_config.special_op_id()) m_cqStr="TEST";
|
if(SpecOp::NA_VHF == m_config.special_op_id()) m_cqStr="TEST";
|
||||||
if(SpecOp::EU_VHF == m_config.special_op_id()) m_cqStr="TEST";
|
if(SpecOp::EU_VHF == m_config.special_op_id()) m_cqStr="TEST";
|
||||||
if(SpecOp::FIELD_DAY == m_config.special_op_id()) m_cqStr="FD";
|
if(SpecOp::FIELD_DAY == m_config.special_op_id()) m_cqStr="FD";
|
||||||
if(SpecOp::RTTY == m_config.special_op_id()) m_cqStr="RU";
|
if(SpecOp::RTTY == m_config.special_op_id()) m_cqStr="RU";
|
||||||
if(SpecOp::WW_DIGI == m_config.special_op_id()) m_cqStr="WW";
|
if(SpecOp::WW_DIGI == m_config.special_op_id()) m_cqStr="WW";
|
||||||
if( tlist.at(1)==m_config.my_callsign() ) {
|
if( tlist.at(1)==my_callsign ) {
|
||||||
t="CQ " + m_cqStr + " " + tlist.at(1) + " " + tlist.at(2);
|
t="CQ " + m_cqStr + " " + tlist.at(1) + " " + tlist.at(2);
|
||||||
} else {
|
} else {
|
||||||
t="CQ " + m_cqStr + " " + tlist.at(2) + " " + tlist.at(3);
|
t="CQ " + m_cqStr + " " + tlist.at(2) + " " + tlist.at(3);
|
||||||
@ -5319,6 +5320,12 @@ bool MainWindow::stdCall(QString const& w)
|
|||||||
return standard_call_re.match (w).hasMatch ();
|
return standard_call_re.match (w).hasMatch ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool MainWindow::is77BitMode () const
|
||||||
|
{
|
||||||
|
return "FT8" == m_mode || "FT4" == m_mode || "MSK144" == m_mode
|
||||||
|
|| "FST4" == m_mode || "Q65" == m_mode;
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::genStdMsgs(QString rpt, bool unconditional)
|
void MainWindow::genStdMsgs(QString rpt, bool unconditional)
|
||||||
{
|
{
|
||||||
genCQMsg ();
|
genCQMsg ();
|
||||||
@ -5335,7 +5342,7 @@ void MainWindow::genStdMsgs(QString rpt, bool unconditional)
|
|||||||
}
|
}
|
||||||
auto const& my_callsign = m_config.my_callsign ();
|
auto const& my_callsign = m_config.my_callsign ();
|
||||||
auto is_compound = my_callsign != m_baseCall;
|
auto is_compound = my_callsign != m_baseCall;
|
||||||
auto is_type_one = is_compound && shortList (my_callsign);
|
auto is_type_one = !is77BitMode () && is_compound && shortList (my_callsign);
|
||||||
auto const& my_grid = m_config.my_grid ().left (4);
|
auto const& my_grid = m_config.my_grid ().left (4);
|
||||||
auto const& hisBase = Radio::base_callsign (hisCall);
|
auto const& hisBase = Radio::base_callsign (hisCall);
|
||||||
auto eme_short_codes = m_config.enable_VHF_features () && ui->cbShMsgs->isChecked ()
|
auto eme_short_codes = m_config.enable_VHF_features () && ui->cbShMsgs->isChecked ()
|
||||||
@ -5348,7 +5355,7 @@ void MainWindow::genStdMsgs(QString rpt, bool unconditional)
|
|||||||
QString t0s=hisCall + " " + my_callsign + " ";
|
QString t0s=hisCall + " " + my_callsign + " ";
|
||||||
QString t0a,t0b;
|
QString t0a,t0b;
|
||||||
|
|
||||||
if(bHisCall and bMyCall) t0=hisCall + " " + my_callsign + " ";
|
if (is77BitMode () && bHisCall && bMyCall) t0=hisCall + " " + my_callsign + " ";
|
||||||
t0a="<"+hisCall + "> " + my_callsign + " ";
|
t0a="<"+hisCall + "> " + my_callsign + " ";
|
||||||
t0b=hisCall + " <" + my_callsign + "> ";
|
t0b=hisCall + " <" + my_callsign + "> ";
|
||||||
|
|
||||||
@ -5366,7 +5373,7 @@ void MainWindow::genStdMsgs(QString rpt, bool unconditional)
|
|||||||
int n=rpt.toInt();
|
int n=rpt.toInt();
|
||||||
rpt = rpt.asprintf("%+2.2d",n);
|
rpt = rpt.asprintf("%+2.2d",n);
|
||||||
|
|
||||||
if(m_mode=="MSK144" or m_mode=="FT8" or m_mode=="FT4" || m_mode=="FST4") {
|
if (is77BitMode ()) {
|
||||||
QString t2,t3;
|
QString t2,t3;
|
||||||
QString sent=rpt;
|
QString sent=rpt;
|
||||||
QString rs,rst;
|
QString rs,rst;
|
||||||
@ -5430,8 +5437,8 @@ void MainWindow::genStdMsgs(QString rpt, bool unconditional)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if((m_mode!="MSK144" and m_mode!="FT8" and m_mode!="FT4" && m_mode != "FST4")) {
|
if (!is77BitMode ()) {
|
||||||
t=t00 + rpt;
|
t=(is_type_one ? t0 : t00) + rpt;
|
||||||
msgtype(t, ui->tx2);
|
msgtype(t, ui->tx2);
|
||||||
t=t0 + "R" + rpt;
|
t=t0 + "R" + rpt;
|
||||||
msgtype(t, ui->tx3);
|
msgtype(t, ui->tx3);
|
||||||
@ -5470,7 +5477,7 @@ void MainWindow::genStdMsgs(QString rpt, bool unconditional)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_mode=="FT8" or m_mode=="FT4" or m_mode=="MSK144" || m_mode == "FST4") return;
|
if (is77BitMode ()) return;
|
||||||
|
|
||||||
if (is_compound) {
|
if (is_compound) {
|
||||||
if (is_type_one) {
|
if (is_type_one) {
|
||||||
@ -5483,8 +5490,7 @@ void MainWindow::genStdMsgs(QString rpt, bool unconditional)
|
|||||||
case Configuration::type_2_msg_1_full:
|
case Configuration::type_2_msg_1_full:
|
||||||
msgtype(t + my_grid, ui->tx1);
|
msgtype(t + my_grid, ui->tx1);
|
||||||
if (!eme_short_codes) {
|
if (!eme_short_codes) {
|
||||||
if((m_mode=="MSK144" || m_mode=="FT8" || m_mode=="FT4" || m_mode == "FST4") &&
|
if(is77BitMode () && SpecOp::NA_VHF == m_config.special_op_id()) {
|
||||||
SpecOp::NA_VHF == m_config.special_op_id()) {
|
|
||||||
msgtype(t + "R " + my_grid, ui->tx3); // #### Unreachable code
|
msgtype(t + "R " + my_grid, ui->tx3); // #### Unreachable code
|
||||||
} else {
|
} else {
|
||||||
msgtype(t + "R" + rpt, ui->tx3);
|
msgtype(t + "R" + rpt, ui->tx3);
|
||||||
@ -5496,8 +5502,7 @@ void MainWindow::genStdMsgs(QString rpt, bool unconditional)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case Configuration::type_2_msg_3_full:
|
case Configuration::type_2_msg_3_full:
|
||||||
if ((m_mode=="MSK144" || m_mode=="FT8" || m_mode=="FT4" || m_mode == "FST4") &&
|
if (is77BitMode () && SpecOp::NA_VHF == m_config.special_op_id()) {
|
||||||
SpecOp::NA_VHF == m_config.special_op_id()) {
|
|
||||||
msgtype(t + "R " + my_grid, ui->tx3);
|
msgtype(t + "R " + my_grid, ui->tx3);
|
||||||
msgtype(t + "RRR", ui->tx4);
|
msgtype(t + "RRR", ui->tx4);
|
||||||
} else {
|
} else {
|
||||||
@ -5512,8 +5517,7 @@ void MainWindow::genStdMsgs(QString rpt, bool unconditional)
|
|||||||
case Configuration::type_2_msg_5_only:
|
case Configuration::type_2_msg_5_only:
|
||||||
msgtype(t00 + my_grid, ui->tx1);
|
msgtype(t00 + my_grid, ui->tx1);
|
||||||
if (!eme_short_codes) {
|
if (!eme_short_codes) {
|
||||||
if ((m_mode=="MSK144" || m_mode=="FT8" || m_mode=="FT4" || m_mode == "FST4") &&
|
if (is77BitMode () && SpecOp::NA_VHF == m_config.special_op_id()) {
|
||||||
SpecOp::NA_VHF == m_config.special_op_id()) {
|
|
||||||
msgtype(t + "R " + my_grid, ui->tx3); // #### Unreachable code
|
msgtype(t + "R " + my_grid, ui->tx3); // #### Unreachable code
|
||||||
msgtype(t + "RRR", ui->tx4);
|
msgtype(t + "RRR", ui->tx4);
|
||||||
} else {
|
} else {
|
||||||
@ -5548,7 +5552,7 @@ void MainWindow::genStdMsgs(QString rpt, bool unconditional)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_rpt=rpt;
|
m_rpt=rpt;
|
||||||
if(SpecOp::HOUND == m_config.special_op_id() and is_compound) ui->tx1->setText("DE " + m_config.my_callsign());
|
if(SpecOp::HOUND == m_config.special_op_id() and is_compound) ui->tx1->setText("DE " + my_callsign);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::TxAgain()
|
void MainWindow::TxAgain()
|
||||||
|
@ -778,6 +778,7 @@ private:
|
|||||||
void foxGenWaveform(int i,QString fm);
|
void foxGenWaveform(int i,QString fm);
|
||||||
void writeFoxQSO (QString const& msg);
|
void writeFoxQSO (QString const& msg);
|
||||||
void to_jt9(qint32 n, qint32 istart, qint32 idone);
|
void to_jt9(qint32 n, qint32 istart, qint32 idone);
|
||||||
|
bool is77BitMode () const;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern int killbyname(const char* progName);
|
extern int killbyname(const char* progName);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user