mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2026-06-07 16:34:55 -04:00
Try letting hopping.f90 determine TX intervals
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@5472 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
+26
-24
@@ -1,4 +1,4 @@
|
||||
//--------------------------------------------------------- MainWindow
|
||||
//-------------------------------------------------------- MainWindow
|
||||
|
||||
#include "mainwindow.h"
|
||||
#include <cinttypes>
|
||||
@@ -393,7 +393,6 @@ 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;
|
||||
@@ -971,7 +970,7 @@ void MainWindow::on_actionAbout_triggered() //Display "About"
|
||||
void MainWindow::on_autoButton_clicked (bool checked)
|
||||
{
|
||||
m_auto = checked;
|
||||
// qDebug() << "autoButton_clicked" << m_auto << m_tuneup;
|
||||
qDebug() << "autoButton_clicked" << m_auto << m_tuneup;
|
||||
|
||||
m_messageClient->status_update (m_dialFreq, m_mode, m_hisCall,
|
||||
QString::number (ui->rptSpinBox->value ()),
|
||||
@@ -1829,29 +1828,29 @@ 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_bHaveTransmitted) btx=false; //Normally, no two consecutive transmissions
|
||||
// if(m_ntr == -1) 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;
|
||||
if(m_pctx<50) {
|
||||
m_nrx=int(m_rxavg + 3.0*(x-0.5) + 0.5);
|
||||
} else {
|
||||
m_nrx=0;
|
||||
if(x<m_rxavg) m_nrx=1;
|
||||
}
|
||||
// float x=(float)rand()/RAND_MAX;
|
||||
// if(m_pctx<50) {
|
||||
// m_nrx=int(m_rxavg + 3.0*(x-0.5) + 0.5);
|
||||
// } else {
|
||||
// m_nrx=0;
|
||||
// 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_bHaveTransmitted=false;
|
||||
m_bTxTime=false; //Start a WSPR Rx sequence
|
||||
m_bTxTime=false; //Start a WSPR Rx sequence
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1906,10 +1905,10 @@ void MainWindow::guiUpdate()
|
||||
m_btxok=false;
|
||||
}
|
||||
if(m_ntr==1) {
|
||||
if(m_bandHopping) {
|
||||
// if(m_bandHopping) {
|
||||
// qDebug() << "Call bandHopping after Rx" << m_nseq << m_ntr << m_nrx << m_rxDone;
|
||||
bandHopping();
|
||||
}
|
||||
// }
|
||||
m_ntr=0; //This WSPR Rx sequence is complete
|
||||
}
|
||||
}
|
||||
@@ -2229,7 +2228,7 @@ void MainWindow::startTx2()
|
||||
transmit (snr);
|
||||
signalMeter->setValue(0);
|
||||
if(m_mode.mid(0,4)=="WSPR" and !m_tune) {
|
||||
t = " Transmiting " + m_mode + " ----------------------- " +
|
||||
t = " Transmitting " + m_mode + " ----------------------- " +
|
||||
QString {m_config.bands ()->find (m_dialFreq)->name_};
|
||||
ui->decodedTextBrowser->append(t.rightJustified (71, '-'));
|
||||
|
||||
@@ -2272,11 +2271,10 @@ 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) {
|
||||
// if(m_bandHopping) {
|
||||
// qDebug () << "Call bandHopping after Tx" << m_tuneup;
|
||||
bandHopping();
|
||||
}
|
||||
// }
|
||||
m_ntr=0;
|
||||
}
|
||||
}
|
||||
@@ -4298,14 +4296,14 @@ void MainWindow::bandHopping()
|
||||
const_cast <char *> (m_config.my_grid ().toLatin1().constData()),
|
||||
&m_grayDuration, &m_pctx, &isun, &iband0, &ntxnext, 6);
|
||||
|
||||
/*
|
||||
|
||||
if(m_auto and ntxnext==1) {
|
||||
m_nrx=0;
|
||||
} else {
|
||||
m_nrx=1;
|
||||
}
|
||||
*/
|
||||
|
||||
if( m_bandHopping ) {
|
||||
QString bname;
|
||||
QStringList s;
|
||||
if(isun==0) s=m_sunriseBands;
|
||||
@@ -4339,7 +4337,9 @@ void MainWindow::bandHopping()
|
||||
}
|
||||
}
|
||||
|
||||
QThread::msleep(500); //### ??? Is this OK to do ??? ###
|
||||
QThread::msleep(1500);
|
||||
|
||||
// qDebug() << nhr << nmin << int(sec) << bname << f0 << 0.000001*f0;
|
||||
|
||||
m_band00=iband;
|
||||
auto frequencies = m_config.frequencies ();
|
||||
@@ -4392,6 +4392,8 @@ void MainWindow::bandHopping()
|
||||
on_tuneButton_clicked(true);
|
||||
tuneATU_Timer->start(2500);
|
||||
}
|
||||
} //endif m_bandHopping
|
||||
|
||||
}
|
||||
|
||||
void MainWindow::on_pushButton_clicked()
|
||||
|
||||
Reference in New Issue
Block a user