mirror of
				https://github.com/saitohirga/WSJT-X.git
				synced 2025-11-03 13:30:52 -05:00 
			
		
		
		
	WSPR-mode behavior changes.
Forbid consecutive Tx sequences. Mark Tx sequences with horizontal yellow line in waterfall. Reduce the wait time in msleep() command (mainwindow.cpp line 4342). git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@5470 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
		
							parent
							
								
									94fc6fe63c
								
							
						
					
					
						commit
						7390bf21ce
					
				@ -393,6 +393,7 @@ MainWindow::MainWindow(bool multiple, QSettings * settings, QSharedMemory *shdme
 | 
			
		||||
  m_bTxTime=false;
 | 
			
		||||
  m_band00=-1;
 | 
			
		||||
  m_rxDone=false;
 | 
			
		||||
  m_bHaveTransmitted=false;
 | 
			
		||||
 | 
			
		||||
  m_fWSPR["160"]=1.8366;                //WSPR frequencies
 | 
			
		||||
  m_fWSPR["80"]=3.5926;
 | 
			
		||||
@ -1828,12 +1829,10 @@ void MainWindow::guiUpdate()
 | 
			
		||||
      m_tuneup=false;                              //This is not an ATU tuneup
 | 
			
		||||
      if(m_pctx==0) m_nrx=1;                       //Don't transmit if m_pctx=0
 | 
			
		||||
      bool btx = m_auto and (m_nrx<=0);            //To Tx, we need m_auto and Rx sequsnce finished
 | 
			
		||||
      if(m_ntr == -1) btx=false;                   //Normally, no two consecutive transmissions
 | 
			
		||||
      if(m_bHaveTransmitted) btx=false;            //Normally, no two consecutive transmissions
 | 
			
		||||
      if(m_auto and m_txNext) btx=true;            //TxNext button overrides
 | 
			
		||||
      if(m_auto and m_pctx==100) btx=true;         //Always transmit
 | 
			
		||||
 | 
			
		||||
//      qDebug() << "B" << m_pctx << m_auto << m_nrx << m_ntr << m_txNext;
 | 
			
		||||
 | 
			
		||||
      if(btx) {
 | 
			
		||||
// This will be a WSPR Tx sequence. Compute # of Rx's that should follow.
 | 
			
		||||
        float x=(float)rand()/RAND_MAX;
 | 
			
		||||
@ -1844,13 +1843,15 @@ void MainWindow::guiUpdate()
 | 
			
		||||
          if(x<m_rxavg) m_nrx=1;
 | 
			
		||||
        }
 | 
			
		||||
        m_ntr=-1;                          //This says we will have transmitted
 | 
			
		||||
        m_bHaveTransmitted=true;
 | 
			
		||||
        m_txNext=false;
 | 
			
		||||
        ui->pbTxNext->setChecked(false);
 | 
			
		||||
        m_bTxTime=true;                      //Start a WSPR Tx sequence
 | 
			
		||||
        m_bTxTime=true;                    //Start a WSPR Tx sequence
 | 
			
		||||
      } else {
 | 
			
		||||
// This will be a WSPR Rx sequence.
 | 
			
		||||
        m_ntr=1;                           //This says we will have received
 | 
			
		||||
        m_bTxTime=false;                     //Start a WSPR Rx sequence
 | 
			
		||||
        m_bHaveTransmitted=false;
 | 
			
		||||
        m_bTxTime=false;                   //Start a WSPR Rx sequence
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -2271,8 +2272,9 @@ void MainWindow::stopTx2()
 | 
			
		||||
    m_repeatMsg=0;
 | 
			
		||||
  }
 | 
			
		||||
  if(m_mode.mid(0,4)=="WSPR" and m_ntr==-1 and !m_tuneup) {
 | 
			
		||||
    m_wideGraph->setWSPRtransmitted();
 | 
			
		||||
    if(m_bandHopping) {
 | 
			
		||||
      qDebug () << "Call bandHopping after Tx" << m_tuneup;
 | 
			
		||||
//      qDebug () << "Call bandHopping after Tx" << m_tuneup;
 | 
			
		||||
      bandHopping();
 | 
			
		||||
    }
 | 
			
		||||
    m_ntr=0;
 | 
			
		||||
@ -4337,9 +4339,7 @@ void MainWindow::bandHopping()
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  QThread::msleep(1500);
 | 
			
		||||
 | 
			
		||||
//  qDebug() << nhr << nmin << int(sec) << bname << f0 << 0.000001*f0;
 | 
			
		||||
  QThread::msleep(500);                //### ??? Is this OK to do ??? ###
 | 
			
		||||
 | 
			
		||||
  m_band00=iband;
 | 
			
		||||
  auto frequencies = m_config.frequencies ();
 | 
			
		||||
 | 
			
		||||
@ -384,6 +384,7 @@ private:
 | 
			
		||||
  bool    m_tuneup;
 | 
			
		||||
  bool    m_bTxTime;
 | 
			
		||||
  bool    m_rxDone;
 | 
			
		||||
  bool    m_bHaveTransmitted;    //Can be used to prohibit consecutive WSPR transmittions
 | 
			
		||||
 | 
			
		||||
  float   m_pctZap;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -6,8 +6,6 @@
 | 
			
		||||
 | 
			
		||||
#define MAX_SCREENSIZE 2048
 | 
			
		||||
 | 
			
		||||
//float swide0[2048];
 | 
			
		||||
 | 
			
		||||
CPlotter::CPlotter(QWidget *parent) :                  //CPlotter Constructor
 | 
			
		||||
  QFrame(parent)
 | 
			
		||||
{
 | 
			
		||||
@ -128,15 +126,15 @@ void CPlotter::draw(float swide[], bool bScroll)                            //dr
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  float ymin=1.e30;
 | 
			
		||||
  if(swide[0]>1.e29 and swide[0]< 1.5e30) painter1.setPen(Qt::green);
 | 
			
		||||
  if(swide[0]>1.4e30) painter1.setPen(Qt::yellow);
 | 
			
		||||
  for(int i=0; i<iz; i++) {
 | 
			
		||||
    //    swide0[i]=swide[i];
 | 
			
		||||
    y=swide[i];
 | 
			
		||||
    if(y<ymin) ymin=y;
 | 
			
		||||
    int y1 = 10.0*gain*y + 10*m_plotZero +40;
 | 
			
		||||
    if (y1<0) y1=0;
 | 
			
		||||
    if (y1>254) y1=254;
 | 
			
		||||
    if (swide[i]>1.e29) y1=255;
 | 
			
		||||
    painter1.setPen(m_ColorTbl[y1]);
 | 
			
		||||
    if (swide[i]<1.e29) painter1.setPen(m_ColorTbl[y1]);
 | 
			
		||||
    painter1.drawPoint(i,0);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -90,8 +90,7 @@ WideGraph::WideGraph(QSettings * settings, QWidget *parent) :
 | 
			
		||||
  ui->paletteComboBox->addItem (user_defined);
 | 
			
		||||
  if (user_defined == m_waterfallPalette) ui->paletteComboBox->setCurrentIndex(index);
 | 
			
		||||
  readPalette ();
 | 
			
		||||
 | 
			
		||||
  //  ui->paletteComboBox->lineEdit()->setAlignment(Qt::AlignHCenter);
 | 
			
		||||
  m_bHaveTransmitted=false;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
WideGraph::~WideGraph ()
 | 
			
		||||
@ -163,9 +162,12 @@ void WideGraph::dataSink2(float s[], float df3, int ihsym, int ndiskdata)  //dat
 | 
			
		||||
    qint64 ms = QDateTime::currentMSecsSinceEpoch() % 86400000;
 | 
			
		||||
    int ntr = (ms/1000) % m_TRperiod;
 | 
			
		||||
    if((ndiskdata && ihsym <= m_waterfallAvg) || (!ndiskdata && ntr<m_ntr0)) {
 | 
			
		||||
      float flagValue=1.0e30;
 | 
			
		||||
      if(m_bHaveTransmitted) flagValue=2.0e30;
 | 
			
		||||
      for (int i=0; i<2048; i++) {
 | 
			
		||||
        swide[i] = 1.e30;
 | 
			
		||||
        swide[i] = flagValue;
 | 
			
		||||
      }
 | 
			
		||||
      m_bHaveTransmitted=false;
 | 
			
		||||
    }
 | 
			
		||||
    m_ntr0=ntr;
 | 
			
		||||
    ui->widePlot->draw(swide,true);
 | 
			
		||||
@ -426,3 +428,8 @@ int WideGraph::smoothYellow()
 | 
			
		||||
{
 | 
			
		||||
  return m_nsmo;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void WideGraph::setWSPRtransmitted()
 | 
			
		||||
{
 | 
			
		||||
  m_bHaveTransmitted=true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -42,6 +42,7 @@ public:
 | 
			
		||||
  void   setTol(int n);
 | 
			
		||||
  int    smoothYellow();
 | 
			
		||||
  void   setRxBand(QString band);
 | 
			
		||||
  void   setWSPRtransmitted();
 | 
			
		||||
 | 
			
		||||
signals:
 | 
			
		||||
  void freezeDecode2(int n);
 | 
			
		||||
@ -95,6 +96,7 @@ private:
 | 
			
		||||
 | 
			
		||||
  bool   m_lockTxFreq;
 | 
			
		||||
  bool   m_bFlatten;
 | 
			
		||||
  bool   m_bHaveTransmitted;    //Set true at end of a WSPR transmission
 | 
			
		||||
 | 
			
		||||
  QString m_mode;
 | 
			
		||||
  QString m_modeTx;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user