SVN r8568
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 29 KiB |
@@ -1,486 +0,0 @@
|
||||
#include "WSPRBandHopping.hpp"
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <QPointer>
|
||||
#include <QSettings>
|
||||
#include <QBitArray>
|
||||
#include <QList>
|
||||
#include <QSet>
|
||||
#include <QtWidgets>
|
||||
|
||||
#include "SettingsGroup.hpp"
|
||||
#include "Configuration.hpp"
|
||||
#include "Bands.hpp"
|
||||
#include "FrequencyList.hpp"
|
||||
#include "WsprTxScheduler.h"
|
||||
#include "pimpl_impl.hpp"
|
||||
#include "moc_WSPRBandHopping.cpp"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#ifndef CMAKE_BUILD
|
||||
#define FC_grayline grayline_
|
||||
#else
|
||||
#include "FC.h"
|
||||
void FC_grayline (int const * year, int const * month, int const * nday, float const * uth, char const * my_grid
|
||||
, int const * nduration, int * isun
|
||||
, int my_grid_len);
|
||||
#endif
|
||||
};
|
||||
|
||||
namespace
|
||||
{
|
||||
char const * const title = "WSPR Band Hopping";
|
||||
char const * const periods[] = {"Sunrise grayline", "Day", "Sunset grayline", "Night", "Tune", "Rx only"};
|
||||
size_t constexpr num_periods {sizeof (periods) / sizeof (periods[0])};
|
||||
// These 10 bands are globally coordinated
|
||||
QList<QString> const coordinated_bands = {"160m", "80m", "60m", "40m", "30m", "20m", "17m", "15m", "12m", "10m"};
|
||||
}
|
||||
|
||||
//
|
||||
// Dialog - maintenance of band hopping options
|
||||
//
|
||||
class Dialog
|
||||
: public QDialog
|
||||
{
|
||||
public:
|
||||
using BandList = QList<QString>;
|
||||
|
||||
Dialog (QSettings *, Configuration const *, BandList const * WSPT_bands, QBitArray * bands
|
||||
, int * gray_line_duration, QWidget * parent = nullptr);
|
||||
~Dialog ();
|
||||
|
||||
Q_SLOT void frequencies_changed ();
|
||||
void resize_to_maximum ();
|
||||
|
||||
private:
|
||||
void closeEvent (QCloseEvent *) override;
|
||||
void save_window_state ();
|
||||
|
||||
QSettings * settings_;
|
||||
Configuration const * configuration_;
|
||||
BandList const * WSPR_bands_;
|
||||
QBitArray * bands_;
|
||||
int * gray_line_duration_;
|
||||
QPointer<QTableWidget> bands_table_;
|
||||
QBrush coord_background_brush_;
|
||||
QPointer<QSpinBox> gray_line_width_spin_box_;
|
||||
static int constexpr band_index_role {Qt::UserRole};
|
||||
};
|
||||
|
||||
Dialog::Dialog (QSettings * settings, Configuration const * configuration, BandList const * WSPR_bands
|
||||
, QBitArray * bands, int * gray_line_duration, QWidget * parent)
|
||||
: QDialog {parent, Qt::Window | Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::WindowMinimizeButtonHint}
|
||||
, settings_ {settings}
|
||||
, configuration_ {configuration}
|
||||
, WSPR_bands_ {WSPR_bands}
|
||||
, bands_ {bands}
|
||||
, gray_line_duration_ {gray_line_duration}
|
||||
, bands_table_ {new QTableWidget {this}}
|
||||
, coord_background_brush_ {Qt::yellow}
|
||||
, gray_line_width_spin_box_ {new QSpinBox {this}}
|
||||
{
|
||||
setWindowTitle (windowTitle () + ' ' + tr (title));
|
||||
{
|
||||
SettingsGroup g {settings_, title};
|
||||
restoreGeometry (settings_->value ("geometry", saveGeometry ()).toByteArray ());
|
||||
}
|
||||
|
||||
QVBoxLayout * main_layout {new QVBoxLayout};
|
||||
|
||||
bands_table_->setRowCount (num_periods);
|
||||
bands_table_->setVerticalScrollBarPolicy (Qt::ScrollBarAlwaysOff);
|
||||
bands_table_->setHorizontalScrollBarPolicy (Qt::ScrollBarAlwaysOff);
|
||||
bands_table_->setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||
frequencies_changed ();
|
||||
main_layout->addWidget (bands_table_);
|
||||
// recalculate table when frequencies change
|
||||
connect (configuration_->frequencies (), &QAbstractItemModel::layoutChanged
|
||||
, this, &Dialog::frequencies_changed);
|
||||
// handle changes by updating the underlying flags
|
||||
connect (bands_table_.data (), &QTableWidget::itemChanged, [this] (QTableWidgetItem * item) {
|
||||
auto band_number = item->data (band_index_role).toInt ();
|
||||
bands_[item->row ()].setBit (band_number, Qt::Checked == item->checkState ());
|
||||
});
|
||||
|
||||
// set up the gray line duration spin box
|
||||
gray_line_width_spin_box_->setRange (1, 60 * 2);
|
||||
gray_line_width_spin_box_->setSuffix ("min");
|
||||
gray_line_width_spin_box_->setValue (*gray_line_duration_);
|
||||
QFormLayout * form_layout = new QFormLayout;
|
||||
form_layout->addRow (tr ("Gray time:"), gray_line_width_spin_box_);
|
||||
connect (gray_line_width_spin_box_.data ()
|
||||
, static_cast<void (QSpinBox::*) (int)> (&QSpinBox::valueChanged)
|
||||
, [this] (int new_value) {*gray_line_duration_ = new_value;});
|
||||
|
||||
QHBoxLayout * bottom_layout = new QHBoxLayout;
|
||||
bottom_layout->addStretch ();
|
||||
bottom_layout->addLayout (form_layout);
|
||||
main_layout->addLayout (bottom_layout);
|
||||
|
||||
setLayout (main_layout);
|
||||
}
|
||||
|
||||
Dialog::~Dialog ()
|
||||
{
|
||||
// do this here too because ESC or parent shutdown closing this
|
||||
// window doesn't queue a close event
|
||||
save_window_state ();
|
||||
}
|
||||
|
||||
void Dialog::closeEvent (QCloseEvent * e)
|
||||
{
|
||||
save_window_state ();
|
||||
QDialog::closeEvent (e);
|
||||
}
|
||||
|
||||
void Dialog::save_window_state ()
|
||||
{
|
||||
SettingsGroup g {settings_, title};
|
||||
settings_->setValue ("geometry", saveGeometry ());
|
||||
}
|
||||
|
||||
void Dialog::frequencies_changed ()
|
||||
{
|
||||
bands_table_->setColumnCount (WSPR_bands_->size ());
|
||||
// set up and load the table of check boxes
|
||||
for (auto row = 0u; row < num_periods; ++row)
|
||||
{
|
||||
auto vertical_header = new QTableWidgetItem {periods[row]};
|
||||
vertical_header->setTextAlignment (Qt::AlignRight | Qt::AlignVCenter);
|
||||
bands_table_->setVerticalHeaderItem (row, vertical_header);
|
||||
int column {0};
|
||||
int band_number {0};
|
||||
for (auto const& band : *configuration_->bands ())
|
||||
{
|
||||
if (WSPR_bands_->contains (band))
|
||||
{
|
||||
if (0 == row)
|
||||
{
|
||||
auto horizontal_header = new QTableWidgetItem {band};
|
||||
bands_table_->setHorizontalHeaderItem (column, horizontal_header);
|
||||
}
|
||||
auto item = new QTableWidgetItem;
|
||||
item->setFlags (Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
|
||||
item->setCheckState (bands_[row].testBit (band_number) ? Qt::Checked : Qt::Unchecked);
|
||||
item->setData (band_index_role, band_number);
|
||||
if (coordinated_bands.contains (band))
|
||||
{
|
||||
item->setBackground (coord_background_brush_);
|
||||
}
|
||||
bands_table_->setItem (row, column, item);
|
||||
++column;
|
||||
}
|
||||
++band_number;
|
||||
}
|
||||
}
|
||||
bands_table_->resizeColumnsToContents ();
|
||||
auto is_visible = isVisible ();
|
||||
show ();
|
||||
resize_to_maximum ();
|
||||
adjustSize (); // fix the size
|
||||
if (!is_visible)
|
||||
{
|
||||
hide ();
|
||||
}
|
||||
}
|
||||
|
||||
// to get the dialog window exactly the right size to contain the
|
||||
// widgets without needing scroll bars we need to measure the size of
|
||||
// the table widget and set its minimum size to the measured size
|
||||
void Dialog::resize_to_maximum ()
|
||||
{
|
||||
bands_table_->setMinimumSize ({
|
||||
bands_table_->horizontalHeader ()->length ()
|
||||
+ bands_table_->verticalHeader ()->width ()
|
||||
+ 2 * bands_table_->frameWidth ()
|
||||
, bands_table_->verticalHeader ()->length ()
|
||||
+ bands_table_->horizontalHeader ()->height ()
|
||||
+ 2 * bands_table_->frameWidth ()
|
||||
});
|
||||
bands_table_->setMaximumSize (bands_table_->minimumSize ());
|
||||
}
|
||||
|
||||
class WSPRBandHopping::impl
|
||||
{
|
||||
public:
|
||||
using BandList = Dialog::BandList;
|
||||
|
||||
impl (QSettings * settings, Configuration const * configuration, QWidget * parent_widget)
|
||||
: settings_ {settings}
|
||||
, configuration_ {configuration}
|
||||
, tx_percent_ {0}
|
||||
, parent_widget_ {parent_widget}
|
||||
, last_was_tx_ {false}
|
||||
, carry_ {false}
|
||||
, seed_ {{rand (), rand (), rand (), rand (), rand (), rand (), rand (), rand ()}}
|
||||
, gen_ {seed_}
|
||||
, dist_ {1, 100}
|
||||
{
|
||||
auto num_bands = configuration_->bands ()->rowCount ();
|
||||
for (auto& flags : bands_)
|
||||
{
|
||||
flags.resize (num_bands);
|
||||
}
|
||||
}
|
||||
|
||||
bool simple_scheduler ();
|
||||
|
||||
QSettings * settings_;
|
||||
Configuration const * configuration_;
|
||||
int tx_percent_;
|
||||
BandList WSPR_bands_;
|
||||
BandList rx_permutation_;
|
||||
BandList tx_permutation_;
|
||||
QWidget * parent_widget_;
|
||||
|
||||
// 5 x 10 bit flags representing each hopping band in each period
|
||||
// and tune
|
||||
QBitArray bands_[num_periods];
|
||||
|
||||
int gray_line_duration_;
|
||||
QPointer<Dialog> dialog_;
|
||||
bool last_was_tx_;
|
||||
bool carry_;
|
||||
std::seed_seq seed_;
|
||||
std::mt19937 gen_;
|
||||
std::uniform_int_distribution<int> dist_;
|
||||
};
|
||||
|
||||
bool WSPRBandHopping::impl::simple_scheduler ()
|
||||
{
|
||||
auto tx = carry_ || tx_percent_ > dist_ (gen_);
|
||||
if (carry_)
|
||||
{
|
||||
carry_ = false;
|
||||
}
|
||||
else if (tx_percent_ < 40 && last_was_tx_ && tx)
|
||||
{
|
||||
// if percentage is less than 40 then avoid consecutive tx but
|
||||
// always catch up on the next round
|
||||
tx = false;
|
||||
carry_ = true;
|
||||
}
|
||||
last_was_tx_ = tx;
|
||||
return tx;
|
||||
}
|
||||
|
||||
WSPRBandHopping::WSPRBandHopping (QSettings * settings, Configuration const * configuration, QWidget * parent_widget)
|
||||
: m_ {settings, configuration, parent_widget}
|
||||
{
|
||||
// detect changes to the working frequencies model
|
||||
m_->WSPR_bands_ = m_->configuration_->frequencies ()->all_bands (Modes::WSPR).toList ();
|
||||
connect (m_->configuration_->frequencies (), &QAbstractItemModel::layoutChanged
|
||||
, [this] () {
|
||||
m_->WSPR_bands_ = m_->configuration_->frequencies ()->all_bands (Modes::WSPR).toList ();
|
||||
});
|
||||
|
||||
// load settings
|
||||
SettingsGroup g {m_->settings_, title};
|
||||
size_t size = m_->settings_->beginReadArray ("phases");
|
||||
for (auto i = 0u; i < size; ++i)
|
||||
{
|
||||
if (i < num_periods)
|
||||
{
|
||||
m_->settings_->setArrayIndex (i);
|
||||
m_->bands_[i] = m_->settings_->value ("bands").toBitArray ();
|
||||
}
|
||||
}
|
||||
m_->settings_->endArray ();
|
||||
m_->gray_line_duration_ = m_->settings_->value ("GrayLineDuration", 60).toUInt ();
|
||||
}
|
||||
|
||||
WSPRBandHopping::~WSPRBandHopping ()
|
||||
{
|
||||
// save settings
|
||||
SettingsGroup g {m_->settings_, title};
|
||||
m_->settings_->beginWriteArray ("phases");
|
||||
for (auto i = 0u; i < num_periods; ++i)
|
||||
{
|
||||
m_->settings_->setArrayIndex (i);
|
||||
m_->settings_->setValue ("bands", m_->bands_[i]);
|
||||
}
|
||||
m_->settings_->endArray ();
|
||||
m_->settings_->setValue ("GrayLineDuration", m_->gray_line_duration_);
|
||||
}
|
||||
|
||||
// pop up the maintenance dialog window
|
||||
void WSPRBandHopping::show_dialog (bool /* checked */)
|
||||
{
|
||||
if (!m_->dialog_)
|
||||
{
|
||||
m_->dialog_ = new Dialog {m_->settings_, m_->configuration_, &m_->WSPR_bands_, m_->bands_
|
||||
, &m_->gray_line_duration_, m_->parent_widget_};
|
||||
}
|
||||
m_->dialog_->show ();
|
||||
m_->dialog_->raise ();
|
||||
m_->dialog_->activateWindow ();
|
||||
}
|
||||
|
||||
int WSPRBandHopping::tx_percent () const
|
||||
{
|
||||
return m_->tx_percent_;
|
||||
}
|
||||
|
||||
void WSPRBandHopping::set_tx_percent (int new_value)
|
||||
{
|
||||
m_->tx_percent_ = new_value;
|
||||
}
|
||||
|
||||
// determine the parameters of the hop, if any
|
||||
auto WSPRBandHopping::next_hop (bool tx_enabled) -> Hop
|
||||
{
|
||||
auto const& now = QDateTime::currentDateTimeUtc ();
|
||||
auto const& date = now.date ();
|
||||
auto year = date.year ();
|
||||
auto month = date.month ();
|
||||
auto day = date.day ();
|
||||
auto const& time = now.time ();
|
||||
float uth = time.hour () + time.minute () / 60.
|
||||
+ (time.second () + .001 * time.msec ()) / 3600.;
|
||||
auto my_grid = m_->configuration_->my_grid ();
|
||||
int period_index;
|
||||
int band_index;
|
||||
int tx_next;
|
||||
|
||||
my_grid = (my_grid + " ").left (6); // hopping doesn't like
|
||||
// short grids
|
||||
|
||||
// look up the period for this time
|
||||
FC_grayline (&year, &month, &day, &uth, my_grid.toLatin1 ().constData ()
|
||||
, &m_->gray_line_duration_, &period_index
|
||||
, my_grid.size ());
|
||||
|
||||
band_index = next_hopping_band();
|
||||
|
||||
tx_next = next_is_tx () && tx_enabled;
|
||||
|
||||
int frequencies_index {-1};
|
||||
auto const& frequencies = m_->configuration_->frequencies ();
|
||||
auto const& bands = m_->configuration_->bands ();
|
||||
auto band_name = bands->data (bands->index (band_index + 3, 0)).toString ();
|
||||
if (m_->bands_[period_index].testBit (band_index + 3) // +3 for
|
||||
// coordinated bands
|
||||
&& m_->WSPR_bands_.contains (band_name))
|
||||
{
|
||||
// here we have a band that has been enabled in the hopping
|
||||
// matrix so check it it has a configured working frequency
|
||||
frequencies_index = frequencies->best_working_frequency (band_name);
|
||||
}
|
||||
|
||||
// if we do not have a configured working frequency on the selected
|
||||
// coordinated hopping band we next pick from a random permutation
|
||||
// of the other enabled bands in the hopping bands matrix
|
||||
if (frequencies_index < 0)
|
||||
{
|
||||
// build sets of available rx and tx bands
|
||||
auto target_rx_bands = m_->WSPR_bands_.toSet ();
|
||||
auto target_tx_bands = target_rx_bands;
|
||||
for (auto i = 0; i < m_->bands_[period_index].size (); ++i)
|
||||
{
|
||||
auto const& band = bands->data (bands->index (i, 0)).toString ();
|
||||
// remove bands that are not enabled for hopping in this phase
|
||||
if (!m_->bands_[period_index].testBit (i))
|
||||
{
|
||||
target_rx_bands.remove (band);
|
||||
target_tx_bands.remove (band);
|
||||
}
|
||||
// remove rx only bands from transmit list and vice versa
|
||||
if (m_->bands_[5].testBit (i))
|
||||
{
|
||||
target_tx_bands.remove (band);
|
||||
}
|
||||
else
|
||||
{
|
||||
target_rx_bands.remove (band);
|
||||
}
|
||||
}
|
||||
// if we have some bands to permute
|
||||
if (target_rx_bands.size () + target_tx_bands.size ())
|
||||
{
|
||||
if (!(m_->rx_permutation_.size () + m_->tx_permutation_.size ()) // all used up
|
||||
// or rx list contains a band no longer scheduled
|
||||
|| !target_rx_bands.contains (m_->rx_permutation_.toSet ())
|
||||
// or tx list contains a band no longer scheduled for tx
|
||||
|| !target_tx_bands.contains (m_->tx_permutation_.toSet ()))
|
||||
{
|
||||
// build new random permutations
|
||||
m_->rx_permutation_ = target_rx_bands.toList ();
|
||||
std::random_shuffle (std::begin (m_->rx_permutation_), std::end (m_->rx_permutation_));
|
||||
m_->tx_permutation_ = target_tx_bands.toList ();
|
||||
std::random_shuffle (std::begin (m_->tx_permutation_), std::end (m_->tx_permutation_));
|
||||
// qDebug () << "New random Rx permutation:" << m_->rx_permutation_
|
||||
// << "random Tx permutation:" << m_->tx_permutation_;
|
||||
}
|
||||
if ((tx_next && m_->tx_permutation_.size ()) || !m_->rx_permutation_.size ())
|
||||
{
|
||||
Q_ASSERT (m_->tx_permutation_.size ());
|
||||
// use one from the current random tx permutation
|
||||
band_name = m_->tx_permutation_.takeFirst ();
|
||||
}
|
||||
else
|
||||
{
|
||||
Q_ASSERT (m_->rx_permutation_.size ());
|
||||
// use one from the current random rx permutation
|
||||
band_name = m_->rx_permutation_.takeFirst ();
|
||||
}
|
||||
// find the first WSPR working frequency for the chosen band
|
||||
frequencies_index = frequencies->best_working_frequency (band_name);
|
||||
if (frequencies_index >= 0) // should be a redundant check,
|
||||
// but to be safe
|
||||
{
|
||||
// we can use the random choice
|
||||
// qDebug () << "random:" << frequencies->data (frequencies->index (frequencies_index, FrequencyList::frequency_column)).toString ();
|
||||
band_index = bands->find (band_name);
|
||||
if (band_index < 0) // this shouldn't happen
|
||||
{
|
||||
Q_ASSERT (band_index >= 0);
|
||||
frequencies_index = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
band_index += 3;
|
||||
// qDebug () << "scheduled:" << frequencies->data (frequencies->index (frequencies_index, FrequencyList::frequency_column)).toString ();
|
||||
// remove from random permutations to stop the coordinated bands
|
||||
// getting too high a weighting - not perfect but surely helps
|
||||
m_->rx_permutation_.removeOne (band_name);
|
||||
m_->tx_permutation_.removeOne (band_name);
|
||||
}
|
||||
|
||||
return {
|
||||
periods[period_index]
|
||||
|
||||
, frequencies_index
|
||||
|
||||
, frequencies_index >= 0 // new band
|
||||
&& tx_enabled // transmit is allowed
|
||||
&& !tx_next // not going to Tx anyway
|
||||
&& m_->bands_[4].testBit (band_index) // tune up required
|
||||
&& !m_->bands_[5].testBit (band_index) // not an Rx only band
|
||||
|
||||
, frequencies_index >= 0 // new band
|
||||
&& tx_next // Tx scheduled
|
||||
&& !m_->bands_[5].testBit (band_index) // not an Rx only band
|
||||
};
|
||||
}
|
||||
|
||||
bool WSPRBandHopping::next_is_tx (bool simple_schedule)
|
||||
{
|
||||
if (simple_schedule)
|
||||
{
|
||||
return m_->simple_scheduler ();
|
||||
}
|
||||
if (100 == m_->tx_percent_)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// consult scheduler to determine if next period should be a tx interval
|
||||
return next_tx_state(m_->tx_percent_);
|
||||
}
|
||||
}
|
||||
@@ -1,123 +0,0 @@
|
||||
subroutine sync8(iwave,nfa,nfb,nfqso,s,candidate,ncand)
|
||||
|
||||
include 'ft8_params.f90'
|
||||
parameter (JZ=20)
|
||||
complex cx(0:NH1)
|
||||
real s(NH1,NHSYM)
|
||||
real savg(NH1)
|
||||
real x(NFFT1)
|
||||
real sync2d(NH1,-JZ:JZ)
|
||||
real red(NH1)
|
||||
real candidate0(3,100)
|
||||
real candidate(3,100)
|
||||
integer*2 iwave(NMAX)
|
||||
integer jpeak(NH1)
|
||||
integer indx(NH1)
|
||||
integer ii(1)
|
||||
integer icos7(0:6)
|
||||
data icos7/2,5,6,0,4,1,3/ !Costas 7x7 tone pattern
|
||||
equivalence (x,cx)
|
||||
|
||||
! Compute symbol spectra at half-symbol steps.
|
||||
savg=0.
|
||||
istep=NSPS/2 !1024
|
||||
tstep=istep/12000.0 !0.085333 s
|
||||
df=12000.0/NFFT1 !2.93 Hz
|
||||
|
||||
! Compute symbol spectra at half-symbol steps
|
||||
fac=1.0/300.0
|
||||
do j=1,NHSYM
|
||||
ia=(j-1)*istep + 1
|
||||
ib=ia+NSPS-1
|
||||
x(1:NSPS)=fac*iwave(ia:ib)
|
||||
x(NSPS+1:)=0.
|
||||
call four2a(x,NFFT1,1,-1,0) !r2c FFT
|
||||
do i=1,NH1
|
||||
s(i,j)=real(cx(i))**2 + aimag(cx(i))**2
|
||||
enddo
|
||||
savg=savg + s(1:NH1,j) !Average spectrum
|
||||
enddo
|
||||
savg=savg/NHSYM
|
||||
|
||||
ia=max(1,nint(nfa/df))
|
||||
ib=nint(nfb/df)
|
||||
do i=ia,ib
|
||||
do j=-JZ,JZ
|
||||
t=0.
|
||||
t0=0.
|
||||
do n=0,6
|
||||
k=j+2*n
|
||||
if(k.ge.1) then
|
||||
t=t + s(i+2*icos7(n),k)
|
||||
t0=t0 + sum(s(i:i+12:2,k))
|
||||
endif
|
||||
t=t + s(i+2*icos7(n),k+72)
|
||||
t0=t0 + sum(s(i:i+12:2,k+72))
|
||||
if(k+144.le.NHSYM) then
|
||||
t=t + s(i+2*icos7(n),k+144)
|
||||
t0=t0 + sum(s(i:i+12:2,k+144))
|
||||
endif
|
||||
enddo
|
||||
t0=(t0-t)/6.0
|
||||
sync2d(i,j)=t/t0
|
||||
enddo
|
||||
enddo
|
||||
|
||||
red=0.
|
||||
do i=ia,ib
|
||||
ii=maxloc(sync2d(i,-JZ:JZ)) - 1 - JZ
|
||||
j0=ii(1)
|
||||
jpeak(i)=j0
|
||||
red(i)=sync2d(i,j0)
|
||||
! write(52,3052) i*df,red(i),db(red(i))
|
||||
!3052 format(3f12.3)
|
||||
enddo
|
||||
iz=ib-ia+1
|
||||
call indexx(red(ia:ib),iz,indx)
|
||||
ibase=indx(nint(0.40*iz)) - 1 + ia
|
||||
base=red(ibase)
|
||||
red=red/base
|
||||
|
||||
candidate0=0.
|
||||
k=0
|
||||
syncmin=4.0
|
||||
do i=1,100
|
||||
n=ia + indx(iz+1-i) - 1
|
||||
if(red(n).lt.syncmin) exit
|
||||
k=k+1
|
||||
candidate0(1,k)=n*df
|
||||
candidate0(2,k)=(jpeak(n)-1)*tstep
|
||||
candidate0(3,k)=red(n)
|
||||
enddo
|
||||
ncand=k
|
||||
|
||||
! Put nfqso at top of list, and save only the best of near-dupe freqs.
|
||||
do i=1,ncand
|
||||
if(abs(candidate0(1,i)-nfqso).lt.10.0) candidate0(1,i)=-candidate0(1,i)
|
||||
if(i.ge.2) then
|
||||
do j=1,i-1
|
||||
fdiff=abs(candidate0(1,i))-abs(candidate0(1,j))
|
||||
if(abs(fdiff).lt.4.0) then
|
||||
if(candidate0(3,i).ge.candidate0(3,j)) candidate0(3,j)=0.
|
||||
if(candidate0(3,i).lt.candidate0(3,j)) candidate0(3,i)=0.
|
||||
endif
|
||||
enddo
|
||||
! write(*,3001) i,candidate0(1,i-1),candidate0(1,i),candidate0(3,i-1), &
|
||||
! candidate0(3,i)
|
||||
!3001 format(i2,4f8.1)
|
||||
endif
|
||||
enddo
|
||||
|
||||
fac=20.0/maxval(s)
|
||||
s=fac*s
|
||||
|
||||
call indexx(candidate0(1,1:ncand),ncand,indx)
|
||||
do i=1,ncand
|
||||
j=indx(i)
|
||||
candidate(1,i)=abs(candidate0(1,j))
|
||||
candidate(2,i)=candidate0(2,j)
|
||||
candidate(3,i)=candidate0(3,j)
|
||||
enddo
|
||||
|
||||
return
|
||||
end subroutine sync8
|
||||
@@ -1,82 +0,0 @@
|
||||
#ifndef WSJTX_UDP_CLIENT_WIDGET_MODEL_HPP__
|
||||
#define WSJTX_UDP_CLIENT_WIDGET_MODEL_HPP__
|
||||
|
||||
#include <QObject>
|
||||
#include <QSortFilterProxyModel>
|
||||
#include <QString>
|
||||
#include <QRegularExpression>
|
||||
#include <QtWidgets>
|
||||
|
||||
#include "MessageServer.hpp"
|
||||
|
||||
class QAbstractItemModel;
|
||||
class QModelIndex;
|
||||
|
||||
using Frequency = MessageServer::Frequency;
|
||||
|
||||
class ClientWidget
|
||||
: public QDockWidget
|
||||
{
|
||||
Q_OBJECT;
|
||||
|
||||
public:
|
||||
explicit ClientWidget (QAbstractItemModel * decodes_model, QAbstractItemModel * beacons_model
|
||||
, QString const& id, QString const& version, QString const& revision
|
||||
, QWidget * parent = nullptr);
|
||||
|
||||
bool fast_mode () const {return fast_mode_;}
|
||||
|
||||
Q_SLOT void update_status (QString const& id, Frequency f, QString const& mode, QString const& dx_call
|
||||
, QString const& report, QString const& tx_mode, bool tx_enabled
|
||||
, bool transmitting, bool decoding, qint32 rx_df, qint32 tx_df
|
||||
, QString const& de_call, QString const& de_grid, QString const& dx_grid
|
||||
, bool watchdog_timeout, QString const& sub_mode, bool fast_mode);
|
||||
Q_SLOT void decode_added (bool is_new, QString const& client_id, QTime, qint32 snr
|
||||
, float delta_time, quint32 delta_frequency, QString const& mode
|
||||
, QString const& message, bool low_confidence);
|
||||
Q_SLOT void beacon_spot_added (bool is_new, QString const& client_id, QTime, qint32 snr
|
||||
, float delta_time, Frequency delta_frequency, qint32 drift
|
||||
, QString const& callsign, QString const& grid, qint32 power);
|
||||
|
||||
Q_SIGNAL void do_reply (QModelIndex const&);
|
||||
Q_SIGNAL void do_halt_tx (QString const& id, bool auto_only);
|
||||
Q_SIGNAL void do_free_text (QString const& id, QString const& text, bool);
|
||||
|
||||
private:
|
||||
QString id_;
|
||||
class IdFilterModel final
|
||||
: public QSortFilterProxyModel
|
||||
{
|
||||
public:
|
||||
IdFilterModel (QString const& client_id);
|
||||
|
||||
void de_call (QString const&);
|
||||
void rx_df (int);
|
||||
|
||||
QVariant data (QModelIndex const& proxy_index, int role = Qt::DisplayRole) const override;
|
||||
|
||||
protected:
|
||||
bool filterAcceptsRow (int source_row, QModelIndex const& source_parent) const override;
|
||||
|
||||
private:
|
||||
QString client_id_;
|
||||
QString call_;
|
||||
QRegularExpression base_call_re_;
|
||||
int rx_df_;
|
||||
} decodes_proxy_model_;
|
||||
QTableView * decodes_table_view_;
|
||||
QTableView * beacons_table_view_;
|
||||
QLineEdit * message_line_edit_;
|
||||
QStackedLayout * decodes_stack_;
|
||||
QAbstractButton * auto_off_button_;
|
||||
QAbstractButton * halt_tx_button_;
|
||||
QLabel * mode_label_;
|
||||
bool fast_mode_;
|
||||
QLabel * frequency_label_;
|
||||
QLabel * dx_label_;
|
||||
QLabel * rx_df_label_;
|
||||
QLabel * tx_df_label_;
|
||||
QLabel * report_label_;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,624 +0,0 @@
|
||||
// -*- Mode: C++ -*-
|
||||
#ifndef MAINWINDOW_H
|
||||
#define MAINWINDOW_H
|
||||
#ifdef QT5
|
||||
#include <QtWidgets>
|
||||
#else
|
||||
#include <QtGui>
|
||||
#endif
|
||||
#include <QThread>
|
||||
#include <QTimer>
|
||||
#include <QDateTime>
|
||||
#include <QList>
|
||||
#include <QAudioDeviceInfo>
|
||||
#include <QScopedPointer>
|
||||
#include <QDir>
|
||||
#include <QProgressDialog>
|
||||
#include <QAbstractSocket>
|
||||
#include <QHostAddress>
|
||||
#include <QPointer>
|
||||
#include <QSet>
|
||||
#include <QVector>
|
||||
#include <QFuture>
|
||||
#include <QFutureWatcher>
|
||||
|
||||
#include "AudioDevice.hpp"
|
||||
#include "commons.h"
|
||||
#include "Radio.hpp"
|
||||
#include "Modes.hpp"
|
||||
#include "FrequencyList.hpp"
|
||||
#include "Configuration.hpp"
|
||||
#include "WSPRBandHopping.hpp"
|
||||
#include "Transceiver.hpp"
|
||||
#include "DisplayManual.hpp"
|
||||
#include "psk_reporter.h"
|
||||
#include "logbook/logbook.h"
|
||||
#include "decodedtext.h"
|
||||
#include "commons.h"
|
||||
#include "astro.h"
|
||||
#include "MessageBox.hpp"
|
||||
#include "NetworkAccessManager.hpp"
|
||||
|
||||
#define NUM_JT4_SYMBOLS 206 //(72+31)*2, embedded sync
|
||||
#define NUM_JT65_SYMBOLS 126 //63 data + 63 sync
|
||||
#define NUM_JT9_SYMBOLS 85 //69 data + 16 sync
|
||||
#define NUM_WSPR_SYMBOLS 162 //(50+31)*2, embedded sync
|
||||
#define NUM_WSPR_LF_SYMBOLS 412 //300 data + 109 sync + 3 ramp
|
||||
#define NUM_ISCAT_SYMBOLS 1291 //30*11025/256
|
||||
#define NUM_MSK144_SYMBOLS 144 //s8 + d48 + s8 + d80
|
||||
#define NUM_QRA64_SYMBOLS 84 //63 data + 21 sync
|
||||
#define NUM_FT8_SYMBOLS 79
|
||||
#define NUM_CW_SYMBOLS 250
|
||||
#define TX_SAMPLE_RATE 48000
|
||||
#define N_WIDGETS 24
|
||||
|
||||
extern int volatile itone[NUM_ISCAT_SYMBOLS]; //Audio tones for all Tx symbols
|
||||
extern int volatile icw[NUM_CW_SYMBOLS]; //Dits for CW ID
|
||||
|
||||
//--------------------------------------------------------------- MainWindow
|
||||
namespace Ui {
|
||||
class MainWindow;
|
||||
}
|
||||
|
||||
class QSettings;
|
||||
class QLineEdit;
|
||||
class QFont;
|
||||
class QHostInfo;
|
||||
class EchoGraph;
|
||||
class FastGraph;
|
||||
class WideGraph;
|
||||
class LogQSO;
|
||||
class Transceiver;
|
||||
class MessageAveraging;
|
||||
class MessageClient;
|
||||
class QTime;
|
||||
class WSPRBandHopping;
|
||||
class HelpTextWindow;
|
||||
class WSPRNet;
|
||||
class SoundOutput;
|
||||
class Modulator;
|
||||
class SoundInput;
|
||||
class Detector;
|
||||
class SampleDownloader;
|
||||
class MultiSettings;
|
||||
class PhaseEqualizationDialog;
|
||||
|
||||
class MainWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT;
|
||||
|
||||
public:
|
||||
using Frequency = Radio::Frequency;
|
||||
using FrequencyDelta = Radio::FrequencyDelta;
|
||||
using Mode = Modes::Mode;
|
||||
|
||||
explicit MainWindow(QDir const& temp_directory, bool multiple, MultiSettings *,
|
||||
QSharedMemory *shdmem, unsigned downSampleFactor,
|
||||
QSplashScreen *,
|
||||
QWidget *parent = nullptr);
|
||||
~MainWindow();
|
||||
|
||||
public slots:
|
||||
void showSoundInError(const QString& errorMsg);
|
||||
void showSoundOutError(const QString& errorMsg);
|
||||
void showStatusMessage(const QString& statusMsg);
|
||||
void dataSink(qint64 frames);
|
||||
void fastSink(qint64 frames);
|
||||
void diskDat();
|
||||
void freezeDecode(int n);
|
||||
void guiUpdate();
|
||||
void doubleClickOnCall(bool shift, bool ctrl);
|
||||
void doubleClickOnCall2(bool shift, bool ctrl);
|
||||
void readFromStdout();
|
||||
void p1ReadFromStdout();
|
||||
void setXIT(int n, Frequency base = 0u);
|
||||
void setFreq4(int rxFreq, int txFreq);
|
||||
void msgAvgDecode2();
|
||||
void fastPick(int x0, int x1, int y);
|
||||
|
||||
protected:
|
||||
void keyPressEvent (QKeyEvent *) override;
|
||||
void closeEvent(QCloseEvent *) override;
|
||||
void childEvent(QChildEvent *) override;
|
||||
bool eventFilter(QObject *, QEvent *) override;
|
||||
|
||||
private slots:
|
||||
void on_tx1_editingFinished();
|
||||
void on_tx2_editingFinished();
|
||||
void on_tx3_editingFinished();
|
||||
void on_tx4_editingFinished();
|
||||
void on_tx5_currentTextChanged (QString const&);
|
||||
void on_tx6_editingFinished();
|
||||
void on_actionSettings_triggered();
|
||||
void on_monitorButton_clicked (bool);
|
||||
void on_actionAbout_triggered();
|
||||
void on_autoButton_clicked (bool);
|
||||
void on_stopTxButton_clicked();
|
||||
void on_stopButton_clicked();
|
||||
void on_actionRelease_Notes_triggered ();
|
||||
void on_actionOnline_User_Guide_triggered();
|
||||
void on_actionLocal_User_Guide_triggered();
|
||||
void on_actionWide_Waterfall_triggered();
|
||||
void on_actionOpen_triggered();
|
||||
void on_actionOpen_next_in_directory_triggered();
|
||||
void on_actionDecode_remaining_files_in_directory_triggered();
|
||||
void on_actionDelete_all_wav_files_in_SaveDir_triggered();
|
||||
void on_actionOpen_log_directory_triggered ();
|
||||
void on_actionNone_triggered();
|
||||
void on_actionSave_all_triggered();
|
||||
void on_actionKeyboard_shortcuts_triggered();
|
||||
void on_actionSpecial_mouse_commands_triggered();
|
||||
void on_DecodeButton_clicked (bool);
|
||||
void decode();
|
||||
void decodeBusy(bool b);
|
||||
void on_EraseButton_clicked();
|
||||
void on_txFirstCheckBox_stateChanged(int arg1);
|
||||
void set_dateTimeQSO(int m_ntx);
|
||||
void set_ntx(int n);
|
||||
void on_txrb1_toggled(bool status);
|
||||
void on_txrb2_toggled(bool status);
|
||||
void on_txrb3_toggled(bool status);
|
||||
void on_txrb4_toggled(bool status);
|
||||
void on_txrb5_toggled(bool status);
|
||||
void on_txrb6_toggled(bool status);
|
||||
void on_txb1_clicked();
|
||||
void on_txb2_clicked();
|
||||
void on_txb3_clicked();
|
||||
void on_txb4_clicked();
|
||||
void on_txb5_clicked();
|
||||
void on_txb6_clicked();
|
||||
void on_lookupButton_clicked();
|
||||
void on_addButton_clicked();
|
||||
void on_dxCallEntry_textChanged (QString const&);
|
||||
void on_dxGridEntry_textChanged (QString const&);
|
||||
void on_dxCallEntry_returnPressed ();
|
||||
void on_genStdMsgsPushButton_clicked();
|
||||
void on_logQSOButton_clicked();
|
||||
void on_actionJT9_triggered();
|
||||
void on_actionJT65_triggered();
|
||||
void on_actionJT9_JT65_triggered();
|
||||
void on_actionJT4_triggered();
|
||||
void on_actionFT8_triggered();
|
||||
void on_TxFreqSpinBox_valueChanged(int arg1);
|
||||
void on_actionSave_decoded_triggered();
|
||||
void on_actionQuickDecode_toggled (bool);
|
||||
void on_actionMediumDecode_toggled (bool);
|
||||
void on_actionDeepestDecode_toggled (bool);
|
||||
void on_inGain_valueChanged(int n);
|
||||
void bumpFqso(int n);
|
||||
void on_actionErase_ALL_TXT_triggered();
|
||||
void on_actionErase_wsjtx_log_adi_triggered();
|
||||
void startTx2();
|
||||
void startP1();
|
||||
void stopTx();
|
||||
void stopTx2();
|
||||
void on_pbCallCQ_clicked();
|
||||
void on_pbAnswerCaller_clicked();
|
||||
void on_pbSendRRR_clicked();
|
||||
void on_pbAnswerCQ_clicked();
|
||||
void on_pbSendReport_clicked();
|
||||
void on_pbSend73_clicked();
|
||||
void on_rbGenMsg_clicked(bool checked);
|
||||
void on_rbFreeText_clicked(bool checked);
|
||||
void on_freeTextMsg_currentTextChanged (QString const&);
|
||||
void on_rptSpinBox_valueChanged(int n);
|
||||
void killFile();
|
||||
void on_tuneButton_clicked (bool);
|
||||
void on_pbR2T_clicked();
|
||||
void on_pbT2R_clicked();
|
||||
void acceptQSO2(QDateTime const&, QString const& call, QString const& grid
|
||||
, Frequency dial_freq, QString const& mode
|
||||
, QString const& rpt_sent, QString const& rpt_received
|
||||
, QString const& tx_power, QString const& comments
|
||||
, QString const& name, QDateTime const&);
|
||||
void on_bandComboBox_currentIndexChanged (int index);
|
||||
void on_bandComboBox_activated (int index);
|
||||
void on_readFreq_clicked();
|
||||
void on_pbTxMode_clicked();
|
||||
void on_RxFreqSpinBox_valueChanged(int n);
|
||||
void on_cbTxLock_clicked(bool checked);
|
||||
void on_outAttenuation_valueChanged (int);
|
||||
void rigOpen ();
|
||||
void handle_transceiver_update (Transceiver::TransceiverState const&);
|
||||
void handle_transceiver_failure (QString const& reason);
|
||||
void on_actionAstronomical_data_toggled (bool);
|
||||
void on_actionShort_list_of_add_on_prefixes_and_suffixes_triggered();
|
||||
void band_changed (Frequency);
|
||||
void monitor (bool);
|
||||
void stop_tuning ();
|
||||
void stopTuneATU();
|
||||
void auto_tx_mode(bool);
|
||||
void on_actionMessage_averaging_triggered();
|
||||
void on_actionInclude_averaging_toggled (bool);
|
||||
void on_actionInclude_correlation_toggled (bool);
|
||||
void on_actionEnable_AP_DXcall_toggled (bool);
|
||||
void VHF_features_enabled(bool b);
|
||||
void on_sbSubmode_valueChanged(int n);
|
||||
void on_cbShMsgs_toggled(bool b);
|
||||
void on_cbSWL_toggled(bool b);
|
||||
void on_cbTx6_toggled(bool b);
|
||||
void on_cbMenus_toggled(bool b);
|
||||
void on_cbFirst_toggled(bool b);
|
||||
void on_cbWeak_toggled(bool b);
|
||||
void networkError (QString const&);
|
||||
void on_ClrAvgButton_clicked();
|
||||
void on_actionWSPR_triggered();
|
||||
void on_actionWSPR_LF_triggered();
|
||||
void on_syncSpinBox_valueChanged(int n);
|
||||
void on_TxPowerComboBox_currentIndexChanged(const QString &arg1);
|
||||
void on_sbTxPercent_valueChanged(int n);
|
||||
void on_cbUploadWSPR_Spots_toggled(bool b);
|
||||
void WSPR_config(bool b);
|
||||
void uploadSpots();
|
||||
void TxAgain();
|
||||
void uploadResponse(QString response);
|
||||
void on_WSPRfreqSpinBox_valueChanged(int n);
|
||||
void on_pbTxNext_clicked(bool b);
|
||||
void on_actionEcho_Graph_triggered();
|
||||
void on_actionEcho_triggered();
|
||||
void on_actionISCAT_triggered();
|
||||
void on_actionFast_Graph_triggered();
|
||||
void fast_decode_done();
|
||||
void on_actionMeasure_reference_spectrum_triggered();
|
||||
void on_actionErase_reference_spectrum_triggered();
|
||||
void on_actionMeasure_phase_response_triggered();
|
||||
void on_sbTR_valueChanged (int);
|
||||
void on_sbFtol_valueChanged (int);
|
||||
void on_cbFast9_clicked(bool b);
|
||||
void on_sbCQTxFreq_valueChanged(int n);
|
||||
void on_cbCQTx_toggled(bool b);
|
||||
void on_actionMSK144_triggered();
|
||||
void on_actionQRA64_triggered();
|
||||
void on_actionFreqCal_triggered();
|
||||
void splash_done ();
|
||||
|
||||
private:
|
||||
Q_SIGNAL void initializeAudioOutputStream (QAudioDeviceInfo,
|
||||
unsigned channels, unsigned msBuffered) const;
|
||||
Q_SIGNAL void stopAudioOutputStream () const;
|
||||
Q_SIGNAL void startAudioInputStream (QAudioDeviceInfo const&,
|
||||
int framesPerBuffer, AudioDevice * sink,
|
||||
unsigned downSampleFactor, AudioDevice::Channel) const;
|
||||
Q_SIGNAL void suspendAudioInputStream () const;
|
||||
Q_SIGNAL void resumeAudioInputStream () const;
|
||||
Q_SIGNAL void startDetector (AudioDevice::Channel) const;
|
||||
Q_SIGNAL void FFTSize (unsigned) const;
|
||||
Q_SIGNAL void detectorClose () const;
|
||||
Q_SIGNAL void finished () const;
|
||||
Q_SIGNAL void transmitFrequency (double) const;
|
||||
Q_SIGNAL void endTransmitMessage (bool quick = false) const;
|
||||
Q_SIGNAL void tune (bool = true) const;
|
||||
Q_SIGNAL void sendMessage (unsigned symbolsLength, double framesPerSymbol,
|
||||
double frequency, double toneSpacing,
|
||||
SoundOutput *, AudioDevice::Channel = AudioDevice::Mono,
|
||||
bool synchronize = true, bool fastMode = false, double dBSNR = 99.,
|
||||
int TRperiod=60) const;
|
||||
Q_SIGNAL void outAttenuationChanged (qreal) const;
|
||||
Q_SIGNAL void toggleShorthand () const;
|
||||
|
||||
private:
|
||||
void astroUpdate ();
|
||||
void writeAllTxt(QString message);
|
||||
void FT8_AutoSeq(QString message);
|
||||
void hideMenus(bool b);
|
||||
|
||||
NetworkAccessManager m_network_manager;
|
||||
bool m_valid;
|
||||
QSplashScreen * m_splash;
|
||||
QString m_revision;
|
||||
bool m_multiple;
|
||||
MultiSettings * m_multi_settings;
|
||||
QPushButton * m_configurations_button;
|
||||
QSettings * m_settings;
|
||||
QScopedPointer<Ui::MainWindow> ui;
|
||||
|
||||
// other windows
|
||||
Configuration m_config;
|
||||
WSPRBandHopping m_WSPR_band_hopping;
|
||||
bool m_WSPR_tx_next;
|
||||
MessageBox m_rigErrorMessageBox;
|
||||
QScopedPointer<SampleDownloader> m_sampleDownloader;
|
||||
QScopedPointer<PhaseEqualizationDialog> m_phaseEqualizationDialog;
|
||||
|
||||
QScopedPointer<WideGraph> m_wideGraph;
|
||||
QScopedPointer<EchoGraph> m_echoGraph;
|
||||
QScopedPointer<FastGraph> m_fastGraph;
|
||||
QScopedPointer<LogQSO> m_logDlg;
|
||||
QScopedPointer<Astro> m_astroWidget;
|
||||
QScopedPointer<HelpTextWindow> m_shortcuts;
|
||||
QScopedPointer<HelpTextWindow> m_prefixes;
|
||||
QScopedPointer<HelpTextWindow> m_mouseCmnds;
|
||||
QScopedPointer<MessageAveraging> m_msgAvgWidget;
|
||||
|
||||
Transceiver::TransceiverState m_rigState;
|
||||
Frequency m_lastDialFreq;
|
||||
QString m_lastBand;
|
||||
Frequency m_dialFreqRxWSPR; // best guess at WSPR QRG
|
||||
|
||||
Detector * m_detector;
|
||||
unsigned m_FFTSize;
|
||||
SoundInput * m_soundInput;
|
||||
Modulator * m_modulator;
|
||||
SoundOutput * m_soundOutput;
|
||||
QThread m_audioThread;
|
||||
|
||||
qint64 m_msErase;
|
||||
qint64 m_secBandChanged;
|
||||
qint64 m_freqMoon;
|
||||
Frequency m_freqNominal;
|
||||
Frequency m_freqTxNominal;
|
||||
Astro::Correction m_astroCorrection;
|
||||
|
||||
double m_s6;
|
||||
double m_tRemaining;
|
||||
|
||||
float m_DTtol;
|
||||
float m_t0;
|
||||
float m_t1;
|
||||
float m_t0Pick;
|
||||
float m_t1Pick;
|
||||
float m_fCPUmskrtd;
|
||||
|
||||
qint32 m_waterfallAvg;
|
||||
qint32 m_ntx;
|
||||
bool m_gen_message_is_cq;
|
||||
qint32 m_timeout;
|
||||
qint32 m_XIT;
|
||||
qint32 m_setftx;
|
||||
qint32 m_ndepth;
|
||||
qint32 m_sec0;
|
||||
qint32 m_RxLog;
|
||||
qint32 m_nutc0;
|
||||
qint32 m_ntr;
|
||||
qint32 m_tx;
|
||||
qint32 m_hsym;
|
||||
qint32 m_TRperiod;
|
||||
qint32 m_nsps;
|
||||
qint32 m_hsymStop;
|
||||
qint32 m_inGain;
|
||||
qint32 m_ncw;
|
||||
qint32 m_secID;
|
||||
qint32 m_idleMinutes;
|
||||
qint32 m_nSubMode;
|
||||
qint32 m_nclearave;
|
||||
qint32 m_minSync;
|
||||
qint32 m_dBm;
|
||||
qint32 m_pctx;
|
||||
qint32 m_nseq;
|
||||
qint32 m_nWSPRdecodes;
|
||||
qint32 m_k0;
|
||||
qint32 m_kdone;
|
||||
qint32 m_nPick;
|
||||
FrequencyList::const_iterator m_frequency_list_fcal_iter;
|
||||
qint32 m_nTx73;
|
||||
qint32 m_UTCdisk;
|
||||
qint32 m_wait;
|
||||
|
||||
bool m_btxok; //True if OK to transmit
|
||||
bool m_diskData;
|
||||
bool m_loopall;
|
||||
bool m_decoderBusy;
|
||||
bool m_txFirst;
|
||||
bool m_auto;
|
||||
bool m_restart;
|
||||
bool m_startAnother;
|
||||
bool m_saveDecoded;
|
||||
bool m_saveAll;
|
||||
bool m_widebandDecode;
|
||||
bool m_call3Modified;
|
||||
bool m_dataAvailable;
|
||||
bool m_bDecoded;
|
||||
bool m_noSuffix;
|
||||
bool m_blankLine;
|
||||
bool m_decodedText2;
|
||||
bool m_freeText;
|
||||
bool m_sentFirst73;
|
||||
int m_currentMessageType;
|
||||
QString m_currentMessage;
|
||||
int m_lastMessageType;
|
||||
QString m_lastMessageSent;
|
||||
bool m_lockTxFreq;
|
||||
bool m_bShMsgs;
|
||||
bool m_bSWL;
|
||||
bool m_uploadSpots;
|
||||
bool m_uploading;
|
||||
bool m_txNext;
|
||||
bool m_grid6;
|
||||
bool m_tuneup;
|
||||
bool m_bTxTime;
|
||||
bool m_rxDone;
|
||||
bool m_bSimplex; // not using split even if it is available
|
||||
bool m_bEchoTxOK;
|
||||
bool m_bTransmittedEcho;
|
||||
bool m_bEchoTxed;
|
||||
bool m_bFastMode;
|
||||
bool m_bFast9;
|
||||
bool m_bFastDecodeCalled;
|
||||
bool m_bDoubleClickAfterCQnnn;
|
||||
bool m_bRefSpec;
|
||||
bool m_bClearRefSpec;
|
||||
bool m_bTrain;
|
||||
bool m_bUseRef;
|
||||
bool m_bFastDone;
|
||||
bool m_bAltV;
|
||||
bool m_bNoMoreFiles;
|
||||
bool m_bQRAsyncWarned;
|
||||
bool m_bDoubleClicked;
|
||||
bool m_bCallingCQ;
|
||||
|
||||
int m_ihsym;
|
||||
int m_nzap;
|
||||
int m_npts8;
|
||||
float m_px;
|
||||
float m_pxmax;
|
||||
float m_df3;
|
||||
int m_iptt0;
|
||||
bool m_btxok0;
|
||||
int m_nsendingsh;
|
||||
double m_onAirFreq0;
|
||||
bool m_first_error;
|
||||
|
||||
char m_msg[100][80];
|
||||
|
||||
// labels in status bar
|
||||
QLabel tx_status_label;
|
||||
QLabel config_label;
|
||||
QLabel mode_label;
|
||||
QLabel last_tx_label;
|
||||
QLabel auto_tx_label;
|
||||
QLabel band_hopping_label;
|
||||
QProgressBar progressBar;
|
||||
QLabel watchdog_label;
|
||||
|
||||
QFuture<void> m_wav_future;
|
||||
QFutureWatcher<void> m_wav_future_watcher;
|
||||
QFutureWatcher<void> watcher3;
|
||||
QFutureWatcher<QString> m_saveWAVWatcher;
|
||||
|
||||
QProcess proc_jt9;
|
||||
QProcess p1;
|
||||
QProcess p3;
|
||||
|
||||
WSPRNet *wsprNet;
|
||||
|
||||
QTimer m_guiTimer;
|
||||
QTimer ptt1Timer; //StartTx delay
|
||||
QTimer ptt0Timer; //StopTx delay
|
||||
QTimer logQSOTimer;
|
||||
QTimer killFileTimer;
|
||||
QTimer tuneButtonTimer;
|
||||
QTimer uploadTimer;
|
||||
QTimer tuneATU_Timer;
|
||||
QTimer TxAgainTimer;
|
||||
QTimer minuteTimer;
|
||||
QTimer splashTimer;
|
||||
QTimer p1Timer;
|
||||
|
||||
QString m_path;
|
||||
QString m_baseCall;
|
||||
QString m_hisCall;
|
||||
QString m_hisGrid;
|
||||
QString m_appDir;
|
||||
QString m_palette;
|
||||
QString m_dateTime;
|
||||
QString m_mode;
|
||||
QString m_modeTx;
|
||||
QString m_fnameWE; // save path without extension
|
||||
QString m_rpt;
|
||||
QString m_rptSent;
|
||||
QString m_rptRcvd;
|
||||
QString m_qsoStart;
|
||||
QString m_qsoStop;
|
||||
QString m_cmnd;
|
||||
QString m_cmndP1;
|
||||
QString m_msgSent0;
|
||||
QString m_fileToSave;
|
||||
QString m_calls;
|
||||
|
||||
QSet<QString> m_pfx;
|
||||
QSet<QString> m_sfx;
|
||||
|
||||
QDateTime m_dateTimeQSOOn;
|
||||
|
||||
QSharedMemory *mem_jt9;
|
||||
LogBook m_logBook;
|
||||
DecodedText m_QSOText;
|
||||
unsigned m_msAudioOutputBuffered;
|
||||
unsigned m_framesAudioInputBuffered;
|
||||
unsigned m_downSampleFactor;
|
||||
QThread::Priority m_audioThreadPriority;
|
||||
bool m_bandEdited;
|
||||
bool m_splitMode;
|
||||
bool m_monitoring;
|
||||
bool m_tx_when_ready;
|
||||
bool m_transmitting;
|
||||
bool m_tune;
|
||||
bool m_tx_watchdog; // true when watchdog triggered
|
||||
bool m_block_pwr_tooltip;
|
||||
bool m_PwrBandSetOK;
|
||||
bool m_bVHFwarned;
|
||||
Frequency m_lastMonitoredFrequency;
|
||||
double m_toneSpacing;
|
||||
int m_firstDecode;
|
||||
QProgressDialog m_optimizingProgress;
|
||||
QTimer m_heartbeat;
|
||||
MessageClient * m_messageClient;
|
||||
PSK_Reporter *psk_Reporter;
|
||||
DisplayManual m_manual;
|
||||
QHash<QString, QVariant> m_pwrBandTxMemory; // Remembers power level by band
|
||||
QHash<QString, QVariant> m_pwrBandTuneMemory; // Remembers power level by band for tuning
|
||||
QByteArray m_geometryNoControls;
|
||||
QVector<double> m_phaseEqCoefficients;
|
||||
|
||||
//---------------------------------------------------- private functions
|
||||
void readSettings();
|
||||
void setDecodedTextFont (QFont const&);
|
||||
void writeSettings();
|
||||
void createStatusBar();
|
||||
void updateStatusBar();
|
||||
void genStdMsgs(QString rpt);
|
||||
void genCQMsg();
|
||||
void clearDX ();
|
||||
void lookup();
|
||||
void ba2msg(QByteArray ba, char* message);
|
||||
void msgtype(QString t, QLineEdit* tx);
|
||||
void stub();
|
||||
void statusChanged();
|
||||
void fixStop();
|
||||
bool shortList(QString callsign);
|
||||
void transmit (double snr = 99.);
|
||||
void rigFailure (QString const& reason);
|
||||
void pskSetLocal ();
|
||||
void pskPost(DecodedText decodedtext);
|
||||
void displayDialFrequency ();
|
||||
void transmitDisplay (bool);
|
||||
void processMessage(QString const& messages, qint32 position, bool ctrl);
|
||||
void replyToCQ (QTime, qint32 snr, float delta_time, quint32 delta_frequency, QString const& mode, QString const& message_text);
|
||||
void replayDecodes ();
|
||||
void postDecode (bool is_new, QString const& message);
|
||||
void postWSPRDecode (bool is_new, QStringList message_parts);
|
||||
void enable_DXCC_entity (bool on);
|
||||
void switch_mode (Mode);
|
||||
void WSPR_scheduling ();
|
||||
void freqCalStep();
|
||||
void setRig (Frequency = 0); // zero frequency means no change
|
||||
void WSPR_history(Frequency dialFreq, int ndecodes);
|
||||
QString WSPR_hhmm(int n);
|
||||
void fast_config(bool b);
|
||||
void CQTxFreq();
|
||||
QString save_wave_file (QString const& name
|
||||
, short const * data
|
||||
, int seconds
|
||||
, QString const& my_callsign
|
||||
, QString const& my_grid
|
||||
, QString const& mode
|
||||
, qint32 sub_mode
|
||||
, Frequency frequency
|
||||
, QString const& his_call
|
||||
, QString const& his_grid) const;
|
||||
void read_wav_file (QString const& fname);
|
||||
void decodeDone ();
|
||||
void subProcessFailed (QProcess *, int exit_code, QProcess::ExitStatus);
|
||||
void subProcessError (QProcess *, QProcess::ProcessError);
|
||||
void statusUpdate () const;
|
||||
void update_watchdog_label ();
|
||||
void on_the_minute ();
|
||||
void add_child_to_event_filter (QObject *);
|
||||
void remove_child_from_event_filter (QObject *);
|
||||
void setup_status_bar (bool vhf);
|
||||
void tx_watchdog (bool triggered);
|
||||
int nWidgets(QString t);
|
||||
void displayWidgets(int n);
|
||||
void vhfWarning();
|
||||
QChar current_submode () const; // returns QChar {0} if sub mode is
|
||||
// not appropriate
|
||||
void write_transmit_entry (QString const& file_name);
|
||||
};
|
||||
|
||||
extern int killbyname(const char* progName);
|
||||
extern void getDev(int* numDevices,char hostAPI_DeviceName[][50],
|
||||
int minChan[], int maxChan[],
|
||||
int minSpeed[], int maxSpeed[]);
|
||||
extern int next_tx_state(int pctx);
|
||||
|
||||
#endif // MAINWINDOW_H
|
||||
Reference in New Issue
Block a user