From c2bda71da5cfb436aa31bf957e700506a16edd92 Mon Sep 17 00:00:00 2001 From: Jordan Sherer Date: Fri, 3 Aug 2018 21:01:54 -0400 Subject: [PATCH] Added QSL commands --- mainwindow.cpp | 12 ++++++++++++ varicode.cpp | 6 ++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 832cae0..0df15f5 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -7475,6 +7475,18 @@ void MainWindow::buildQueryMenu(QMenu * menu){ toggleTx(true); }); + auto qslQueryAction = menu->addAction("QSL? - Did you copy my last transmission?"); + connect(qslQueryAction, &QAction::triggered, this, [this](){ + + QString selectedCall = callsignSelected(); + if(selectedCall.isEmpty()){ + return; + } + + addMessageText(QString("%1 QSL?").arg(selectedCall), true); + toggleTx(true); + }); + auto ackAction = menu->addAction("ACK - I acknowledge your last transmission"); connect(ackAction, &QAction::triggered, this, [this](){ diff --git a/varicode.cpp b/varicode.cpp index 2534032..027ad9e 100644 --- a/varicode.cpp +++ b/varicode.cpp @@ -53,6 +53,8 @@ QMap directed_cmds = { // {"/", 10 }, // unused? (can we even use stroke?) // directed responses + {" QSL?", 21 }, // do you copy? + {" QSL", 22 }, // i copy {" ACK", 23 }, // acknowledged {" PWR", 24 }, // power level {" SNR", 25 }, // seen a station at the provided snr @@ -64,12 +66,12 @@ QMap directed_cmds = { {" ", 31 }, // send freetext }; -QSet allowed_cmds = {0, 1, 2, 3, 4, 5, 6, 7, 8, 23, 24, 25, 26, 27, 28, 29, 30, 31}; +QSet allowed_cmds = {0, 1, 2, 3, 4, 5, 6, 7, 8, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31}; QSet buffered_cmds = {6, 7, 8}; QString callsign_pattern = QString("(?[A-Z0-9/]+)"); -QString optional_cmd_pattern = QString("(?\\s?(?:AGN[?]|RR|73|YES|NO|SNR|PWR|ACK|[?@&$^%|!# ]))?"); +QString optional_cmd_pattern = QString("(?\\s?(?:AGN[?]|QSL[?]?|RR|73|YES|NO|SNR|PWR|ACK|[?@&$^%|!# ]))?"); QString optional_grid_pattern = QString("(?\\s?[A-R]{2}[0-9]{2})?"); QString optional_pwr_pattern = QString("(?\\s?\\d+\\s?[KM]?W)?"); QString optional_num_pattern = QString("(?\\s?[-+]?(?:3[01]|[0-2]?[0-9]))?");