mirror of
				https://github.com/saitohirga/WSJT-X.git
				synced 2025-11-03 13:30:52 -05:00 
			
		
		
		
	Much of the code for helping S+P in ARRL_DIGI contest is now in place. More to come!
This commit is contained in:
		
							parent
							
								
									38174ed6dc
								
							
						
					
					
						commit
						04836a447d
					
				@ -3362,6 +3362,37 @@ void MainWindow::decodeDone ()
 | 
				
			|||||||
    MessageBox::information_message(this, tr("No more files to open."));
 | 
					    MessageBox::information_message(this, tr("No more files to open."));
 | 
				
			||||||
    m_bNoMoreFiles=false;
 | 
					    m_bNoMoreFiles=false;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if((m_mode=="FT4" or m_mode=="FT8") and SpecOp::ARRL_DIGI==m_config.special_op_id()) {
 | 
				
			||||||
 | 
					    // Update the ARRL_DIGI display, etc.
 | 
				
			||||||
 | 
					    if(m_latestDecodeTime<0) return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    QMutableMapIterator<QString,RecentCall> icall(m_recentCall);
 | 
				
			||||||
 | 
					    QString deCall;
 | 
				
			||||||
 | 
					    int age=0;
 | 
				
			||||||
 | 
					    int i=0;
 | 
				
			||||||
 | 
					    int maxAge=4;
 | 
				
			||||||
 | 
					    int points=0;
 | 
				
			||||||
 | 
					    int maxPoints=0;
 | 
				
			||||||
 | 
					    while (icall.hasNext()) {
 | 
				
			||||||
 | 
					      icall.next();
 | 
				
			||||||
 | 
					      deCall=icall.key();
 | 
				
			||||||
 | 
					      age=int((m_latestDecodeTime - icall.value().decodeTime)/m_TRperiod + 0.5);
 | 
				
			||||||
 | 
					      if(age>maxAge) {
 | 
				
			||||||
 | 
					        qDebug() << "bb" << i << deCall << "removed";
 | 
				
			||||||
 | 
					        icall.remove();
 | 
				
			||||||
 | 
					      } else {
 | 
				
			||||||
 | 
					        i++;
 | 
				
			||||||
 | 
					        points=m_activeCall[deCall].points;
 | 
				
			||||||
 | 
					        if(points>maxPoints) maxPoints=points;
 | 
				
			||||||
 | 
					        QString t;
 | 
				
			||||||
 | 
					        t = t.asprintf("  %2d  %2d",age,points);
 | 
				
			||||||
 | 
					        t = (deCall + "   ").left(6) + "  " + m_activeCall[deCall].grid4 + t;
 | 
				
			||||||
 | 
					        qDebug() << "cc" << t << m_activeCall.count() << m_recentCall.count();
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void MainWindow::readFromStdout()                             //readFromStdout
 | 
					void MainWindow::readFromStdout()                             //readFromStdout
 | 
				
			||||||
@ -3522,43 +3553,51 @@ void MainWindow::readFromStdout()                             //readFromStdout
 | 
				
			|||||||
          }
 | 
					          }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        qDebug() << "aaa" << int(m_config.special_op_id());
 | 
					        if((m_mode=="FT4" or m_mode=="FT8") and SpecOp::ARRL_DIGI==m_config.special_op_id() and
 | 
				
			||||||
        if(m_mode=="FT8" and SpecOp::ARRL_DIGI==m_config.special_op_id()) {
 | 
					           decodedtext.isStandardMessage()) {
 | 
				
			||||||
// Extract and save information that's relevant for the ARRL Digi contest
 | 
					          // Extract information relevant for the ARRL Digi contest
 | 
				
			||||||
          QString deCall;
 | 
					          QString deCall;
 | 
				
			||||||
          QString deGrid;
 | 
					          QString deGrid;
 | 
				
			||||||
          decodedtext.deCallAndGrid(/*out*/deCall,deGrid);
 | 
					          decodedtext.deCallAndGrid(/*out*/deCall,deGrid);
 | 
				
			||||||
 | 
					          ActiveCall ac;
 | 
				
			||||||
 | 
					          RecentCall rc;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
          if(deGrid.contains(grid_regexp)) {
 | 
					          if(deGrid.contains(grid_regexp)) {
 | 
				
			||||||
            if(!m_activeCall.contains(deCall)) {
 | 
					             if(!m_activeCall.contains(deCall) or deGrid!=m_activeCall.value(deCall).grid4) {
 | 
				
			||||||
              m_activeCall[deCall]=deGrid;
 | 
					               // Transmitting station's call is not already in QMap "m_activeCall", or grid has changed.
 | 
				
			||||||
              double utch=0.0;
 | 
					               // Insert the call, grid, and associated fixed data into the list.
 | 
				
			||||||
              int nAz,nEl,nDmiles,nDkm,nHotAz,nHotABetter;
 | 
					               double utch=0.0;
 | 
				
			||||||
              azdist_(const_cast <char *> (m_config.my_grid().left(4).toLatin1().constData()),
 | 
					               int nAz,nEl,nDmiles,nDkm,nHotAz,nHotABetter;
 | 
				
			||||||
                      const_cast <char *> (deGrid.left(4).toLatin1().constData()),&utch,
 | 
					               azdist_(const_cast <char *> (m_config.my_grid().left(4).toLatin1().constData()),
 | 
				
			||||||
                      &nAz,&nEl,&nDmiles,&nDkm,&nHotAz,&nHotABetter,(FCL)6,(FCL)6);
 | 
					                       const_cast <char *> (deGrid.left(4).toLatin1().constData()),&utch,
 | 
				
			||||||
              int npts=int((500+nDkm)/500);
 | 
					                       &nAz,&nEl,&nDmiles,&nDkm,&nHotAz,&nHotABetter,(FCL)6,(FCL)6);
 | 
				
			||||||
              RecentCall rc;
 | 
					               int npts=int((500+nDkm)/500);
 | 
				
			||||||
              rc.audioFreq=decodedtext.frequencyOffset();
 | 
					               ac.grid4=deGrid;
 | 
				
			||||||
              rc.az=nAz;
 | 
					               ac.az=nAz;
 | 
				
			||||||
              rc.decodeTime=decodedtext.timeInSeconds();
 | 
					               ac.points=npts;
 | 
				
			||||||
              rc.dialFreq=m_freqNominal;
 | 
					               m_activeCall[deCall]=ac;
 | 
				
			||||||
              rc.grid4=deGrid;
 | 
					             }
 | 
				
			||||||
              rc.points=npts;
 | 
					          }
 | 
				
			||||||
              rc.snr=decodedtext.snr();
 | 
					
 | 
				
			||||||
              m_recentCall[deCall]=rc;
 | 
					          if(m_activeCall.contains(deCall)) {
 | 
				
			||||||
              qDebug() << "aa" << rc.points << deCall << rc.grid4 << rc.az << rc.snr
 | 
					            // Update the variable data for this deCall
 | 
				
			||||||
                       << rc.dialFreq/1000000.0 << rc.audioFreq << rc.decodeTime;
 | 
					            rc.dialFreq=m_freqNominal;
 | 
				
			||||||
            }
 | 
					            rc.audioFreq=decodedtext.frequencyOffset();
 | 
				
			||||||
          } else {
 | 
					            rc.snr=decodedtext.snr();
 | 
				
			||||||
            if(m_activeCall.contains(deCall)) {
 | 
					            m_latestDecodeTime=decodedtext.timeInSeconds();
 | 
				
			||||||
              m_recentCall[deCall].decodeTime=decodedtext.timeInSeconds();
 | 
					            rc.ready2call=false;
 | 
				
			||||||
              RecentCall rc=m_recentCall[deCall];
 | 
					            bool bCQ=decodedtext.messageWords()[0].left(3)=="CQ ";
 | 
				
			||||||
              qDebug() << "bb" << rc.points << deCall << rc.grid4 << rc.az << rc.snr
 | 
					            if(bCQ or deGrid=="RR73" or deGrid=="73") rc.ready2call=true;
 | 
				
			||||||
                       << rc.dialFreq/1000000.0 << rc.audioFreq << rc.decodeTime;
 | 
					            rc.decodeTime=m_latestDecodeTime;
 | 
				
			||||||
 | 
					            m_recentCall[deCall]=rc;
 | 
				
			||||||
 | 
					            ac=m_activeCall[deCall];
 | 
				
			||||||
 | 
					            if(rc.ready2call != bCQ) {
 | 
				
			||||||
 | 
					              qDebug() << "aa" << deCall << ac.grid4 << ac.az
 | 
				
			||||||
 | 
					                       << rc.dialFreq/1000000.0 << rc.audioFreq
 | 
				
			||||||
 | 
					                       << rc.snr << rc.decodeTime << ac.points << rc.ready2call << bCQ;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//Right (Rx Frequency) window
 | 
					//Right (Rx Frequency) window
 | 
				
			||||||
@ -3609,7 +3648,6 @@ void MainWindow::readFromStdout()                             //readFromStdout
 | 
				
			|||||||
                  genStdMsgs("-10");
 | 
					                  genStdMsgs("-10");
 | 
				
			||||||
                  setTxMsg(3);
 | 
					                  setTxMsg(3);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
//                qDebug() << "cc" << m_deCall << m_deGrid << npts << m_maxPoints;
 | 
					 | 
				
			||||||
              }
 | 
					              }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -493,6 +493,7 @@ private:
 | 
				
			|||||||
  qint32  m_earlyDecode2=47;
 | 
					  qint32  m_earlyDecode2=47;
 | 
				
			||||||
  qint32  m_nDecodes=0;
 | 
					  qint32  m_nDecodes=0;
 | 
				
			||||||
  qint32  m_maxPoints=-1;
 | 
					  qint32  m_maxPoints=-1;
 | 
				
			||||||
 | 
					  qint32  m_latestDecodeTime=-1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  bool    m_btxok;		//True if OK to transmit
 | 
					  bool    m_btxok;		//True if OK to transmit
 | 
				
			||||||
  bool    m_diskData;
 | 
					  bool    m_diskData;
 | 
				
			||||||
@ -673,18 +674,23 @@ private:
 | 
				
			|||||||
  };
 | 
					  };
 | 
				
			||||||
  QMap<QString,FixupQSO> m_fixupQSO;       //Key = HoundCall, value = info for QSO in progress
 | 
					  QMap<QString,FixupQSO> m_fixupQSO;       //Key = HoundCall, value = info for QSO in progress
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  struct RecentCall
 | 
					  struct ActiveCall
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    QString grid4;
 | 
					    QString grid4;
 | 
				
			||||||
    qint32 az;
 | 
					    qint32 az;
 | 
				
			||||||
    qint32 snr;
 | 
					    qint32 points;
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					  QMap<QString,ActiveCall> m_activeCall;   //Key = callsign, value = grid4, az, points for ARRL_DIGI
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  struct RecentCall
 | 
				
			||||||
 | 
					  {
 | 
				
			||||||
    qint64 dialFreq;
 | 
					    qint64 dialFreq;
 | 
				
			||||||
    qint32 audioFreq;
 | 
					    qint32 audioFreq;
 | 
				
			||||||
    qint32 points;
 | 
					    qint32 snr;
 | 
				
			||||||
    qint32 decodeTime;
 | 
					    qint32 decodeTime;
 | 
				
			||||||
 | 
					    bool   ready2call;
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
  QMap<QString,RecentCall> m_recentCall;
 | 
					  QMap<QString,RecentCall> m_recentCall;   //Key = callsign, value = snr, dialFreq, audioFreq, decodeTime
 | 
				
			||||||
  QMap<QString,QString> m_activeCall;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  QQueue<QString> m_houndQueue;        //Selected Hounds available for starting a QSO
 | 
					  QQueue<QString> m_houndQueue;        //Selected Hounds available for starting a QSO
 | 
				
			||||||
  QQueue<QString> m_foxQSOinProgress;  //QSOs in progress: Fox has sent a report
 | 
					  QQueue<QString> m_foxQSOinProgress;  //QSOs in progress: Fox has sent a report
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user