Parse callsigns from BCN command
This commit is contained in:
		
							parent
							
								
									5a5e37f119
								
							
						
					
					
						commit
						7942bf3a4d
					
				| @ -3354,11 +3354,6 @@ void MainWindow::readFromStdout()                             //readFromStdout | |||||||
| #if 1 | #if 1 | ||||||
|           bool shouldProcessCompound = true; |           bool shouldProcessCompound = true; | ||||||
|           if(shouldProcessCompound && decodedtext.isCompoundMessage()){ |           if(shouldProcessCompound && decodedtext.isCompoundMessage()){ | ||||||
| #if ALIAS_COMPOUND_CALLS |  | ||||||
|             QString compoundCall = decodedtext.compoundCall(); |  | ||||||
|             m_compoundCallCache[Radio::base_callsign(compoundCall)] = compoundCall; |  | ||||||
| #endif |  | ||||||
| 
 |  | ||||||
|             CallDetail cd; |             CallDetail cd; | ||||||
|             cd.call = decodedtext.compoundCall(); |             cd.call = decodedtext.compoundCall(); | ||||||
|             cd.grid = decodedtext.extra(); // compound calls via beacons may contain grid...
 |             cd.grid = decodedtext.extra(); // compound calls via beacons may contain grid...
 | ||||||
| @ -3367,18 +3362,12 @@ void MainWindow::readFromStdout()                             //readFromStdout | |||||||
|             cd.utcTimestamp = QDateTime::currentDateTimeUtc(); |             cd.utcTimestamp = QDateTime::currentDateTimeUtc(); | ||||||
|             cd.bits = decodedtext.bits(); |             cd.bits = decodedtext.bits(); | ||||||
| 
 | 
 | ||||||
|             if(!decodedtext.isBeacon()){ |             if(decodedtext.isBeacon()){ | ||||||
|  |                 logCallActivity(cd, true); | ||||||
|  |             } else { | ||||||
|                 qDebug() << "buffering compound call" << cd.call << cd.bits; |                 qDebug() << "buffering compound call" << cd.call << cd.bits; | ||||||
|                 m_messageBuffer[cd.freq/10*10].compound.append(cd); |                 m_messageBuffer[cd.freq/10*10].compound.append(cd); | ||||||
|             } |             } | ||||||
|             /*
 |  | ||||||
|             // DISABLED FOR NOW...
 |  | ||||||
|             else { |  | ||||||
|                 logCallActivity(cd); |  | ||||||
|             } |  | ||||||
|             */ |  | ||||||
| 
 |  | ||||||
|             //
 |  | ||||||
|           } |           } | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| @ -3390,9 +3379,6 @@ void MainWindow::readFromStdout()                             //readFromStdout | |||||||
|               auto parts = decodedtext.directedMessage(); |               auto parts = decodedtext.directedMessage(); | ||||||
| 
 | 
 | ||||||
|               CommandDetail d; |               CommandDetail d; | ||||||
| #if ALIAS_COMPOUND_CALLS |  | ||||||
|               d.from = lookupCallInCompoundCache(parts.at(0)); |  | ||||||
| #endif |  | ||||||
|               d.from = parts.at(0); |               d.from = parts.at(0); | ||||||
|               d.to = parts.at(1); |               d.to = parts.at(1); | ||||||
|               d.cmd = parts.at(2); |               d.cmd = parts.at(2); | ||||||
| @ -3632,7 +3618,7 @@ void MainWindow::readFromStdout()                             //readFromStdout | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| void MainWindow::logCallActivity(CallDetail d){ | void MainWindow::logCallActivity(CallDetail d, bool spot){ | ||||||
|     if(m_callActivity.contains(d.call)){ |     if(m_callActivity.contains(d.call)){ | ||||||
|         // update (keep grid)
 |         // update (keep grid)
 | ||||||
|         CallDetail old = m_callActivity[d.call]; |         CallDetail old = m_callActivity[d.call]; | ||||||
| @ -3644,6 +3630,11 @@ void MainWindow::logCallActivity(CallDetail d){ | |||||||
|         // create
 |         // create
 | ||||||
|         m_callActivity[d.call] = d; |         m_callActivity[d.call] = d; | ||||||
|     } |     } | ||||||
|  | 
 | ||||||
|  |     // enqueue for spotting to psk reporter
 | ||||||
|  |     if(spot){ | ||||||
|  |         m_rxCallQueue.append(d); | ||||||
|  |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| QString MainWindow::lookupCallInCompoundCache(QString const &call){ | QString MainWindow::lookupCallInCompoundCache(QString const &call){ | ||||||
| @ -5595,6 +5586,7 @@ void MainWindow::clearActivity(){ | |||||||
|     m_callSeenBeacon.clear(); |     m_callSeenBeacon.clear(); | ||||||
|     m_compoundCallCache.clear(); |     m_compoundCallCache.clear(); | ||||||
|     m_rxCallCache.clear(); |     m_rxCallCache.clear(); | ||||||
|  |     m_rxCallQueue.clear(); | ||||||
|     m_rxRecentCache.clear(); |     m_rxRecentCache.clear(); | ||||||
|     m_rxDirectedCache.clear(); |     m_rxDirectedCache.clear(); | ||||||
|     m_rxFrameBlockNumbers.clear(); |     m_rxFrameBlockNumbers.clear(); | ||||||
| @ -8786,6 +8778,7 @@ void MainWindow::processCompoundActivity() { | |||||||
|         if (buffer.cmd.from == "<....>") { |         if (buffer.cmd.from == "<....>") { | ||||||
|             auto d = buffer.compound.dequeue(); |             auto d = buffer.compound.dequeue(); | ||||||
|             buffer.cmd.from = d.call; |             buffer.cmd.from = d.call; | ||||||
|  |             buffer.cmd.grid = d.grid; | ||||||
| 
 | 
 | ||||||
|             if (d.bits == Varicode::FT8CallLast) { |             if (d.bits == Varicode::FT8CallLast) { | ||||||
|                 buffer.cmd.bits = d.bits; |                 buffer.cmd.bits = d.bits; | ||||||
| @ -8899,16 +8892,19 @@ void MainWindow::processCommandActivity() { | |||||||
|         if (isAllCall && m_txAllcallCommandCache.contains(Radio::base_callsign(d.from)) && m_txAllcallCommandCache[Radio::base_callsign(d.from)]->secsTo(QDateTime::currentDateTimeUtc()) / 60 < m_config.beacon()) { |         if (isAllCall && m_txAllcallCommandCache.contains(Radio::base_callsign(d.from)) && m_txAllcallCommandCache[Radio::base_callsign(d.from)]->secsTo(QDateTime::currentDateTimeUtc()) / 60 < m_config.beacon()) { | ||||||
|             continue; |             continue; | ||||||
|         } |         } | ||||||
| 
 |  | ||||||
|         // TODO: jsherer - we need to queue these for later processing
 |  | ||||||
|         // record the spot to PSKReporter
 |  | ||||||
|         if (okToPost) { |  | ||||||
|             pskSetLocal(); |  | ||||||
|             pskLogReport("FT8Call", d.freq, d.snr, d.from, ""); |  | ||||||
|         } |  | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
|         // construct a reply
 |         // log call activity...
 | ||||||
|  |         CallDetail cd; | ||||||
|  |         cd.call = d.from; | ||||||
|  |         cd.grid = d.grid; | ||||||
|  |         cd.snr = d.snr; | ||||||
|  |         cd.freq = d.freq; | ||||||
|  |         cd.bits = d.bits; | ||||||
|  |         cd.utcTimestamp = d.utcTimestamp; | ||||||
|  |         logCallActivity(cd, true); | ||||||
|  | 
 | ||||||
|  |         // construct a reply, if needed
 | ||||||
|         QString reply; |         QString reply; | ||||||
| 
 | 
 | ||||||
|         // QUERIED SNR
 |         // QUERIED SNR
 | ||||||
| @ -8991,10 +8987,7 @@ void MainWindow::processCommandActivity() { | |||||||
|                     return; |                     return; | ||||||
|                 } |                 } | ||||||
| 
 | 
 | ||||||
| #if 0 |                 enqueueMessage(PriorityNormal, QString("%1 ACK").arg(d.from), d.freq, nullptr); | ||||||
|                 addMessageText(QString("%1 ACK").arg(d.from)); |  | ||||||
|                 toggleTx(true); |  | ||||||
| #endif |  | ||||||
|             }); |             }); | ||||||
| 
 | 
 | ||||||
|             msgBox->show(); |             msgBox->show(); | ||||||
| @ -9008,10 +9001,9 @@ void MainWindow::processCommandActivity() { | |||||||
|             continue; |             continue; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
| 
 |         // queue the reply here to be sent when a free interval is available
 | ||||||
|         enqueueMessage(PriorityNormal, reply, d.freq, nullptr); |         enqueueMessage(PriorityNormal, reply, d.freq, nullptr); | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| #if 0 | #if 0 | ||||||
|         addMessageText(reply); |         addMessageText(reply); | ||||||
| 
 | 
 | ||||||
| @ -9027,17 +9019,19 @@ void MainWindow::processCommandActivity() { | |||||||
|         processed = true; |         processed = true; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
|         // TODO: jsherer - queue the reply here to be sent when a free interval is available
 |  | ||||||
|     } |     } | ||||||
| 
 |  | ||||||
| #if 0 |  | ||||||
|     if (processed && ui->autoReplyButton->isChecked()) { |  | ||||||
|         toggleTx(true); |  | ||||||
|     } |  | ||||||
| #endif |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void MainWindow::processSpots() { | void MainWindow::processSpots() { | ||||||
|  |     if(!ui->spotButton->isChecked()){ | ||||||
|  |         m_rxCallQueue.clear(); | ||||||
|  |         return; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     if(m_rxCallQueue.isEmpty()){ | ||||||
|  |         return; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     // Is it ok to post spots to PSKReporter?
 |     // Is it ok to post spots to PSKReporter?
 | ||||||
|     int nsec = QDateTime::currentMSecsSinceEpoch() / 1000 - m_secBandChanged; |     int nsec = QDateTime::currentMSecsSinceEpoch() / 1000 - m_secBandChanged; | ||||||
|     bool okToPost = (nsec > (4 * m_TRperiod) / 5); |     bool okToPost = (nsec > (4 * m_TRperiod) / 5); | ||||||
| @ -9046,6 +9040,16 @@ void MainWindow::processSpots() { | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     // Process spots to be sent...
 |     // Process spots to be sent...
 | ||||||
|  |     pskSetLocal(); | ||||||
|  | 
 | ||||||
|  |     while(!m_rxCallQueue.isEmpty()){ | ||||||
|  |         CallDetail d = m_rxCallQueue.dequeue(); | ||||||
|  |         if(d.call.isEmpty()){ | ||||||
|  |             continue; | ||||||
|  |         } | ||||||
|  |         qDebug() << "spotting call to psk reporter" << d.call << d.snr << d.freq; | ||||||
|  |         pskLogReport("FT8Call", d.freq, d.snr, d.call, d.grid); | ||||||
|  |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void MainWindow::processTxQueue(){ | void MainWindow::processTxQueue(){ | ||||||
|  | |||||||
| @ -128,7 +128,7 @@ public slots: | |||||||
|   void msgAvgDecode2(); |   void msgAvgDecode2(); | ||||||
|   void fastPick(int x0, int x1, int y); |   void fastPick(int x0, int x1, int y); | ||||||
| 
 | 
 | ||||||
|   void logCallActivity(CallDetail d); |   void logCallActivity(CallDetail d, bool spot=true); | ||||||
|   QString lookupCallInCompoundCache(QString const &call); |   QString lookupCallInCompoundCache(QString const &call); | ||||||
|   void clearActivity(); |   void clearActivity(); | ||||||
|   int logRxTxMessageText(QDateTime date, QString text, int freq, bool tx, int block=-1); |   int logRxTxMessageText(QDateTime date, QString text, int freq, bool tx, int block=-1); | ||||||
| @ -676,6 +676,7 @@ private: | |||||||
|     QDateTime utcTimestamp; |     QDateTime utcTimestamp; | ||||||
|     int snr; |     int snr; | ||||||
|     int bits; |     int bits; | ||||||
|  |     QString grid; | ||||||
|     QString text; |     QString text; | ||||||
|   }; |   }; | ||||||
| 
 | 
 | ||||||
| @ -727,8 +728,9 @@ private: | |||||||
| 
 | 
 | ||||||
|   QPriorityQueue<PrioritizedMessage> m_txMessageQueue; // messages to be sent
 |   QPriorityQueue<PrioritizedMessage> m_txMessageQueue; // messages to be sent
 | ||||||
|   QQueue<QString> m_txFrameQueue; // frames to be sent
 |   QQueue<QString> m_txFrameQueue; // frames to be sent
 | ||||||
|   QQueue<ActivityDetail> m_rxActivityQueue; |   QQueue<ActivityDetail> m_rxActivityQueue; // all rx activity queue
 | ||||||
|   QQueue<CommandDetail> m_rxCommandQueue; |   QQueue<CommandDetail> m_rxCommandQueue; // command queue for processing commands
 | ||||||
|  |   QQueue<CallDetail> m_rxCallQueue; // call detail queue for spots to pskreporter
 | ||||||
|   QMap<QString, QString> m_compoundCallCache; // base callsign -> compound callsign
 |   QMap<QString, QString> m_compoundCallCache; // base callsign -> compound callsign
 | ||||||
|   QCache<QString, QDateTime> m_txAllcallCommandCache; // callsign -> last tx
 |   QCache<QString, QDateTime> m_txAllcallCommandCache; // callsign -> last tx
 | ||||||
|   QCache<int, QDateTime> m_rxRecentCache; // freq -> last rx
 |   QCache<int, QDateTime> m_rxRecentCache; // freq -> last rx
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Jordan Sherer
						Jordan Sherer