mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-05-24 10:22:26 -04:00
New Echo-mode features may be actually working, now. Needs testing!
This commit is contained in:
parent
c774e71bfe
commit
d70f637632
@ -189,6 +189,7 @@ public:
|
|||||||
bool highlight_DXcall () const;
|
bool highlight_DXcall () const;
|
||||||
bool highlight_DXgrid () const;
|
bool highlight_DXgrid () const;
|
||||||
|
|
||||||
|
// 0 1 2 3 4 5 6 7 8
|
||||||
enum class SpecialOperatingActivity {NONE, NA_VHF, EU_VHF, FIELD_DAY, RTTY, WW_DIGI, ARRL_DIGI, FOX, HOUND};
|
enum class SpecialOperatingActivity {NONE, NA_VHF, EU_VHF, FIELD_DAY, RTTY, WW_DIGI, ARRL_DIGI, FOX, HOUND};
|
||||||
SpecialOperatingActivity special_op_id () const;
|
SpecialOperatingActivity special_op_id () const;
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ void Astro::write_settings ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto Astro::astroUpdate(QDateTime const& t, QString const& mygrid, QString const& hisgrid, Frequency freq,
|
auto Astro::astroUpdate(QDateTime const& t, QString const& mygrid, QString const& hisgrid, Frequency freq,
|
||||||
bool dx_is_self, bool bTx, bool no_tx_QSY, double TR_period) -> Correction
|
bool bEchoMode, bool bTx, bool bAuto, bool no_tx_QSY, double TR_period) -> Correction
|
||||||
{
|
{
|
||||||
Frequency freq_moon {freq};
|
Frequency freq_moon {freq};
|
||||||
double azsun,elsun,azmoon,elmoon,azmoondx,elmoondx;
|
double azsun,elsun,azmoon,elmoon,azmoondx,elmoondx;
|
||||||
@ -121,6 +121,7 @@ auto Astro::astroUpdate(QDateTime const& t, QString const& mygrid, QString const
|
|||||||
AzElFileName.toLocal8Bit ().constData (),
|
AzElFileName.toLocal8Bit ().constData (),
|
||||||
jpleph.toLocal8Bit ().constData ());
|
jpleph.toLocal8Bit ().constData ());
|
||||||
|
|
||||||
|
// qDebug() << "AA1" << m_dop00 << m_dop << width1 << width2;
|
||||||
QString message;
|
QString message;
|
||||||
{
|
{
|
||||||
QTextStream out {&message};
|
QTextStream out {&message};
|
||||||
@ -159,6 +160,12 @@ auto Astro::astroUpdate(QDateTime const& t, QString const& mygrid, QString const
|
|||||||
ui_->text_label->setText(message);
|
ui_->text_label->setText(message);
|
||||||
|
|
||||||
Correction correction;
|
Correction correction;
|
||||||
|
correction.dop=m_dop00;
|
||||||
|
correction.width=width1;
|
||||||
|
if(hisgrid!="" and !bAuto) {
|
||||||
|
correction.dop=m_dop;
|
||||||
|
correction.width=width2;
|
||||||
|
}
|
||||||
if (ui_->cbDopplerTracking->isChecked ()) {
|
if (ui_->cbDopplerTracking->isChecked ()) {
|
||||||
switch (m_DopplerMethod)
|
switch (m_DopplerMethod)
|
||||||
{
|
{
|
||||||
@ -170,7 +177,7 @@ auto Astro::astroUpdate(QDateTime const& t, QString const& mygrid, QString const
|
|||||||
break;
|
break;
|
||||||
//case 5: // All Doppler correction done here; DX station stays at nominal dial frequency.
|
//case 5: // All Doppler correction done here; DX station stays at nominal dial frequency.
|
||||||
case 3: // Both stations do full correction on Rx and none on Tx
|
case 3: // Both stations do full correction on Rx and none on Tx
|
||||||
//correction.rx = dx_is_self ? m_dop00 : m_dop;
|
//correction.rx = bEchoMode ? m_dop00 : m_dop;
|
||||||
correction.rx = m_dop00; // Now always sets RX to *own* echo freq
|
correction.rx = m_dop00; // Now always sets RX to *own* echo freq
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
@ -195,7 +202,7 @@ auto Astro::astroUpdate(QDateTime const& t, QString const& mygrid, QString const
|
|||||||
}
|
}
|
||||||
//if (3 != m_DopplerMethod || 4 != m_DopplerMethod) correction.tx = -correction.rx;
|
//if (3 != m_DopplerMethod || 4 != m_DopplerMethod) correction.tx = -correction.rx;
|
||||||
|
|
||||||
if(dx_is_self && m_DopplerMethod == 1) correction.rx = 0;
|
if(bEchoMode && m_DopplerMethod == 1) correction.rx = 0;
|
||||||
|
|
||||||
if (no_tx_QSY && 3 != m_DopplerMethod && 0 != m_DopplerMethod)
|
if (no_tx_QSY && 3 != m_DopplerMethod && 0 != m_DopplerMethod)
|
||||||
{
|
{
|
||||||
@ -229,7 +236,7 @@ auto Astro::astroUpdate(QDateTime const& t, QString const& mygrid, QString const
|
|||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
// All Doppler correction done here; DX station stays at nominal dial frequency.
|
// All Doppler correction done here; DX station stays at nominal dial frequency.
|
||||||
offset = dx_is_self ? m_dop00 : m_dop;
|
offset = bEchoMode ? m_dop00 : m_dop;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
@ -250,9 +257,8 @@ auto Astro::astroUpdate(QDateTime const& t, QString const& mygrid, QString const
|
|||||||
//qDebug () << "correction.tx (no tx qsy):" << correction.tx;
|
//qDebug () << "correction.tx (no tx qsy):" << correction.tx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
correction.wself=width1;
|
|
||||||
correction.wdx=width2;
|
// qDebug() << "AA0" << m_DopplerMethod << bAuto << correction.tx << correction.rx << correction.width;
|
||||||
qDebug() << "AA0" << m_DopplerMethod << m_dop00 << m_dop << correction.rx << correction.wself << correction.wdx;
|
|
||||||
return correction;
|
return correction;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -342,6 +348,16 @@ bool Astro::bDither()
|
|||||||
return ui_->cbDither->isChecked();
|
return ui_->cbDither->isChecked();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Astro::selectOwnEcho()
|
||||||
|
{
|
||||||
|
ui_->rbOwnEcho->click();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Astro::selectOnDxEcho()
|
||||||
|
{
|
||||||
|
ui_->rbOnDxEcho->click();
|
||||||
|
}
|
||||||
|
|
||||||
qint32 Astro::nfRIT()
|
qint32 Astro::nfRIT()
|
||||||
{
|
{
|
||||||
if(m_DopplerMethod==0) {
|
if(m_DopplerMethod==0) {
|
||||||
|
@ -32,8 +32,8 @@ public:
|
|||||||
Correction ()
|
Correction ()
|
||||||
: rx {0}
|
: rx {0}
|
||||||
, tx {0}
|
, tx {0}
|
||||||
, wself {0}
|
, dop {0}
|
||||||
, wdx {0}
|
, width {0}
|
||||||
{}
|
{}
|
||||||
Correction (Correction const&) = default;
|
Correction (Correction const&) = default;
|
||||||
Correction& operator = (Correction const&) = default;
|
Correction& operator = (Correction const&) = default;
|
||||||
@ -47,8 +47,8 @@ public:
|
|||||||
|
|
||||||
FrequencyDelta rx;
|
FrequencyDelta rx;
|
||||||
FrequencyDelta tx;
|
FrequencyDelta tx;
|
||||||
double wself;
|
double dop;
|
||||||
double wdx;
|
double width;
|
||||||
};
|
};
|
||||||
|
|
||||||
Correction astroUpdate(QDateTime const& t,
|
Correction astroUpdate(QDateTime const& t,
|
||||||
@ -57,11 +57,14 @@ public:
|
|||||||
Frequency frequency,
|
Frequency frequency,
|
||||||
bool dx_is_self,
|
bool dx_is_self,
|
||||||
bool bTx,
|
bool bTx,
|
||||||
|
bool bAuto,
|
||||||
bool no_tx_QSY,
|
bool no_tx_QSY,
|
||||||
double TR_period);
|
double TR_period);
|
||||||
|
|
||||||
bool doppler_tracking () const;
|
bool doppler_tracking () const;
|
||||||
bool bDither();
|
bool bDither();
|
||||||
|
void selectOwnEcho();
|
||||||
|
void selectOnDxEcho();
|
||||||
qint32 nfRIT();
|
qint32 nfRIT();
|
||||||
|
|
||||||
Q_SLOT void nominal_frequency (Frequency rx, Frequency tx);
|
Q_SLOT void nominal_frequency (Frequency rx, Frequency tx);
|
||||||
@ -74,8 +77,8 @@ protected:
|
|||||||
private slots:
|
private slots:
|
||||||
void on_rbConstFreqOnMoon_clicked(bool);
|
void on_rbConstFreqOnMoon_clicked(bool);
|
||||||
void on_rbFullTrack_clicked(bool);
|
void on_rbFullTrack_clicked(bool);
|
||||||
void on_rbOwnEcho_clicked(bool);
|
|
||||||
void on_rbNoDoppler_clicked(bool);
|
void on_rbNoDoppler_clicked(bool);
|
||||||
|
void on_rbOwnEcho_clicked(bool);
|
||||||
void on_rbOnDxEcho_clicked(bool);
|
void on_rbOnDxEcho_clicked(bool);
|
||||||
void on_rbCallDx_clicked(bool);
|
void on_rbCallDx_clicked(bool);
|
||||||
void on_cbDopplerTracking_toggled(bool);
|
void on_cbDopplerTracking_toggled(bool);
|
||||||
|
@ -1589,16 +1589,18 @@ void MainWindow::dataSink(qint64 frames)
|
|||||||
if(m_mode=="Echo") {
|
if(m_mode=="Echo") {
|
||||||
float dBerr=0.0;
|
float dBerr=0.0;
|
||||||
int nfrit=0;
|
int nfrit=0;
|
||||||
|
if(m_astroWidget) nfrit=m_astroWidget->nfRIT();
|
||||||
int nauto=0;
|
int nauto=0;
|
||||||
if(m_auto) nauto=1;
|
if(m_auto) nauto=1;
|
||||||
int nqual=0;
|
int nqual=0;
|
||||||
float f1=1500.0;
|
float f1=1500.0 + m_fDither;
|
||||||
float xlevel=0.0;
|
float xlevel=0.0;
|
||||||
float sigdb=0.0;
|
float sigdb=0.0;
|
||||||
float dfreq=0.0;
|
float dfreq=0.0;
|
||||||
float width=0.0;
|
float width=0.0;
|
||||||
echocom_.nclearave=m_nclearave;
|
echocom_.nclearave=m_nclearave;
|
||||||
int nDop=0;
|
int nDop=m_fAudioShift;
|
||||||
|
// qDebug() << "bb" << m_s6 << f1 << nfrit << nDop;
|
||||||
avecho_(dec_data.d2,&nDop,&nfrit,&nauto,&nqual,&f1,&xlevel,&sigdb,
|
avecho_(dec_data.d2,&nDop,&nfrit,&nauto,&nqual,&f1,&xlevel,&sigdb,
|
||||||
&dBerr,&dfreq,&width);
|
&dBerr,&dfreq,&width);
|
||||||
QString t;
|
QString t;
|
||||||
@ -2015,9 +2017,14 @@ void MainWindow::on_autoButton_clicked (bool checked)
|
|||||||
if (!checked) m_bCallingCQ = false;
|
if (!checked) m_bCallingCQ = false;
|
||||||
statusUpdate ();
|
statusUpdate ();
|
||||||
m_bEchoTxOK=false;
|
m_bEchoTxOK=false;
|
||||||
if(m_auto and (m_mode=="Echo")) {
|
if(m_mode=="Echo") {
|
||||||
|
if(m_auto) {
|
||||||
m_nclearave=1;
|
m_nclearave=1;
|
||||||
echocom_.nsum=0;
|
echocom_.nsum=0;
|
||||||
|
m_astroWidget->selectOwnEcho();
|
||||||
|
} else {
|
||||||
|
m_astroWidget->selectOnDxEcho();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
m_tAutoOn=QDateTime::currentMSecsSinceEpoch()/1000;
|
m_tAutoOn=QDateTime::currentMSecsSinceEpoch()/1000;
|
||||||
}
|
}
|
||||||
@ -4150,14 +4157,14 @@ void MainWindow::guiUpdate()
|
|||||||
int nsec=ms/1000;
|
int nsec=ms/1000;
|
||||||
double tsec=0.001*ms;
|
double tsec=0.001*ms;
|
||||||
double t2p=fmod(tsec,2*m_TRperiod);
|
double t2p=fmod(tsec,2*m_TRperiod);
|
||||||
double s6=fmod(tsec,6.0);
|
m_s6=fmod(tsec,6.0);
|
||||||
int nseq = fmod(double(nsec),m_TRperiod);
|
int nseq = fmod(double(nsec),m_TRperiod);
|
||||||
m_tRemaining=m_TRperiod - fmod(tsec,m_TRperiod);
|
m_tRemaining=m_TRperiod - fmod(tsec,m_TRperiod);
|
||||||
|
|
||||||
if(m_mode=="Echo") {
|
if(m_mode=="Echo") {
|
||||||
tx1=0.0;
|
tx1=0.0;
|
||||||
tx2=txDuration;
|
tx2=txDuration;
|
||||||
if(m_auto and s6>4.0) m_bEchoTxOK=true;
|
if(m_auto and m_s6>4.0) m_bEchoTxOK=true;
|
||||||
if(m_transmitting) m_bEchoTxed=true;
|
if(m_transmitting) m_bEchoTxed=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4679,7 +4686,7 @@ void MainWindow::guiUpdate()
|
|||||||
|
|
||||||
//Once per second (onesec)
|
//Once per second (onesec)
|
||||||
if(nsec != m_sec0) {
|
if(nsec != m_sec0) {
|
||||||
// qDebug() << "AAA" << nsec;
|
// qDebug() << "AAA" << nsec << (int)m_config.special_op_id() << (int)SpecOp::FOX;
|
||||||
|
|
||||||
if(m_mode=="FST4") chk_FST4_freq_range();
|
if(m_mode=="FST4") chk_FST4_freq_range();
|
||||||
m_currentBand=m_config.bands()->find(m_freqNominal);
|
m_currentBand=m_config.bands()->find(m_freqNominal);
|
||||||
@ -4694,7 +4701,7 @@ void MainWindow::guiUpdate()
|
|||||||
if(m_mode=="Echo") {
|
if(m_mode=="Echo") {
|
||||||
progressBar.setMaximum(3);
|
progressBar.setMaximum(3);
|
||||||
int n=0;
|
int n=0;
|
||||||
if(m_transmitting or m_monitoring) n=int(s6)%3;
|
if(m_transmitting or m_monitoring) n=int(m_s6)%3;
|
||||||
progressBar.setValue(n);
|
progressBar.setValue(n);
|
||||||
}
|
}
|
||||||
if(m_mode!="Echo") {
|
if(m_mode!="Echo") {
|
||||||
@ -7087,6 +7094,7 @@ void MainWindow::on_actionEcho_triggered()
|
|||||||
// 01234567890123456789012345678901234567
|
// 01234567890123456789012345678901234567
|
||||||
displayWidgets(nWidgets("00000000000000000010001000000000000000"));
|
displayWidgets(nWidgets("00000000000000000010001000000000000000"));
|
||||||
fast_config(false);
|
fast_config(false);
|
||||||
|
m_astroWidget->selectOnDxEcho();
|
||||||
statusChanged();
|
statusChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7910,13 +7918,11 @@ void MainWindow::transmit (double snr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(m_mode=="Echo") {
|
if(m_mode=="Echo") {
|
||||||
m_echoFreq=1500.0;
|
m_fDither=0.;
|
||||||
if(m_astroWidget->bDither()) m_echoFreq=1490.0 + QRandomGenerator::global()->bounded(20.0); //Dither by +/- 10 Hz
|
if(m_astroWidget->bDither()) m_fDither = QRandomGenerator::global()->bounded(20.0) - 10.0; //Dither by +/- 10 Hz
|
||||||
Q_EMIT sendMessage (m_mode, 27, 1024.0, m_echoFreq, 0.0, m_soundOutput,
|
Q_EMIT sendMessage (m_mode, 27, 1024.0, 1500.0+m_fDither, 0.0, m_soundOutput,
|
||||||
m_config.audio_output_channel(), false, false, snr, m_TRperiod);
|
m_config.audio_output_channel(), false, false, snr, m_TRperiod);
|
||||||
// qDebug() << "aa" << m_fDop << m_astroWidget->nfRIT()
|
// qDebug() << "aa" << m_s6 << m_freqNominal << m_rigState.frequency() << m_fDither;
|
||||||
// << m_astroWidget->bDither() << m_config.transceiver_resolution ()
|
|
||||||
// << m_freqNominal << m_echoFreq << m_wself << m_wdx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// In auto-sequencing mode, stop after 5 transmissions of "73" message.
|
// In auto-sequencing mode, stop after 5 transmissions of "73" message.
|
||||||
@ -8716,26 +8722,26 @@ void MainWindow::WSPR_scheduling ()
|
|||||||
|
|
||||||
void MainWindow::astroUpdate ()
|
void MainWindow::astroUpdate ()
|
||||||
{
|
{
|
||||||
if (m_astroWidget)
|
if (m_astroWidget) {
|
||||||
{
|
|
||||||
// no Doppler correction while CTRL pressed allows manual tuning
|
// no Doppler correction while CTRL pressed allows manual tuning
|
||||||
if (Qt::ControlModifier & QApplication::queryKeyboardModifiers ()) return;
|
if (Qt::ControlModifier & QApplication::queryKeyboardModifiers ()) return;
|
||||||
|
|
||||||
auto correction = m_astroWidget->astroUpdate(QDateTime::currentDateTimeUtc (),
|
auto correction = m_astroWidget->astroUpdate(QDateTime::currentDateTimeUtc (),
|
||||||
m_config.my_grid(), m_hisGrid,m_freqNominal,"Echo" == m_mode,
|
m_config.my_grid(), m_hisGrid,m_freqNominal,"Echo" == m_mode,
|
||||||
m_transmitting,!m_config.tx_QSY_allowed (),m_TRperiod);
|
m_transmitting,m_auto,!m_config.tx_QSY_allowed (),m_TRperiod);
|
||||||
m_fDop=correction.rx;
|
m_fDop=correction.dop;
|
||||||
m_wself=correction.wself;
|
m_fSpread=correction.width;
|
||||||
m_wdx=correction.wdx;
|
|
||||||
// qDebug() << "cc" << m_fDop << m_wself << m_wdx;
|
|
||||||
|
|
||||||
// no Doppler correction in Tx if rig can't do it
|
if (m_transmitting && !m_config.tx_QSY_allowed ()) return; // No Tx Doppler correction if rig can't do it
|
||||||
if (m_transmitting && !m_config.tx_QSY_allowed ()) return;
|
if (!m_astroWidget->doppler_tracking()) { // We are not using Doppler correction
|
||||||
if (!m_astroWidget->doppler_tracking ()) return;
|
m_fAudioShift=m_fDop;
|
||||||
|
// qDebug() << "cc1" << m_hisGrid << m_auto << m_astroWidget->doppler_tracking()
|
||||||
|
// << m_fSpread << m_fDop << correction.rx << m_fAudioShift;
|
||||||
|
return;
|
||||||
|
}
|
||||||
if ((m_monitoring || m_transmitting)
|
if ((m_monitoring || m_transmitting)
|
||||||
// no Doppler correction below 6m
|
&& m_freqNominal >= 21000000 // No Doppler correction below 15m
|
||||||
&& m_freqNominal >= 50000000
|
&& m_config.split_mode ()) // Doppler correcion needs split mode
|
||||||
&& m_config.split_mode ())
|
|
||||||
{
|
{
|
||||||
// adjust for rig resolution
|
// adjust for rig resolution
|
||||||
if (m_config.transceiver_resolution () > 2)
|
if (m_config.transceiver_resolution () > 2)
|
||||||
@ -8769,17 +8775,14 @@ void MainWindow::astroUpdate ()
|
|||||||
correction.tx = correction.tx / 10 * 10;
|
correction.tx = correction.tx / 10 * 10;
|
||||||
}
|
}
|
||||||
m_astroCorrection = correction;
|
m_astroCorrection = correction;
|
||||||
if (m_reverse_Doppler)
|
if (m_reverse_Doppler) m_astroCorrection.reverse ();
|
||||||
{
|
} else {
|
||||||
m_astroCorrection.reverse ();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_astroCorrection = {};
|
m_astroCorrection = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
setRig ();
|
setRig ();
|
||||||
|
m_fAudioShift=m_fDop - correction.rx;
|
||||||
|
// qDebug() << "cc2" << m_hisGrid << m_auto << m_astroWidget->doppler_tracking()
|
||||||
|
// << m_fSpread << m_fDop << correction.rx << m_fAudioShift;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -432,9 +432,10 @@ private:
|
|||||||
|
|
||||||
double m_tRemaining;
|
double m_tRemaining;
|
||||||
double m_TRperiod;
|
double m_TRperiod;
|
||||||
double m_echoFreq=1500.0;
|
double m_fSpread;
|
||||||
double m_wself;
|
double m_s6;
|
||||||
double m_wdx;
|
double m_fDither;
|
||||||
|
double m_fAudioShift;
|
||||||
|
|
||||||
float m_DTtol;
|
float m_DTtol;
|
||||||
float m_t0;
|
float m_t0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user