Added 73 action and more appropriate all call responses. Added better handling of end of transmissions.
This commit is contained in:
parent
7ecc550bc2
commit
052b81ec8f
@ -5458,8 +5458,6 @@ QPair<QStringList, QStringList> MainWindow::buildFT8MessageFrames(QString const&
|
|||||||
QString mycall = m_config.my_callsign();
|
QString mycall = m_config.my_callsign();
|
||||||
foreach(QString line, text.split(QRegExp("[\\r\\n]"), QString::SkipEmptyParts)){
|
foreach(QString line, text.split(QRegExp("[\\r\\n]"), QString::SkipEmptyParts)){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
while(line.size() > 0){
|
while(line.size() > 0){
|
||||||
QString frame;
|
QString frame;
|
||||||
|
|
||||||
@ -5513,7 +5511,7 @@ QPair<QStringList, QStringList> MainWindow::buildFT8MessageFrames(QString const&
|
|||||||
lines.append(QString("%1: ").arg(mycall));
|
lines.append(QString("%1: ").arg(mycall));
|
||||||
}
|
}
|
||||||
lines.append(line.left(n));
|
lines.append(line.left(n));
|
||||||
line = line.mid(n).trimmed();
|
line = line.mid(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(useDat){
|
if(useDat){
|
||||||
@ -6870,6 +6868,13 @@ void MainWindow::on_queryButton_pressed(){
|
|||||||
}
|
}
|
||||||
menu->clear();
|
menu->clear();
|
||||||
|
|
||||||
|
QString call = callsignSelected();
|
||||||
|
if(call.isEmpty()){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isAllCall = call == "ALLCALL";
|
||||||
|
|
||||||
auto snrAction = menu->addAction("? - What is my signal report?");
|
auto snrAction = menu->addAction("? - What is my signal report?");
|
||||||
|
|
||||||
// TODO: jsherer - this should be extracted
|
// TODO: jsherer - this should be extracted
|
||||||
@ -6884,6 +6889,7 @@ void MainWindow::on_queryButton_pressed(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
auto qthAction = menu->addAction("@ - What is your QTH?");
|
auto qthAction = menu->addAction("@ - What is your QTH?");
|
||||||
|
qthAction->setDisabled(isAllCall);
|
||||||
connect(qthAction, &QAction::triggered, this, [this](){
|
connect(qthAction, &QAction::triggered, this, [this](){
|
||||||
|
|
||||||
QString selectedCall = callsignSelected();
|
QString selectedCall = callsignSelected();
|
||||||
@ -6895,6 +6901,7 @@ void MainWindow::on_queryButton_pressed(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
auto stationAction = menu->addAction("&& - What is your station message?");
|
auto stationAction = menu->addAction("&& - What is your station message?");
|
||||||
|
stationAction->setDisabled(isAllCall);
|
||||||
connect(stationAction, &QAction::triggered, this, [this](){
|
connect(stationAction, &QAction::triggered, this, [this](){
|
||||||
|
|
||||||
QString selectedCall = callsignSelected();
|
QString selectedCall = callsignSelected();
|
||||||
@ -6905,12 +6912,22 @@ void MainWindow::on_queryButton_pressed(){
|
|||||||
addMessageText(QString("%1&").arg(selectedCall), true);
|
addMessageText(QString("%1&").arg(selectedCall), true);
|
||||||
});
|
});
|
||||||
|
|
||||||
menu->addAction("$ - What stations are you hearing?")->setEnabled(false);
|
//menu->addAction("$ - What stations are you hearing?")->setEnabled(false);
|
||||||
|
//menu->addAction("| - Please relay the following message")->setEnabled(false);
|
||||||
menu->addAction("| - Please relay the following message")->setEnabled(false);
|
|
||||||
|
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
|
|
||||||
|
auto agnAction = menu->addAction("AGN? - Please repeat your last transmission");
|
||||||
|
connect(agnAction, &QAction::triggered, this, [this](){
|
||||||
|
|
||||||
|
QString selectedCall = callsignSelected();
|
||||||
|
if(selectedCall.isEmpty()){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
addMessageText(QString("%1 AGN?").arg(selectedCall), true);
|
||||||
|
});
|
||||||
|
|
||||||
auto rrAction = menu->addAction("RR - I acknowledge your last transmission");
|
auto rrAction = menu->addAction("RR - I acknowledge your last transmission");
|
||||||
connect(rrAction, &QAction::triggered, this, [this](){
|
connect(rrAction, &QAction::triggered, this, [this](){
|
||||||
|
|
||||||
@ -6922,15 +6939,15 @@ void MainWindow::on_queryButton_pressed(){
|
|||||||
addMessageText(QString("%1 RR").arg(selectedCall), true);
|
addMessageText(QString("%1 RR").arg(selectedCall), true);
|
||||||
});
|
});
|
||||||
|
|
||||||
auto agnAction = menu->addAction("AGN? - Please repeat your last transmission");
|
auto sevenThreeAction = menu->addAction("73 - Best regards / end of contact");
|
||||||
connect(agnAction, &QAction::triggered, this, [this](){
|
connect(sevenThreeAction, &QAction::triggered, this, [this](){
|
||||||
|
|
||||||
QString selectedCall = callsignSelected();
|
QString selectedCall = callsignSelected();
|
||||||
if(selectedCall.isEmpty()){
|
if(selectedCall.isEmpty()){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
addMessageText(QString("%1 AGN?").arg(selectedCall), true);
|
addMessageText(QString("%1 73").arg(selectedCall), true);
|
||||||
});
|
});
|
||||||
|
|
||||||
ui->queryButton->setMenu(menu);
|
ui->queryButton->setMenu(menu);
|
||||||
@ -8148,7 +8165,9 @@ void MainWindow::displayActivity(bool force){
|
|||||||
RXDetail d = m_rxFrameQueue.first();
|
RXDetail d = m_rxFrameQueue.first();
|
||||||
m_rxFrameQueue.removeFirst();
|
m_rxFrameQueue.removeFirst();
|
||||||
|
|
||||||
if(d.bits == Varicode::FT8CallLast){
|
bool isLast = d.bits == Varicode::FT8CallLast;
|
||||||
|
|
||||||
|
if(isLast){
|
||||||
d.text = QString("%1 \u220E ").arg(d.text);
|
d.text = QString("%1 \u220E ").arg(d.text);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -8156,6 +8175,10 @@ void MainWindow::displayActivity(bool force){
|
|||||||
int block = m_rxFrameBlockNumbers.contains(freq) ? m_rxFrameBlockNumbers[freq] : -1;
|
int block = m_rxFrameBlockNumbers.contains(freq) ? m_rxFrameBlockNumbers[freq] : -1;
|
||||||
block = logRxTxMessageText(d.utcTimestamp, d.isFree, d.text, d.freq, false, block);
|
block = logRxTxMessageText(d.utcTimestamp, d.isFree, d.text, d.freq, false, block);
|
||||||
m_rxFrameBlockNumbers[freq] = block;
|
m_rxFrameBlockNumbers[freq] = block;
|
||||||
|
|
||||||
|
if(isLast){
|
||||||
|
m_rxFrameBlockNumbers.remove(freq);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -8169,6 +8192,8 @@ void MainWindow::displayActivity(bool force){
|
|||||||
while(!m_rxCommandQueue.isEmpty()){
|
while(!m_rxCommandQueue.isEmpty()){
|
||||||
auto d = m_rxCommandQueue.dequeue();
|
auto d = m_rxCommandQueue.dequeue();
|
||||||
|
|
||||||
|
bool isAllCall = d.to == "ALLCALL";
|
||||||
|
|
||||||
qDebug() << "processing command" << d.from << d.to << d.cmd << d.freq;
|
qDebug() << "processing command" << d.from << d.to << d.cmd << d.freq;
|
||||||
|
|
||||||
// we're only processing a subset of queries at this point
|
// we're only processing a subset of queries at this point
|
||||||
@ -8177,25 +8202,39 @@ void MainWindow::displayActivity(bool force){
|
|||||||
}
|
}
|
||||||
|
|
||||||
// we're only processing allcall and our callsign at this point
|
// we're only processing allcall and our callsign at this point
|
||||||
if(d.to != "ALLCALL" && d.to != m_config.my_callsign().trimmed()){
|
if(!isAllCall && d.to != m_config.my_callsign().trimmed()){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: jsherer - check to make sure we haven't replied to their allcall recently (in the past 5 minutes)
|
// TODO: jsherer - check to make sure we haven't replied to their allcall recently (in the past 5 minutes)
|
||||||
if(d.to == "ALLCALL" && m_txAllcallCommandCache.contains(d.from) && m_txAllcallCommandCache[d.from]->secsTo(QDateTime::currentDateTimeUtc()) < 300){
|
if(isAllCall && m_txAllcallCommandCache.contains(d.from) && m_txAllcallCommandCache[d.from]->secsTo(QDateTime::currentDateTimeUtc()) < 300){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// construct reply
|
// construct reply
|
||||||
QString reply;
|
QString reply;
|
||||||
|
|
||||||
|
// SNR
|
||||||
if(d.cmd == "?"){
|
if(d.cmd == "?"){
|
||||||
|
// standard FT8 reply
|
||||||
reply = QString("%1 %2 %3").arg(d.from).arg(m_config.my_callsign()).arg(d.snr);
|
reply = QString("%1 %2 %3").arg(d.from).arg(m_config.my_callsign()).arg(d.snr);
|
||||||
}
|
}
|
||||||
else if(d.cmd == "@"){
|
// QTH
|
||||||
reply = QString("%1 %2 %3").arg(d.from).arg(m_config.my_callsign()).arg(m_config.my_grid());
|
else if(d.cmd == "@" && !isAllCall){
|
||||||
|
QString qth = m_config.my_qth();
|
||||||
|
if(qth.isEmpty()){
|
||||||
|
QString grid = m_config.my_grid();
|
||||||
|
if(grid.isEmpty()){
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
else if(d.cmd == "&"){
|
// standard FT8 reply
|
||||||
|
reply = QString("%1 %2 %3").arg(d.from).arg(m_config.my_callsign()).arg(grid);
|
||||||
|
} else {
|
||||||
|
reply = QString("%1 %2").arg(d.from).arg(qth);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// STATION MESSAGE
|
||||||
|
else if(d.cmd == "&" && !isAllCall){
|
||||||
reply = QString("%1 %2").arg(d.from).arg(m_config.my_station());
|
reply = QString("%1 %2").arg(d.from).arg(m_config.my_station());
|
||||||
} else {
|
} else {
|
||||||
continue;
|
continue;
|
||||||
|
@ -47,15 +47,15 @@ QMap<QString, int> directed_cmds = {
|
|||||||
//{"-", 6 }, // report -snr
|
//{"-", 6 }, // report -snr
|
||||||
|
|
||||||
// ...
|
// ...
|
||||||
|
{" 73", 28 }, // best regards, end of contact
|
||||||
{" RR", 29 }, // confirm message
|
{" RR", 29 }, // confirm message
|
||||||
{" AGN", 30 }, // repeat message
|
|
||||||
{" AGN?", 30 }, // repeat message
|
{" AGN?", 30 }, // repeat message
|
||||||
{" ", 31 }, // send freetext
|
{" ", 31 }, // send freetext
|
||||||
};
|
};
|
||||||
|
|
||||||
QSet<int> allowed_cmds = {0, 2, 3, 29, 30, 31};
|
QSet<int> allowed_cmds = {0, 2, 3, 28, 29, 30, 31};
|
||||||
|
|
||||||
QRegularExpression directed_re(R"(^(?:(?<from>[A-Z0-9/]+):\s?)?(?<to>[A-Z0-9/]+)(?<cmd>(\s(?:RR|AGN[?]?)|[?$@&| ])))");
|
QRegularExpression directed_re(R"(^(?:(?<from>[A-Z0-9/]+):\s?)?(?<to>[A-Z0-9/]+)(?<cmd>(\s?(?:RR|AGN[?]|73)|[?$@&| ])))");
|
||||||
|
|
||||||
QMap<QChar, QString> huff = {
|
QMap<QChar, QString> huff = {
|
||||||
// char code weight
|
// char code weight
|
||||||
|
Loading…
Reference in New Issue
Block a user