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
This commit is contained in:
Joe Taylor 2017-10-30 15:18:54 +00:00
parent cc88b2f679
commit 3e5f703ed2
11 changed files with 320 additions and 32 deletions

View File

@ -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

View File

@ -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 ();

View File

@ -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;

View File

@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>521</width>
<width>534</width>
<height>507</height>
</rect>
</property>
@ -2430,7 +2430,7 @@ Right click for insert and delete options.</string>
</layout>
</widget>
</item>
<item row="1" column="0" colspan="2">
<item row="2" column="0" colspan="2">
<spacer name="verticalSpacer_8">
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -2443,6 +2443,45 @@ Right click for insert and delete options.</string>
</property>
</spacer>
</item>
<item row="1" column="0">
<widget class="QGroupBox" name="groupBox_7">
<property name="minimumSize">
<size>
<width>0</width>
<height>50</height>
</size>
</property>
<property name="title">
<string>FT8 DXpedition mode</string>
</property>
<widget class="QWidget" name="horizontalLayoutWidget">
<property name="geometry">
<rect>
<x>9</x>
<y>10</y>
<width>231</width>
<height>31</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_16">
<item>
<widget class="QCheckBox" name="cbFox">
<property name="text">
<string> Fox</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cbHound">
<property name="text">
<string>Hound</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
</widget>
@ -2595,12 +2634,12 @@ soundcard changes</string>
<slot>setFocus()</slot>
<hints>
<hint type="sourcelabel">
<x>404</x>
<y>62</y>
<x>72</x>
<y>42</y>
</hint>
<hint type="destinationlabel">
<x>199</x>
<y>60</y>
<x>43</x>
<y>42</y>
</hint>
</hints>
</connection>
@ -2611,12 +2650,12 @@ soundcard changes</string>
<slot>setFocus()</slot>
<hints>
<hint type="sourcelabel">
<x>199</x>
<y>60</y>
<x>43</x>
<y>42</y>
</hint>
<hint type="destinationlabel">
<x>404</x>
<y>62</y>
<x>72</x>
<y>42</y>
</hint>
</hints>
</connection>
@ -2627,7 +2666,7 @@ soundcard changes</string>
<buttongroup name="TX_audio_source_button_group"/>
<buttongroup name="split_mode_button_group"/>
<buttongroup name="PTT_method_button_group"/>
<buttongroup name="TX_mode_button_group"/>
<buttongroup name="CAT_data_bits_button_group"/>
<buttongroup name="TX_mode_button_group"/>
</buttongroups>
</ui>

38
foxcalls.cpp Normal file
View File

@ -0,0 +1,38 @@
#include "foxcalls.h"
#include <QSettings>
#include <QApplication>
#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();
}

34
foxcalls.h Normal file
View File

@ -0,0 +1,34 @@
#ifndef FOXCALLS_H
#define FOXCALLS_H
#include <QWidget>
#include <QScopedPointer>
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::FoxCalls> ui;
};
#endif // FOXCALLS_H

89
foxcalls.ui Normal file
View File

@ -0,0 +1,89 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>FoxCalls</class>
<widget class="QWidget" name="FoxCalls">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>540</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<widget class="QTextBrowser" name="textBrowser">
<property name="geometry">
<rect>
<x>20</x>
<y>90</y>
<width>321</width>
<height>192</height>
</rect>
</property>
</widget>
<widget class="QWidget" name="horizontalLayoutWidget">
<property name="geometry">
<rect>
<x>19</x>
<y>60</y>
<width>321</width>
<height>31</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Sort by: </string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButton_3">
<property name="text">
<string>Call</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButton_2">
<property name="text">
<string>Grid</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButton">
<property name="text">
<string>dB</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButton_4">
<property name="text">
<string>Freq</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -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("<DecodeFinished>") >= 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();
}

View File

@ -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<HelpTextWindow> m_prefixes;
QScopedPointer<HelpTextWindow> m_mouseCmnds;
QScopedPointer<MessageAveraging> m_msgAvgWidget;
QScopedPointer<FoxCalls> m_foxTable;
Transceiver::TransceiverState m_rigState;
Frequency m_lastDialFreq;

View File

@ -954,6 +954,13 @@ QLabel[oob=&quot;true&quot;] {
</item>
<item row="15" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_15">
<item>
<widget class="QLabel" name="labDXped">
<property name="text">
<string>Fox</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cbSWL">
<property name="toolTip">

View File

@ -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