Smarter beacon scheduling for when editing a message or have recently transmitted

This commit is contained in:
Jordan Sherer 2018-07-18 09:04:58 -04:00
parent 77eb65d6b3
commit 7845736c05
2 changed files with 13 additions and 3 deletions

View File

@ -3942,6 +3942,10 @@ void MainWindow::guiUpdate()
case 6: m_QSOProgress = CALLING; break; case 6: m_QSOProgress = CALLING; break;
default: break; // determined elsewhere default: break; // determined elsewhere
} }
// TODO: jsherer - perhaps an on_transmitting signal?
m_lastTxTime = QDateTime::currentDateTimeUtc();
m_transmitting = true; m_transmitting = true;
transmitDisplay (true); transmitDisplay (true);
statusUpdate (); statusUpdate ();
@ -5661,9 +5665,14 @@ void MainWindow::prepareBeacon(){
f = findFreeFreqOffset(250, 1500, bw); f = findFreeFreqOffset(250, 1500, bw);
} }
// delay beacon if there's not a free frequency or there's something the tx queue... // delay beacon if there's not a free frequency or there's something the tx queue or we just recently transmitted
if(f == 0 || !m_txFrameQueue.isEmpty()){ if(
beaconTimer.start(15*1000); f == 0 ||
!m_txFrameQueue.isEmpty() ||
!ui->extFreeTextMsgEdit->toPlainText().isEmpty() ||
m_lastTxTime.secsTo(QDateTime::currentDateTimeUtc()) < 30
){
setBeaconTimer(QDateTime::currentDateTimeUtc().addSecs(30));
return; return;
} }

View File

@ -674,6 +674,7 @@ private:
bool m_rxDirty; bool m_rxDirty;
int m_txFrameCount; int m_txFrameCount;
QDateTime m_lastTxTime;
QQueue<QString> m_txFrameQueue; QQueue<QString> m_txFrameQueue;
QQueue<RXDetail> m_rxFrameQueue; QQueue<RXDetail> m_rxFrameQueue;
QQueue<CommandDetail> m_rxCommandQueue; QQueue<CommandDetail> m_rxCommandQueue;