Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| eca184bac6 | |||
| 6ad2417804 | |||
| 21e87d8b6f | |||
| 52a5650a74 | |||
| 2158722ebc |
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
# Version number components
|
# Version number components
|
||||||
set (WSJTX_VERSION_MAJOR 0)
|
set (WSJTX_VERSION_MAJOR 0)
|
||||||
set (WSJTX_VERSION_MINOR 3)
|
set (WSJTX_VERSION_MINOR 3)
|
||||||
set (WSJTX_VERSION_PATCH 0)
|
set (WSJTX_VERSION_PATCH 1)
|
||||||
set (WSJTX_RC 0) # release candidate number, comment out or zero for development versions
|
set (WSJTX_RC 0) # release candidate number, comment out or zero for development versions
|
||||||
set (WSJTX_VERSION_IS_RELEASE 0) # set to 1 for final release build
|
set (WSJTX_VERSION_IS_RELEASE 0) # set to 1 for final release build
|
||||||
|
|||||||
+55
-15
@@ -248,6 +248,16 @@ namespace
|
|||||||
int roundDown = ( (int) (numToRound) / multiple) * multiple;
|
int roundDown = ( (int) (numToRound) / multiple) * multiple;
|
||||||
return roundDown + multiple;
|
return roundDown + multiple;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString rstrip(const QString& str) {
|
||||||
|
int n = str.size() - 1;
|
||||||
|
for (; n >= 0; --n) {
|
||||||
|
if (!str.at(n).isSpace()) {
|
||||||
|
return str.left(n + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------- MainWindow constructor
|
//--------------------------------------------------- MainWindow constructor
|
||||||
@@ -1068,14 +1078,36 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
|
|||||||
auto clearAction4 = new QAction(QIcon::fromTheme("edit-clear"), QString("Clear"), ui->tableWidgetCalls);
|
auto clearAction4 = new QAction(QIcon::fromTheme("edit-clear"), QString("Clear"), ui->tableWidgetCalls);
|
||||||
connect(clearAction4, &QAction::triggered, this, [this](){ this->on_clearAction_triggered(ui->tableWidgetCalls); });
|
connect(clearAction4, &QAction::triggered, this, [this](){ this->on_clearAction_triggered(ui->tableWidgetCalls); });
|
||||||
|
|
||||||
|
auto removeStation = new QAction(QString("Remove Station"), ui->tableWidgetCalls);
|
||||||
|
connect(removeStation, &QAction::triggered, this, [this](){
|
||||||
|
QString selectedCall = callsignSelected();
|
||||||
|
if(!selectedCall.isEmpty() && m_callActivity.contains(selectedCall)){
|
||||||
|
m_callActivity.remove(selectedCall);
|
||||||
|
displayActivity(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
ui->tableWidgetCalls->setContextMenuPolicy(Qt::CustomContextMenu);
|
ui->tableWidgetCalls->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
connect(ui->tableWidgetCalls, &QTableWidget::customContextMenuRequested, this, [this, clearAction4, clearActionAll](QPoint const &point){
|
connect(ui->tableWidgetCalls, &QTableWidget::customContextMenuRequested, this, [this, clearAction4, clearActionAll, removeStation](QPoint const &point){
|
||||||
QMenu * menu = new QMenu(ui->tableWidgetCalls);
|
QMenu * menu = new QMenu(ui->tableWidgetCalls);
|
||||||
|
|
||||||
|
QString selectedCall = callsignSelected();
|
||||||
|
bool missingCallsign = selectedCall.isEmpty();
|
||||||
|
if(!missingCallsign && m_callActivity.contains(selectedCall)){
|
||||||
|
setFreqForRestore(m_callActivity[selectedCall].freq, true);
|
||||||
|
}
|
||||||
|
|
||||||
auto directedMenu = menu->addMenu("Directed");
|
auto directedMenu = menu->addMenu("Directed");
|
||||||
directedMenu->setDisabled(callsignSelected().isEmpty());
|
directedMenu->setDisabled(missingCallsign);
|
||||||
buildQueryMenu(directedMenu);
|
buildQueryMenu(directedMenu);
|
||||||
|
|
||||||
|
menu->addSeparator();
|
||||||
|
|
||||||
|
removeStation->setDisabled(missingCallsign || callsignSelected() == "ALLCALL");
|
||||||
|
menu->addAction(removeStation);
|
||||||
|
|
||||||
|
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
menu->addAction(clearAction4);
|
menu->addAction(clearAction4);
|
||||||
menu->addAction(clearActionAll);
|
menu->addAction(clearActionAll);
|
||||||
@@ -3242,12 +3274,13 @@ void MainWindow::readFromStdout() //readFromStdout
|
|||||||
d.isCompound = decodedtext.isCompoundMessage();
|
d.isCompound = decodedtext.isCompoundMessage();
|
||||||
d.bits = decodedtext.bits();
|
d.bits = decodedtext.bits();
|
||||||
d.freq = offset;
|
d.freq = offset;
|
||||||
d.text = decodedtext.messageWords().isEmpty() ? "" : decodedtext.messageWords().first().trimmed();
|
d.text = decodedtext.message(); //decodedtext.messageWords().isEmpty() ? "" : decodedtext.messageWords().first().trimmed();
|
||||||
d.utcTimestamp = QDateTime::currentDateTimeUtc();
|
d.utcTimestamp = QDateTime::currentDateTimeUtc();
|
||||||
d.snr = decodedtext.snr();
|
d.snr = decodedtext.snr();
|
||||||
m_bandActivity[offset].append(d);
|
m_bandActivity[offset].append(d);
|
||||||
|
|
||||||
if(m_messageBuffer.contains(d.freq/10*10)){
|
if(m_messageBuffer.contains(d.freq/10*10)){
|
||||||
|
qDebug() << "buffering" << (d.freq/10*10) << d.text;
|
||||||
m_messageBuffer[d.freq/10*10].msgs.append(d);
|
m_messageBuffer[d.freq/10*10].msgs.append(d);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5701,7 +5734,9 @@ QPair<QStringList, QStringList> MainWindow::buildFT8MessageFrames(QString const&
|
|||||||
|
|
||||||
if(Varicode::isCommandBuffered(dirCmd) && !line.isEmpty()){
|
if(Varicode::isCommandBuffered(dirCmd) && !line.isEmpty()){
|
||||||
// TODO: jsherer - this is how we can add 16-bit checksum to the message, just encode it in the data...
|
// TODO: jsherer - this is how we can add 16-bit checksum to the message, just encode it in the data...
|
||||||
line = Varicode::checksum16(line) + " " + line;
|
qDebug() << "generating checksum for line" << line;
|
||||||
|
line = line + " " + Varicode::checksum16(line);
|
||||||
|
qDebug() << line;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7147,7 +7182,8 @@ void MainWindow::buildQueryMenu(QMenu * menu){
|
|||||||
|
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
|
|
||||||
auto ackQueryAction = menu->addAction("? - Are you hearing me?");
|
/*
|
||||||
|
auto ackQueryAction = menu->addAction("^ - Are you hearing me?");
|
||||||
connect(ackQueryAction, &QAction::triggered, this, [this](){
|
connect(ackQueryAction, &QAction::triggered, this, [this](){
|
||||||
|
|
||||||
QString selectedCall = callsignSelected();
|
QString selectedCall = callsignSelected();
|
||||||
@@ -7158,9 +7194,9 @@ void MainWindow::buildQueryMenu(QMenu * menu){
|
|||||||
addMessageText(QString("%1?").arg(selectedCall), true);
|
addMessageText(QString("%1?").arg(selectedCall), true);
|
||||||
toggleTx(true);
|
toggleTx(true);
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
|
|
||||||
auto snrQueryAction = menu->addAction("^ - What is my signal report?");
|
auto snrQueryAction = menu->addAction("? - What is my signal report?");
|
||||||
snrQueryAction->setDisabled(isAllCall);
|
|
||||||
connect(snrQueryAction, &QAction::triggered, this, [this](){
|
connect(snrQueryAction, &QAction::triggered, this, [this](){
|
||||||
|
|
||||||
QString selectedCall = callsignSelected();
|
QString selectedCall = callsignSelected();
|
||||||
@@ -7168,7 +7204,7 @@ void MainWindow::buildQueryMenu(QMenu * menu){
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
addMessageText(QString("%1^").arg(selectedCall), true);
|
addMessageText(QString("%1?").arg(selectedCall), true);
|
||||||
toggleTx(true);
|
toggleTx(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -8642,15 +8678,18 @@ void MainWindow::displayActivity(bool force){
|
|||||||
foreach(auto part, buffer.msgs){
|
foreach(auto part, buffer.msgs){
|
||||||
message.append(part.text);
|
message.append(part.text);
|
||||||
}
|
}
|
||||||
|
message = rstrip(message);
|
||||||
|
|
||||||
QString checksum = message.left(3);
|
QString checksum = message.right(3);
|
||||||
message = message.mid(4);
|
message = message.left(message.length()-4);
|
||||||
|
|
||||||
if(Varicode::checksum16Valid(checksum, message)){
|
if(Varicode::checksum16Valid(checksum, message)){
|
||||||
buffer.cmd.text = message;
|
buffer.cmd.text = message;
|
||||||
m_rxCommandQueue.append(buffer.cmd);
|
m_rxCommandQueue.append(buffer.cmd);
|
||||||
} else {
|
} else {
|
||||||
qDebug() << "Buffered message failed checksum...discarding";
|
qDebug() << "Buffered message failed checksum...discarding";
|
||||||
|
qDebug() << "Checksum:" << checksum;
|
||||||
|
qDebug() << "Message:" << message;
|
||||||
}
|
}
|
||||||
|
|
||||||
// regardless of valid or not, remove the "complete" buffered message from the buffer cache
|
// regardless of valid or not, remove the "complete" buffered message from the buffer cache
|
||||||
@@ -8693,14 +8732,15 @@ void MainWindow::displayActivity(bool force){
|
|||||||
// construct reply
|
// construct reply
|
||||||
QString reply;
|
QString reply;
|
||||||
|
|
||||||
// QUERIED ACK
|
|
||||||
if(d.cmd == "?"){
|
|
||||||
reply = QString("%1 ACK").arg(Radio::base_callsign(d.from));
|
|
||||||
}
|
|
||||||
// QUERIED SNR
|
// QUERIED SNR
|
||||||
else if(d.cmd == "^" && !isAllCall){
|
if(d.cmd == "?"){
|
||||||
reply = QString("%1 SNR %2").arg(Radio::base_callsign(d.from)).arg(Varicode::formatSNR(d.snr));
|
reply = QString("%1 SNR %2").arg(Radio::base_callsign(d.from)).arg(Varicode::formatSNR(d.snr));
|
||||||
}
|
}
|
||||||
|
// QUERIED ACK
|
||||||
|
//else if(d.cmd == "#"){
|
||||||
|
// reply = QString("%1 ACK").arg(Radio::base_callsign(d.from));
|
||||||
|
//}
|
||||||
// QUERIED PWR
|
// QUERIED PWR
|
||||||
else if(d.cmd == "%" && !isAllCall && m_config.my_dBm() >= 0){
|
else if(d.cmd == "%" && !isAllCall && m_config.my_dBm() >= 0){
|
||||||
reply = QString("%1 PWR %2").arg(Radio::base_callsign(d.from)).arg(Varicode::formatPWR(m_config.my_dBm()));
|
reply = QString("%1 PWR %2").arg(Radio::base_callsign(d.from)).arg(Varicode::formatPWR(m_config.my_dBm()));
|
||||||
|
|||||||
+3
-3
@@ -837,7 +837,7 @@ QString Varicode::packCompoundMessage(const QString &baseCallsign, const QString
|
|||||||
QStringList Varicode::unpackCompoundMessage(const QString &text){
|
QStringList Varicode::unpackCompoundMessage(const QString &text){
|
||||||
QStringList unpacked;
|
QStringList unpacked;
|
||||||
|
|
||||||
if(text.length() < 13){
|
if(text.length() < 13 || text.contains(" ")){
|
||||||
return unpacked;
|
return unpacked;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -955,7 +955,7 @@ QString Varicode::packDirectedMessage(const QString &text, const QString &baseCa
|
|||||||
QStringList Varicode::unpackDirectedMessage(const QString &text){
|
QStringList Varicode::unpackDirectedMessage(const QString &text){
|
||||||
QStringList unpacked;
|
QStringList unpacked;
|
||||||
|
|
||||||
if(text.length() < 13){
|
if(text.length() < 13 || text.contains(" ")){
|
||||||
return unpacked;
|
return unpacked;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1034,7 +1034,7 @@ QString Varicode::packDataMessage(const QString &input, QString * out, int *n){
|
|||||||
QString Varicode::unpackDataMessage(const QString &text){
|
QString Varicode::unpackDataMessage(const QString &text){
|
||||||
QString unpacked;
|
QString unpacked;
|
||||||
|
|
||||||
if(text.length() < 13){
|
if(text.length() < 13 || text.contains(" ")){
|
||||||
return unpacked;
|
return unpacked;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user