From 3e19b2c98dba330d959cefdcf1216bef0c74f62a Mon Sep 17 00:00:00 2001 From: Jordan Sherer Date: Tue, 31 Jul 2018 18:18:27 -0400 Subject: [PATCH] Added some better alignment of low priority beacons with other messages --- mainwindow.cpp | 16 +++++++++------- mainwindow.h | 6 +++--- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index c268e09..fe20ed4 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -5777,6 +5777,7 @@ void MainWindow::restoreMessage(){ void MainWindow::resetMessageTransmitQueue(){ m_txFrameCount = 0; m_txFrameQueue.clear(); + m_txMessageQueue.clear(); } QString MainWindow::popMessageFrame(){ @@ -9086,21 +9087,22 @@ void MainWindow::processTxQueue(){ return; } -#if 0 - // and we need to have not transmitted in the 30 seconds... - if(m_lastTxTime.secsTo(QDateTime::currentDateTimeUtc()) < 30){ + // and if we are a low priority message, we need to have not transmitted in the past 30 seconds... + if(head.priority <= PriorityLow && m_lastTxTime.secsTo(QDateTime::currentDateTimeUtc()) <= 30){ return; } -#endif - // dequeue the next message from the queue... + // if so... dequeue the next message from the queue... auto message = m_txMessageQueue.dequeue(); // add the message to the outgoing message text box addMessageText(message.message, true); - // then transmit... - toggleTx(true); + // check to see if we have autoreply enabled... + if(ui->autoReplyButton->isChecked()){ + // then prepare to transmit... + toggleTx(true); + } if(message.callback){ message.callback(); diff --git a/mainwindow.h b/mainwindow.h index 1069f0a..969fae4 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -705,9 +705,9 @@ private: enum Priority { - PriorityLow = 0, - PriorityNormal = 10, - PriorityHigh = 100 + PriorityLow = 10, + PriorityNormal = 100, + PriorityHigh = 1000 }; struct PrioritizedMessage {