From 3e5f703ed2039781e5a73d7ea75a1ded9644b2cf Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Mon, 30 Oct 2017 15:18:54 +0000 Subject: [PATCH] Starting to experiment with FoxCalls. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@8197 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- CMakeLists.txt | 2 + Configuration.cpp | 12 ++++++ Configuration.hpp | 2 + Configuration.ui | 61 ++++++++++++++++++++++++------ foxcalls.cpp | 38 +++++++++++++++++++ foxcalls.h | 34 +++++++++++++++++ foxcalls.ui | 89 +++++++++++++++++++++++++++++++++++++++++++ mainwindow.cpp | 96 ++++++++++++++++++++++++++++++++++++++--------- mainwindow.h | 2 + mainwindow.ui | 7 ++++ wsjtx.pro | 9 +++-- 11 files changed, 320 insertions(+), 32 deletions(-) create mode 100644 foxcalls.cpp create mode 100644 foxcalls.h create mode 100644 foxcalls.ui diff --git a/CMakeLists.txt b/CMakeLists.txt index d5e64f89d..722aee173 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -297,6 +297,7 @@ set (wsjtx_CXXSRCS widegraph.cpp echograph.cpp echoplot.cpp + foxcalls.cpp fastgraph.cpp fastplot.cpp about.cpp @@ -650,6 +651,7 @@ set (wsjtx_UISRCS astro.ui echograph.ui fastgraph.ui + foxcalls.ui messageaveraging.ui widegraph.ui logqso.ui diff --git a/Configuration.cpp b/Configuration.cpp index c93660a71..87ea1c5e7 100644 --- a/Configuration.cpp +++ b/Configuration.cpp @@ -560,6 +560,8 @@ private: bool decode_at_52s_; bool single_decode_; bool twoPass_; + bool bFox_; + bool bHound_; bool x2ToneSpacing_; bool realTimeDecode_; QString udp_server_name_; @@ -650,6 +652,8 @@ bool Configuration::enable_VHF_features () const {return m_->enable_VHF_features bool Configuration::decode_at_52s () const {return m_->decode_at_52s_;} bool Configuration::single_decode () const {return m_->single_decode_;} bool Configuration::twoPass() const {return m_->twoPass_;} +bool Configuration::bFox() const {return m_->bFox_;} +bool Configuration::bHound() const {return m_->bHound_;} bool Configuration::x2ToneSpacing() const {return m_->x2ToneSpacing_;} bool Configuration::realTimeDecode() const {return m_->realTimeDecode_;} bool Configuration::split_mode () const {return m_->split_mode ();} @@ -1102,6 +1106,8 @@ void Configuration::impl::initialize_models () ui_->decode_at_52s_check_box->setChecked(decode_at_52s_); ui_->single_decode_check_box->setChecked(single_decode_); ui_->cbTwoPass->setChecked(twoPass_); + ui_->cbFox->setChecked(bFox_); + ui_->cbHound->setChecked(bHound_); ui_->cbx2ToneSpacing->setChecked(x2ToneSpacing_); ui_->cbRealTime->setChecked(realTimeDecode_); ui_->cbRealTime->setVisible(false); //Tempoary -- probably will remove this control @@ -1332,6 +1338,8 @@ void Configuration::impl::read_settings () decode_at_52s_ = settings_->value("Decode52",false).toBool (); single_decode_ = settings_->value("SingleDecode",false).toBool (); twoPass_ = settings_->value("TwoPass",true).toBool (); + bFox_ = settings_->value("Fox",false).toBool (); + bHound_ = settings_->value("Hound",false).toBool (); x2ToneSpacing_ = settings_->value("x2ToneSpacing",false).toBool (); realTimeDecode_ = settings_->value("RealTimeDecode",false).toBool (); rig_params_.poll_interval = settings_->value ("Polling", 0).toInt (); @@ -1430,6 +1438,8 @@ void Configuration::impl::write_settings () settings_->setValue ("Decode52", decode_at_52s_); settings_->setValue ("SingleDecode", single_decode_); settings_->setValue ("TwoPass", twoPass_); + settings_->setValue ("Fox", bFox_); + settings_->setValue ("Hound", bHound_); settings_->setValue ("x2ToneSpacing", x2ToneSpacing_); settings_->setValue ("RealTimeDecode", realTimeDecode_); settings_->setValue ("UDPServer", udp_server_name_); @@ -1825,6 +1835,8 @@ void Configuration::impl::accept () decode_at_52s_ = ui_->decode_at_52s_check_box->isChecked (); single_decode_ = ui_->single_decode_check_box->isChecked (); twoPass_ = ui_->cbTwoPass->isChecked (); + bFox_ = ui_->cbFox->isChecked (); + bHound_ = ui_->cbHound->isChecked (); x2ToneSpacing_ = ui_->cbx2ToneSpacing->isChecked (); realTimeDecode_ = ui_->cbRealTime->isChecked (); calibration_.intercept = ui_->calibration_intercept_spin_box->value (); diff --git a/Configuration.hpp b/Configuration.hpp index c6e8875fb..c76118513 100644 --- a/Configuration.hpp +++ b/Configuration.hpp @@ -125,6 +125,8 @@ public: bool decode_at_52s () const; bool single_decode () const; bool twoPass() const; + bool bFox() const; + bool bHound() const; bool x2ToneSpacing() const; bool contestMode() const; bool realTimeDecode() const; diff --git a/Configuration.ui b/Configuration.ui index 5f1a4c985..ae56a7e09 100644 --- a/Configuration.ui +++ b/Configuration.ui @@ -6,7 +6,7 @@ 0 0 - 521 + 534 507 @@ -2430,7 +2430,7 @@ Right click for insert and delete options. - + Qt::Vertical @@ -2443,6 +2443,45 @@ Right click for insert and delete options. + + + + + 0 + 50 + + + + FT8 DXpedition mode + + + + + 9 + 10 + 231 + 31 + + + + + + + Fox + + + + + + + Hound + + + + + + + @@ -2595,12 +2634,12 @@ soundcard changes setFocus() - 404 - 62 + 72 + 42 - 199 - 60 + 43 + 42 @@ -2611,12 +2650,12 @@ soundcard changes setFocus() - 199 - 60 + 43 + 42 - 404 - 62 + 72 + 42 @@ -2627,7 +2666,7 @@ soundcard changes - + diff --git a/foxcalls.cpp b/foxcalls.cpp new file mode 100644 index 000000000..98bd700e7 --- /dev/null +++ b/foxcalls.cpp @@ -0,0 +1,38 @@ +#include "foxcalls.h" +#include +#include +#include "ui_foxcalls.h" +#include "moc_foxcalls.cpp" + +FoxCalls::FoxCalls(QSettings * settings, QWidget *parent) : + QWidget {parent, Qt::Window | Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::WindowMinimizeButtonHint}, + m_settings (settings), + ui(new Ui::FoxCalls) +{ + ui->setupUi(this); + setWindowTitle (QApplication::applicationName () + " - " + tr ("Fox Callers")); + installEventFilter(parent); //Installing the filter + +//Restore user's settings + m_settings->beginGroup("FoxCalls"); + restoreGeometry (m_settings->value ("geometry", saveGeometry ()).toByteArray ()); +} + +FoxCalls::~FoxCalls() +{ + saveSettings(); +} + +void FoxCalls::closeEvent (QCloseEvent * e) +{ + saveSettings (); + QWidget::closeEvent (e); +} + +void FoxCalls::saveSettings() +{ +//Save user's settings + m_settings->beginGroup("FoxCalls"); + m_settings->setValue ("geometry", saveGeometry ()); + m_settings->endGroup(); +} diff --git a/foxcalls.h b/foxcalls.h new file mode 100644 index 000000000..1b3462098 --- /dev/null +++ b/foxcalls.h @@ -0,0 +1,34 @@ +#ifndef FOXCALLS_H +#define FOXCALLS_H + +#include +#include + +namespace Ui { +class FoxCalls; +} + +class QSettings; + +class FoxCalls : public QWidget +{ + Q_OBJECT + +protected: + void closeEvent (QCloseEvent *) override; + +public: + explicit FoxCalls(QSettings *, QWidget *parent = 0); + ~FoxCalls(); + + void saveSettings(); + +private slots: +// void on_binsPerPixelSpinBox_valueChanged(int n); + +private: + QSettings * m_settings; + QScopedPointer ui; +}; + +#endif // FOXCALLS_H diff --git a/foxcalls.ui b/foxcalls.ui new file mode 100644 index 000000000..668721f51 --- /dev/null +++ b/foxcalls.ui @@ -0,0 +1,89 @@ + + + FoxCalls + + + + 0 + 0 + 540 + 300 + + + + Form + + + + + 20 + 90 + 321 + 192 + + + + + + + 19 + 60 + 321 + 31 + + + + + + + Sort by: + + + + + + + Call + + + + + + + Grid + + + + + + + dB + + + + + + + Freq + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + diff --git a/mainwindow.cpp b/mainwindow.cpp index a44bca490..33e9e9ff5 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -37,6 +37,7 @@ #include "echograph.h" #include "fastplot.h" #include "fastgraph.h" +#include "foxcalls.h" #include "about.h" #include "messageaveraging.h" #include "widegraph.h" @@ -203,6 +204,8 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, m_echoGraph (new EchoGraph(m_settings)), m_fastGraph (new FastGraph(m_settings)), m_logDlg (new LogQSO (program_title (), m_settings, &m_config, this)), +// m_foxTable (new QTableWidget(100,5)), + m_foxTable (new FoxCalls(m_settings)), m_lastDialFreq {0}, m_dialFreqRxWSPR {0}, m_detector {new Detector {RX_SAMPLE_RATE, NTMAX, downSampleFactor}}, @@ -706,6 +709,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, m_msg[0][0]=0; m_bQRAsyncWarned=false; + ui->labDXped->setVisible(false); for(int i=0; i<28; i++) { //Initialize dBm values float dbm=(10.0*i)/3.0 - 30.0; @@ -2047,6 +2051,7 @@ void MainWindow::closeEvent(QCloseEvent * e) m_config.transceiver_offline (); writeSettings (); m_astroWidget.reset (); + m_foxTable.reset(); m_guiTimer.stop (); m_prefixes.reset (); m_shortcuts.reset (); @@ -2705,6 +2710,62 @@ void MainWindow::decodeDone () decodeBusy(false); m_RxLog=0; m_blankLine=true; + if(m_config.bFox()) { + QFile f(m_config.temp_dir ().absoluteFilePath ("decoded.txt")); + if(f.open (QIODevice::ReadOnly | QIODevice::Text)) { + QTextStream s(&f); +// int nutc,nsnr,nfreq, + int i=0; +// double dt; + QString c1,c2,g2; + QStringList line; + while(!s.atEnd()) { + line=s.readLine().split(" ", QString::SkipEmptyParts); +// nutc=line.at(0).toInt(); +// nsnr=line.at(2).toInt(); +// dt=line.at(3).toDouble(); +// nfreq=line.at(4).toInt(); + c1=line.at(6); + c2=line.at(7); + g2=line.at(8); + /* + if(g2.contains (grid_regexp)) { + QTableWidgetItem *pCell0 = m_foxTable->item(i,0); + if(!pCell0) { + pCell0= new QTableWidgetItem; + m_foxTable->setItem(i,0,pCell0); + pCell0->setText(c2); + } + QTableWidgetItem *pCell1 = m_foxTable->item(i,1); + if(!pCell1) { + pCell1= new QTableWidgetItem; + m_foxTable->setItem(i,1,pCell1); + pCell1->setText(g2); + } + QTableWidgetItem *pCell2 = m_foxTable->item(i,2); + if(!pCell2) { + pCell2= new QTableWidgetItem; + m_foxTable->setItem(i,2,pCell2); + pCell2->setText(line.at(2)); + } + QTableWidgetItem *pCell3 = m_foxTable->item(i,3); + if(!pCell3) { + pCell3= new QTableWidgetItem; + m_foxTable->setItem(i,3,pCell3); + pCell3->setText(line.at(4)); + } + QTableWidgetItem *pCell4 = m_foxTable->item(i,4); + if(!pCell4) { + pCell4= new QTableWidgetItem; + m_foxTable->setItem(i,4,pCell4); + pCell4->setText(line.at(0)); + } i++; + } + */ + } + f.close(); + } + } } void MainWindow::readFromStdout() //readFromStdout @@ -2715,24 +2776,6 @@ void MainWindow::readFromStdout() //readFromStdout int navg=0; if(t.indexOf("") >= 0) { if(m_mode=="QRA64") m_wideGraph->drawRed(0,0); - /* - if(m_mode=="QRA64") { - char name[512]; - QString fname=m_config.temp_dir ().absoluteFilePath ("red.dat"); - strncpy(name,fname.toLatin1(), sizeof (name) - 1); - name[sizeof (name) - 1] = '\0'; - FILE* fp=fopen(name,"rb"); - if(fp != NULL) { - int ia,ib; - memset(dec_data.sred,0,4*5760); - fread(&ia,4,1,fp); - fread(&ib,4,1,fp); - fread(&dec_data.sred[ia-1],4,ib-ia+1,fp); - m_wideGraph->drawRed(ia,ib); - - } - } - */ m_bDecoded = t.mid(20).trimmed().toInt() > 0; int mswait=3*1000*m_TRperiod/4; if(!m_diskData) killFileTimer.start(mswait); //Kill in 3/4 period @@ -4746,6 +4789,23 @@ void MainWindow::on_actionFT8_triggered() ui->label_6->setText("Band Activity"); ui->label_7->setText("Rx Frequency"); displayWidgets(nWidgets("111010000100111000010000")); + if(m_config.bFox()) { + if(!m_foxTable->isVisible()) { +// QStringList headers{"Call","Loc","dB","Freq","UTC"}; +// m_foxTable->setHorizontalHeaderLabels(headers); +// m_foxTable->setGeometry(QRect(100,100,550,400)); + m_foxTable->show(); + } + } else { + if(m_foxTable) m_foxTable->hide(); + } + if(m_config.bFox() or m_config.bHound()) { + if(m_config.bFox()) ui->labDXped->setText("DXpeditiion Fox"); + if(m_config.bHound()) ui->labDXped->setText("DXpeditiion Hound"); + ui->labDXped->setVisible(true); + } else { + ui->labDXped->setVisible(false); + } statusChanged(); } diff --git a/mainwindow.h b/mainwindow.h index e214b3161..4e8250bd1 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -65,6 +65,7 @@ class QFont; class QHostInfo; class EchoGraph; class FastGraph; +class FoxCalls; class WideGraph; class LogQSO; class Transceiver; @@ -340,6 +341,7 @@ private: QScopedPointer m_prefixes; QScopedPointer m_mouseCmnds; QScopedPointer m_msgAvgWidget; + QScopedPointer m_foxTable; Transceiver::TransceiverState m_rigState; Frequency m_lastDialFreq; diff --git a/mainwindow.ui b/mainwindow.ui index 44cf6eb25..0ad9db356 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -954,6 +954,13 @@ QLabel[oob="true"] { + + + + Fox + + + diff --git a/wsjtx.pro b/wsjtx.pro index 1a327c919..d685e08cb 100644 --- a/wsjtx.pro +++ b/wsjtx.pro @@ -67,7 +67,8 @@ SOURCES += \ echoplot.cpp echograph.cpp fastgraph.cpp fastplot.cpp Modes.cpp \ WSPRBandHopping.cpp MessageAggregator.cpp SampleDownloader.cpp qt_helpers.cpp\ MultiSettings.cpp PhaseEqualizationDialog.cpp IARURegions.cpp MessageBox.cpp \ - EqualizationToolsDialog.cpp + EqualizationToolsDialog.cpp \ + foxcalls.cpp HEADERS += qt_helpers.hpp \ pimpl_h.hpp pimpl_impl.hpp \ @@ -83,7 +84,8 @@ HEADERS += qt_helpers.hpp \ logbook/logbook.h logbook/countrydat.h logbook/countriesworked.h logbook/adif.h \ messageaveraging.h echoplot.h echograph.h fastgraph.h fastplot.h Modes.hpp WSPRBandHopping.hpp \ WsprTxScheduler.h SampleDownloader.hpp MultiSettings.hpp PhaseEqualizationDialog.hpp \ - IARURegions.hpp MessageBox.hpp EqualizationToolsDialog.hpp + IARURegions.hpp MessageBox.hpp EqualizationToolsDialog.hpp \ + foxcalls.h INCLUDEPATH += qmake_only @@ -95,7 +97,8 @@ HEADERS += OmniRigTransceiver.hpp FORMS += mainwindow.ui about.ui Configuration.ui widegraph.ui astro.ui \ logqso.ui wf_palette_design_dialog.ui messageaveraging.ui echograph.ui \ - fastgraph.ui + fastgraph.ui \ + foxcalls.ui RC_FILE = wsjtx.rc RESOURCES = wsjtx.qrc