Compare commits

..

5 Commits

Author SHA1 Message Date
Jordan Sherer eca184bac6 Version bump 2018-07-27 02:27:50 -04:00
Jordan Sherer 6ad2417804 Remove station from heard list 2018-07-27 02:22:48 -04:00
Jordan Sherer 21e87d8b6f QSY on right click of heard list 2018-07-27 01:43:25 -04:00
Jordan Sherer 52a5650a74 Restore original functionality regarding stations heard 2018-07-27 01:36:55 -04:00
Jordan Sherer 2158722ebc Fixed bug in checksuming of buffered messages 2018-07-27 01:24:38 -04:00
3 changed files with 59 additions and 19 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
# Version number components
set (WSJTX_VERSION_MAJOR 0)
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_VERSION_IS_RELEASE 0) # set to 1 for final release build
+55 -15
View File
@@ -248,6 +248,16 @@ namespace
int roundDown = ( (int) (numToRound) / multiple) * 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
@@ -1068,14 +1078,36 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
auto clearAction4 = new QAction(QIcon::fromTheme("edit-clear"), QString("Clear"), 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);
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);
QString selectedCall = callsignSelected();
bool missingCallsign = selectedCall.isEmpty();
if(!missingCallsign && m_callActivity.contains(selectedCall)){
setFreqForRestore(m_callActivity[selectedCall].freq, true);
}
auto directedMenu = menu->addMenu("Directed");
directedMenu->setDisabled(callsignSelected().isEmpty());
directedMenu->setDisabled(missingCallsign);
buildQueryMenu(directedMenu);
menu->addSeparator();
removeStation->setDisabled(missingCallsign || callsignSelected() == "ALLCALL");
menu->addAction(removeStation);
menu->addSeparator();
menu->addAction(clearAction4);
menu->addAction(clearActionAll);
@@ -3242,12 +3274,13 @@ void MainWindow::readFromStdout() //readFromStdout
d.isCompound = decodedtext.isCompoundMessage();
d.bits = decodedtext.bits();
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.snr = decodedtext.snr();
m_bandActivity[offset].append(d);
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);
}
@@ -5701,7 +5734,9 @@ QPair<QStringList, QStringList> MainWindow::buildFT8MessageFrames(QString const&
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...
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();
auto ackQueryAction = menu->addAction("? - Are you hearing me?");
/*
auto ackQueryAction = menu->addAction("^ - Are you hearing me?");
connect(ackQueryAction, &QAction::triggered, this, [this](){
QString selectedCall = callsignSelected();
@@ -7158,9 +7194,9 @@ void MainWindow::buildQueryMenu(QMenu * menu){
addMessageText(QString("%1?").arg(selectedCall), true);
toggleTx(true);
});
*/
auto snrQueryAction = menu->addAction("^ - What is my signal report?");
snrQueryAction->setDisabled(isAllCall);
auto snrQueryAction = menu->addAction("? - What is my signal report?");
connect(snrQueryAction, &QAction::triggered, this, [this](){
QString selectedCall = callsignSelected();
@@ -7168,7 +7204,7 @@ void MainWindow::buildQueryMenu(QMenu * menu){
return;
}
addMessageText(QString("%1^").arg(selectedCall), true);
addMessageText(QString("%1?").arg(selectedCall), true);
toggleTx(true);
});
@@ -8642,15 +8678,18 @@ void MainWindow::displayActivity(bool force){
foreach(auto part, buffer.msgs){
message.append(part.text);
}
message = rstrip(message);
QString checksum = message.left(3);
message = message.mid(4);
QString checksum = message.right(3);
message = message.left(message.length()-4);
if(Varicode::checksum16Valid(checksum, message)){
buffer.cmd.text = message;
m_rxCommandQueue.append(buffer.cmd);
} else {
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
@@ -8693,14 +8732,15 @@ void MainWindow::displayActivity(bool force){
// construct reply
QString reply;
// QUERIED ACK
if(d.cmd == "?"){
reply = QString("%1 ACK").arg(Radio::base_callsign(d.from));
}
// 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));
}
// QUERIED ACK
//else if(d.cmd == "#"){
// reply = QString("%1 ACK").arg(Radio::base_callsign(d.from));
//}
// QUERIED PWR
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()));
+3 -3
View File
@@ -837,7 +837,7 @@ QString Varicode::packCompoundMessage(const QString &baseCallsign, const QString
QStringList Varicode::unpackCompoundMessage(const QString &text){
QStringList unpacked;
if(text.length() < 13){
if(text.length() < 13 || text.contains(" ")){
return unpacked;
}
@@ -955,7 +955,7 @@ QString Varicode::packDirectedMessage(const QString &text, const QString &baseCa
QStringList Varicode::unpackDirectedMessage(const QString &text){
QStringList unpacked;
if(text.length() < 13){
if(text.length() < 13 || text.contains(" ")){
return unpacked;
}
@@ -1034,7 +1034,7 @@ QString Varicode::packDataMessage(const QString &input, QString * out, int *n){
QString Varicode::unpackDataMessage(const QString &text){
QString unpacked;
if(text.length() < 13){
if(text.length() < 13 || text.contains(" ")){
return unpacked;
}