Properly handle compound call parsing for CQs and DEs
This commit is contained in:
		
							parent
							
								
									7ff43be5f3
								
							
						
					
					
						commit
						5a5e37f119
					
				| @ -3445,22 +3445,25 @@ void MainWindow::readFromStdout()                             //readFromStdout | |||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
|           // Parse CQs
 |           // Parse CQs
 | ||||||
| #if 0 | #if 1 | ||||||
|           bool shouldParseCQs = false; |           bool shouldParseCQs = true; | ||||||
|           if(shouldParseCQs){ |           if(shouldParseCQs && decodedtext.isStandardMessage()){ | ||||||
|               QString cqCall = decodedtext.CQersCall(); |  | ||||||
|               if(!cqCall.isEmpty()){ |  | ||||||
|             QString theircall; |             QString theircall; | ||||||
|             QString theirgrid; |             QString theirgrid; | ||||||
|                 decodedtext.deCallAndGrid(/*out*/theircall,theirgrid); |             decodedtext.deCallAndGrid(theircall, theirgrid); | ||||||
|  | 
 | ||||||
|  |             QStringList calls = Varicode::parseCallsigns(theircall); | ||||||
|  |             if(!calls.isEmpty() && !calls.first().isEmpty()){ | ||||||
|  |                 theircall = calls.first(); | ||||||
| 
 | 
 | ||||||
|                 CallDetail d; |                 CallDetail d; | ||||||
|  |                 d.bits = decodedtext.bits(); | ||||||
|                 d.call = theircall; |                 d.call = theircall; | ||||||
|                 d.grid = theirgrid; |                 d.grid = theirgrid; | ||||||
|                 d.snr = decodedtext.snr(); |                 d.snr = decodedtext.snr(); | ||||||
|                 d.freq = decodedtext.frequencyOffset(); |                 d.freq = decodedtext.frequencyOffset(); | ||||||
|                 d.utcTimestamp = QDateTime::currentDateTimeUtc(); |                 d.utcTimestamp = QDateTime::currentDateTimeUtc(); | ||||||
|                 m_callActivity[Radio::base_callsign(cqCall)] = d; // original call is stored in CallDetail.
 |                 m_callActivity[d.call] = d; | ||||||
|               } |               } | ||||||
|           } |           } | ||||||
| #endif | #endif | ||||||
| @ -7646,10 +7649,6 @@ void MainWindow::on_tableWidgetRXAll_cellDoubleClicked(int row, int col){ | |||||||
|         if(activityAging && d.utcTimestamp.secsTo(now)/60 >= activityAging){ |         if(activityAging && d.utcTimestamp.secsTo(now)/60 >= activityAging){ | ||||||
|             continue; |             continue; | ||||||
|         } |         } | ||||||
|         // TODO: jsherer - still ok to skip these here?
 |  | ||||||
|         if(d.isCompound){ |  | ||||||
|             continue; |  | ||||||
|         } |  | ||||||
|         if(activityText.isEmpty()){ |         if(activityText.isEmpty()){ | ||||||
|             firstActivity = d.utcTimestamp; |             firstActivity = d.utcTimestamp; | ||||||
|         } |         } | ||||||
| @ -8627,7 +8626,9 @@ QString MainWindow::callsignSelected(){ | |||||||
|         auto selectedCalls = ui->tableWidgetCalls->selectedItems(); |         auto selectedCalls = ui->tableWidgetCalls->selectedItems(); | ||||||
|         if(!selectedCalls.isEmpty()){ |         if(!selectedCalls.isEmpty()){ | ||||||
|             auto call = selectedCalls.first()->data(Qt::UserRole).toString(); |             auto call = selectedCalls.first()->data(Qt::UserRole).toString(); | ||||||
|             return Radio::base_callsign(call); |             if(!call.isEmpty()){ | ||||||
|  |                 return call; | ||||||
|  |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| @ -8638,12 +8639,12 @@ QString MainWindow::callsignSelected(){ | |||||||
|         foreach(auto call, m_callActivity.keys()){ |         foreach(auto call, m_callActivity.keys()){ | ||||||
|             auto d = m_callActivity[call]; |             auto d = m_callActivity[call]; | ||||||
|             if(d.freq == selectedOffset){ |             if(d.freq == selectedOffset){ | ||||||
|                 return call; |                 return d.call; | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     auto text = ui->extFreeTextMsgEdit->toPlainText().left(11); |     auto text = ui->extFreeTextMsgEdit->toPlainText().left(11); // Maximum callsign is 6 + / + 4 = 11 characters
 | ||||||
|     auto calls = Varicode::parseCallsigns(text); |     auto calls = Varicode::parseCallsigns(text); | ||||||
|     if(!calls.isEmpty() && text.startsWith(calls.first())){ |     if(!calls.isEmpty() && text.startsWith(calls.first())){ | ||||||
|         return calls.first(); |         return calls.first(); | ||||||
| @ -8713,11 +8714,6 @@ void MainWindow::processRxActivity() { | |||||||
| 
 | 
 | ||||||
|         int freq = d.freq / 10 * 10; |         int freq = d.freq / 10 * 10; | ||||||
| 
 | 
 | ||||||
|         // TODO: jsherer - is it safe to just ignore printing these?
 |  | ||||||
|         if (d.isCompound) { |  | ||||||
|             continue; |  | ||||||
|         } |  | ||||||
| 
 |  | ||||||
|         bool shouldDisplay = abs(freq - currentFreq()) <= 10; |         bool shouldDisplay = abs(freq - currentFreq()) <= 10; | ||||||
| 
 | 
 | ||||||
|         if(isRecentOffset(freq) || isAllCallIncluded(d.text)){ |         if(isRecentOffset(freq) || isAllCallIncluded(d.text)){ | ||||||
| @ -8736,17 +8732,14 @@ void MainWindow::processRxActivity() { | |||||||
| 
 | 
 | ||||||
|         // ok, we're good to display...let's cache that fact and then display!
 |         // ok, we're good to display...let's cache that fact and then display!
 | ||||||
|         bool isLast = d.bits == Varicode::FT8CallLast; |         bool isLast = d.bits == Varicode::FT8CallLast; | ||||||
| 
 |  | ||||||
|         if (isLast) { |         if (isLast) { | ||||||
|             // can also use \u0004 \u2666 \u2404
 |             // can also use \u0004 \u2666 \u2404
 | ||||||
|             d.text = QString("%1 \u2301 ").arg(d.text); |             d.text = QString("%1 \u2301 ").arg(d.text); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         int block = m_rxFrameBlockNumbers.contains(freq) ? m_rxFrameBlockNumbers[freq] : -1; |  | ||||||
| 
 |  | ||||||
|         // log it to the display!
 |         // log it to the display!
 | ||||||
|  |         int block = m_rxFrameBlockNumbers.contains(freq) ? m_rxFrameBlockNumbers[freq] : -1; | ||||||
|         m_rxFrameBlockNumbers[freq] = logRxTxMessageText(d.utcTimestamp, d.text, d.freq, false, block); |         m_rxFrameBlockNumbers[freq] = logRxTxMessageText(d.utcTimestamp, d.text, d.freq, false, block); | ||||||
| 
 |  | ||||||
|         if (isLast) { |         if (isLast) { | ||||||
|             m_rxFrameBlockNumbers.remove(freq); |             m_rxFrameBlockNumbers.remove(freq); | ||||||
|         } |         } | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Jordan Sherer
						Jordan Sherer