diff --git a/mainwindow.cpp b/mainwindow.cpp index 9e014f3..364fe44 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -6315,6 +6315,8 @@ void MainWindow::on_cqMacroButton_clicked(){ clearCallsignSelected(); addMessageText(message); + + if(m_config.transmit_directed()) toggleTx(true); } void MainWindow::on_replyMacroButton_clicked(){ @@ -6322,7 +6324,10 @@ void MainWindow::on_replyMacroButton_clicked(){ if(call.isEmpty()){ return; } + addMessageText(QString("%1 %2").arg(call).arg(m_config.reply_message())); + + if(m_config.transmit_directed()) toggleTx(true); } void MainWindow::on_qthMacroButton_clicked(){ @@ -6544,6 +6549,20 @@ void MainWindow::buildQueryMenu(QMenu * menu, QString call){ if(m_config.transmit_directed()) toggleTx(true); }); + auto stationIdleQueryAction = menu->addAction(QString("%1* - Is your station active or idle?").arg(call).trimmed()); + stationIdleQueryAction->setDisabled(isAllCall); + connect(stationIdleQueryAction, &QAction::triggered, this, [this](){ + + QString selectedCall = callsignSelected(); + if(selectedCall.isEmpty()){ + return; + } + + addMessageText(QString("%1*").arg(selectedCall), true); + + if(m_config.transmit_directed()) toggleTx(true); + }); + auto heardQueryAction = menu->addAction(QString("%1$ - What are the stations are you hearing? (Top 4 ranked by most recently heard)").arg(call).trimmed()); heardQueryAction->setDisabled(isAllCall); connect(heardQueryAction, &QAction::triggered, this, [this](){ @@ -8607,6 +8626,15 @@ void MainWindow::processCommandActivity() { reply = QString("%1 QTH %2").arg(d.from).arg(qth); } + // QUERIED ACTIVE + else if (d.cmd == "*" && !isAllCall) { + if(m_idleMinutes < 10){ + reply = QString("%1 ACTIVE").arg(d.from); + } else { + reply = QString("%1 IDLE").arg(d.from); + } + } + // QUERIED GRID else if (d.cmd == "^" && !isAllCall) { QString grid = m_config.my_grid(); diff --git a/varicode.cpp b/varicode.cpp index e34c96f..ea97a60 100644 --- a/varicode.cpp +++ b/varicode.cpp @@ -46,14 +46,14 @@ QMap directed_cmds = { {"$", 3 }, // query station(s) heard {"^", 4 }, // query grid {">", 5 }, // relay message - //{"|", 6 }, // retransmit message + {"*", 6 }, // query idle message //{"!", 7 }, // alert message {"#", 8 }, // all or nothing message // {"=", 9 }, // unused - // {"/", 10 }, // unused - + {" ACTIVE", 10 }, // i have been active in the past 10 minutes + {" IDLE", 11 }, // i have not been active in the past 10 minutes {" BEACON", -1 }, // this is my beacon (unused except for faux processing of beacons as directed commands) {" BEACON ACK", 12 }, // i received your beacon at this snr @@ -81,7 +81,7 @@ QMap directed_cmds = { {" ", 31 }, // send freetext }; -QSet allowed_cmds = {-1, 0, 1, 2, 3, 4, 5, /*6,*/ /*7,*/ 8, /*...*/ 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31}; +QSet allowed_cmds = {-1, 0, 1, 2, 3, 4, 5, 6, /*7,*/ 8, /*9,*/ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31}; QSet buffered_cmds = {3, 5, /*6,*/ /*7,*/ 8, 13, 14, 15}; @@ -96,7 +96,7 @@ QMap checksum_cmds = { }; QString callsign_pattern = QString("(?[A-Z0-9/]+)"); -QString optional_cmd_pattern = QString("(?\\s?(?:BEACON (ACK|REQ)|AGN[?]|QSL[?]|HW CPY[?]|APRS[:]|QRZ[?]|(?:(?:ACK|73|YES|NO|SNR|QSL|RR|HEARING|FB|QTH|QTC|GRID)(?=[ ]|$))|[?@&$%#^> ]))?"); +QString optional_cmd_pattern = QString("(?\\s?(?:BEACON (ACK|REQ)|AGN[?]|QSL[?]|HW CPY[?]|APRS[:]|QRZ[?]|(?:(?:ACK|73|YES|NO|SNR|QSL|RR|HEARING|FB|QTH|QTC|GRID|ACTIVE|IDLE)(?=[ ]|$))|[?@&$%#^>* ]))?"); QString optional_grid_pattern = QString("(?\\s?[A-R]{2}[0-9]{2})?"); QString optional_extended_grid_pattern = QString("^(?\\s?(?:[A-R]{2}[0-9]{2}(?:[A-X]{2}(?:[0-9]{2})?)*))?"); QString optional_num_pattern = QString("(?(?<=SNR|BEACON ACK)\\s?[-+]?(?:3[01]|[0-2]?[0-9]))?");