diff --git a/mainwindow.cpp b/mainwindow.cpp index de179e94f..f6ed78049 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -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(xpbTxNext->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 (); diff --git a/mainwindow.h b/mainwindow.h index fb207112d..c670a6283 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -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; diff --git a/plotter.cpp b/plotter.cpp index ff2b896d7..dcbec62b0 100644 --- a/plotter.cpp +++ b/plotter.cpp @@ -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; i254) 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); } diff --git a/widegraph.cpp b/widegraph.cpp index 0f1dfd87d..a92cffd05 100644 --- a/widegraph.cpp +++ b/widegraph.cpp @@ -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 && ntrwidePlot->draw(swide,true); @@ -426,3 +428,8 @@ int WideGraph::smoothYellow() { return m_nsmo; } + +void WideGraph::setWSPRtransmitted() +{ + m_bHaveTransmitted=true; +} diff --git a/widegraph.h b/widegraph.h index 3b8f99ac3..db71dabb7 100644 --- a/widegraph.h +++ b/widegraph.h @@ -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;