mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-03-22 12:08:43 -04:00
Experimenting with a new Fox GUI.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@8210 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
207aefb8d0
commit
a72de82a39
@ -297,7 +297,6 @@ set (wsjtx_CXXSRCS
|
||||
widegraph.cpp
|
||||
echograph.cpp
|
||||
echoplot.cpp
|
||||
foxcalls.cpp
|
||||
fastgraph.cpp
|
||||
fastplot.cpp
|
||||
about.cpp
|
||||
@ -654,7 +653,6 @@ set (wsjtx_UISRCS
|
||||
astro.ui
|
||||
echograph.ui
|
||||
fastgraph.ui
|
||||
foxcalls.ui
|
||||
messageaveraging.ui
|
||||
widegraph.ui
|
||||
logqso.ui
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "displaytext.h"
|
||||
|
||||
#include "mainwindow.h"
|
||||
#include <QMouseEvent>
|
||||
#include <QDateTime>
|
||||
#include <QTextCharFormat>
|
||||
|
181
foxcalls.cpp
181
foxcalls.cpp
@ -1,181 +0,0 @@
|
||||
#include "foxcalls.h"
|
||||
#include "qt_helpers.hpp"
|
||||
#include <QSettings>
|
||||
#include <QApplication>
|
||||
#include <QMap>
|
||||
#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").toByteArray());
|
||||
ui->cbReverse->setVisible(false);
|
||||
ui->foxPlainTextEdit->setReadOnly (true);
|
||||
ui->foxPlainTextEdit->viewport()->installEventFilter(this);
|
||||
m_nToBeCalled=0;
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
void FoxCalls::insertText(QString t)
|
||||
{
|
||||
QMap<QString,QString> map;
|
||||
QStringList lines;
|
||||
QString msg,c2,t1;
|
||||
QString ABC{"ABCDEFGHIJKLMNOPQRSTUVWXYZ"};
|
||||
QList<int> list;
|
||||
int i,j,k,n,nlines;
|
||||
|
||||
if(m_bFirst) {
|
||||
QTextDocument *doc = ui->foxPlainTextEdit->document();
|
||||
QFont font = doc->defaultFont();
|
||||
font.setFamily("Courier New");
|
||||
font.setPointSize(12);
|
||||
doc->setDefaultFont(font);
|
||||
ui->label_2->setFont(font);
|
||||
ui->label_2->setText("Call Grid dB Freq Age");
|
||||
ui->pteToBeCalled->setFont(font);
|
||||
ui->pteCalled->setFont(font);
|
||||
m_bFirst=false;
|
||||
}
|
||||
|
||||
m_t0=t;
|
||||
// Save only the most recent transmission from each caller.
|
||||
lines = t.split("\n");
|
||||
nlines=lines.length()-1;
|
||||
for(i=0; i<nlines; i++) {
|
||||
msg=lines.at(i);
|
||||
c2=msg.split(" ").at(0);
|
||||
map[c2]=msg;
|
||||
}
|
||||
|
||||
j=0;
|
||||
t="";
|
||||
for(auto a: map.keys()) {
|
||||
t1=map[a].split(" ",QString::SkipEmptyParts).at(2);
|
||||
int nsnr=t1.toInt();
|
||||
if(nsnr>=ui->sbMinDB->value() and nsnr<=ui->sbMaxDB->value()) {
|
||||
if(ui->rbCall->isChecked()) t += map[a] + "\n";
|
||||
if(ui->rbSNR->isChecked() or ui->rbAge->isChecked()) {
|
||||
i=2;
|
||||
if(ui->rbAge->isChecked()) i=4;
|
||||
t1=map[a].split(" ",QString::SkipEmptyParts).at(i);
|
||||
n=1000*(t1.toInt()+100) + j;
|
||||
}
|
||||
|
||||
if(ui->rbGrid->isChecked()) {
|
||||
t1=map[a].split(" ",QString::SkipEmptyParts).at(1);
|
||||
int i1=ABC.indexOf(t1.mid(0,1));
|
||||
int i2=ABC.indexOf(t1.mid(1,1));
|
||||
n=100*(26*i1+i2)+t1.mid(2,2).toInt();
|
||||
n=1000*n + j;
|
||||
}
|
||||
|
||||
list.insert(j,n);
|
||||
m_lines2.insert(j,map[a]);
|
||||
j++;
|
||||
}
|
||||
}
|
||||
|
||||
if(ui->rbSNR->isChecked() or ui->rbAge->isChecked() or ui->rbGrid->isChecked()) {
|
||||
if(m_bReverse) {
|
||||
qSort(list.begin(),list.end(),qGreater<int>());
|
||||
} else {
|
||||
qSort(list.begin(),list.end());
|
||||
}
|
||||
}
|
||||
|
||||
if(ui->rbSNR->isChecked() or ui->rbAge->isChecked() or ui->rbGrid->isChecked()) {
|
||||
for(i=0; i<j; i++) {
|
||||
k=list[i]%1000;
|
||||
n=list[i]/1000 - 100;
|
||||
t += m_lines2.at(k) + "\n";
|
||||
}
|
||||
}
|
||||
|
||||
ui->foxPlainTextEdit->setPlainText(t);
|
||||
QString uniqueCalls;
|
||||
uniqueCalls.sprintf(" Unique callers: %d",j);
|
||||
ui->labCallers->setText(uniqueCalls);
|
||||
}
|
||||
|
||||
void FoxCalls::on_rbCall_toggled(bool b)
|
||||
{
|
||||
ui->cbReverse->setVisible(!b);
|
||||
insertText(m_t0);
|
||||
}
|
||||
|
||||
void FoxCalls::on_rbGrid_toggled(bool b)
|
||||
{
|
||||
ui->cbReverse->setVisible(b);
|
||||
insertText(m_t0);
|
||||
}
|
||||
void FoxCalls::on_rbSNR_toggled(bool b)
|
||||
{
|
||||
ui->cbReverse->setVisible(b);
|
||||
insertText(m_t0);
|
||||
}
|
||||
void FoxCalls::on_rbAge_toggled(bool b)
|
||||
{
|
||||
ui->cbReverse->setVisible(b);
|
||||
insertText(m_t0);
|
||||
}
|
||||
|
||||
void FoxCalls::on_cbReverse_toggled(bool b)
|
||||
{
|
||||
m_bReverse=b;
|
||||
insertText(m_t0);
|
||||
}
|
||||
|
||||
void FoxCalls::on_sbMaxDB_valueChanged(int n)
|
||||
{
|
||||
insertText(m_t0);
|
||||
}
|
||||
|
||||
void FoxCalls::on_sbMinDB_valueChanged(int n)
|
||||
{
|
||||
insertText(m_t0);
|
||||
}
|
||||
|
||||
bool FoxCalls::eventFilter(QObject *obj, QEvent *e)
|
||||
{
|
||||
if(m_nToBeCalled<4) {
|
||||
if ((obj == ui->foxPlainTextEdit || obj==ui->foxPlainTextEdit->viewport()) &&
|
||||
e->type() == QEvent::MouseButtonPress) {
|
||||
QMouseEvent *me= static_cast<QMouseEvent*>(e);
|
||||
int i=int(0.05592*me->y()+0.5) - 1;
|
||||
QString t3=m_lines2.at(i);
|
||||
t3=t3.split(" ").at(0) + "\n";
|
||||
ui->pteToBeCalled->insertPlainText(t3);
|
||||
m_nToBeCalled++;
|
||||
qDebug() << "a" << m_nToBeCalled;
|
||||
}
|
||||
}
|
||||
return QWidget::eventFilter(obj, e);
|
||||
}
|
50
foxcalls.h
50
foxcalls.h
@ -1,50 +0,0 @@
|
||||
#ifndef FOXCALLS_H
|
||||
#define FOXCALLS_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QScopedPointer>
|
||||
#include <QFont>
|
||||
#include <QDebug>
|
||||
|
||||
namespace Ui {
|
||||
class FoxCalls;
|
||||
}
|
||||
|
||||
class QSettings;
|
||||
class QFont;
|
||||
|
||||
class FoxCalls : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
protected:
|
||||
void closeEvent (QCloseEvent *) override;
|
||||
|
||||
public:
|
||||
explicit FoxCalls(QSettings *, QWidget *parent = 0);
|
||||
~FoxCalls();
|
||||
|
||||
void saveSettings();
|
||||
void insertText(QString t);
|
||||
|
||||
private slots:
|
||||
void on_rbCall_toggled(bool b);
|
||||
void on_rbGrid_toggled(bool b);
|
||||
void on_rbSNR_toggled(bool b);
|
||||
void on_rbAge_toggled(bool b);
|
||||
void on_cbReverse_toggled(bool b);
|
||||
void on_sbMaxDB_valueChanged(int n);
|
||||
void on_sbMinDB_valueChanged(int n);
|
||||
bool eventFilter(QObject *obj, QEvent *event);
|
||||
|
||||
private:
|
||||
bool m_bFirst=true;
|
||||
bool m_bReverse;
|
||||
qint32 m_nToBeCalled;
|
||||
QString m_t0;
|
||||
QStringList m_lines2;
|
||||
QSettings * m_settings;
|
||||
QScopedPointer<Ui::FoxCalls> ui;
|
||||
};
|
||||
|
||||
#endif // FOXCALLS_H
|
266
foxcalls.ui
266
foxcalls.ui
@ -1,266 +0,0 @@
|
||||
<?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>546</width>
|
||||
<height>562</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout"/>
|
||||
</item>
|
||||
<item>
|
||||
<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="rbCall">
|
||||
<property name="text">
|
||||
<string>Call</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="rbGrid">
|
||||
<property name="text">
|
||||
<string>Grid</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="rbSNR">
|
||||
<property name="text">
|
||||
<string>dB</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="rbAge">
|
||||
<property name="text">
|
||||
<string>Age</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="cbReverse">
|
||||
<property name="text">
|
||||
<string>Reverse</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>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Courier New</family>
|
||||
<pointsize>12</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QPlainTextEdit" name="foxPlainTextEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>375</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>375</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Courier New</family>
|
||||
<pointsize>12</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="labCallers">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string> Unique callers: 0</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>To be called:</string>
|
||||
</property>
|
||||
<widget class="QPlainTextEdit" name="pteToBeCalled">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>8</x>
|
||||
<y>17</y>
|
||||
<width>100</width>
|
||||
<height>90</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>130</y>
|
||||
<width>128</width>
|
||||
<height>126</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Called:</string>
|
||||
</property>
|
||||
<widget class="QPlainTextEdit" name="pteCalled">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>9</x>
|
||||
<y>16</y>
|
||||
<width>100</width>
|
||||
<height>90</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QSpinBox" name="sbMaxDB">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>13</x>
|
||||
<y>270</y>
|
||||
<width>90</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="prefix">
|
||||
<string>Max dB: </string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-50</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>50</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>30</number>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QSpinBox" name="sbMinDB">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>13</x>
|
||||
<y>300</y>
|
||||
<width>90</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="prefix">
|
||||
<string>Min dB: </string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-50</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>50</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>-30</number>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
125
mainwindow.cpp
125
mainwindow.cpp
@ -37,7 +37,6 @@
|
||||
#include "echograph.h"
|
||||
#include "fastplot.h"
|
||||
#include "fastgraph.h"
|
||||
#include "foxcalls.h"
|
||||
#include "about.h"
|
||||
#include "messageaveraging.h"
|
||||
#include "widegraph.h"
|
||||
@ -204,7 +203,6 @@ 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_foxCalls (new FoxCalls(m_settings)),
|
||||
m_lastDialFreq {0},
|
||||
m_dialFreqRxWSPR {0},
|
||||
m_detector {new Detector {RX_SAMPLE_RATE, NTMAX, downSampleFactor}},
|
||||
@ -866,6 +864,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
|
||||
m_bDoubleClicked=false;
|
||||
m_bCallingCQ=false;
|
||||
m_bCheckedContest=false;
|
||||
m_bDisplayedOnce=false;
|
||||
m_wait=0;
|
||||
m_CQtype="CQ";
|
||||
|
||||
@ -2050,7 +2049,6 @@ void MainWindow::closeEvent(QCloseEvent * e)
|
||||
m_config.transceiver_offline ();
|
||||
writeSettings ();
|
||||
m_astroWidget.reset ();
|
||||
m_foxCalls.reset();
|
||||
m_guiTimer.stop ();
|
||||
m_prefixes.reset ();
|
||||
m_shortcuts.reset ();
|
||||
@ -2114,10 +2112,6 @@ void MainWindow::on_actionFast_Graph_triggered()
|
||||
m_fastGraph->show();
|
||||
}
|
||||
|
||||
void MainWindow::on_actionFox_Callers_triggered()
|
||||
{
|
||||
m_foxCalls->show();
|
||||
}
|
||||
void MainWindow::on_actionSolve_FreqCal_triggered()
|
||||
{
|
||||
QString dpath{QDir::toNativeSeparators(m_config.writeable_data_dir().absolutePath()+"/")};
|
||||
@ -2718,7 +2712,8 @@ void MainWindow::decodeDone ()
|
||||
if(f.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||
QTextStream s(&f);
|
||||
QString t=s.readAll();
|
||||
m_foxCalls->insertText(t);
|
||||
QString t1=sortFoxCalls(t,1,10,-30,30);
|
||||
ui->decodedTextBrowser->setText(t1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2755,12 +2750,14 @@ void MainWindow::readFromStdout() //readFromStdout
|
||||
if(navg>1 or t.indexOf("f*")>0) bAvgMsg=true;
|
||||
}
|
||||
}
|
||||
/*
|
||||
if(m_mode=="FT8" and m_bDXped) {
|
||||
int i3bit=t.mid(44,1).toInt();
|
||||
t=t.mid(0,44) + " " + t.mid(45);
|
||||
if(i3bit==1) t=t.mid(0,24) + "RR73 NOW " + t.mid(24);
|
||||
if(i3bit==2) t=t.mid(0,24) + "NIL NOW " + t.mid(24);
|
||||
}
|
||||
*/
|
||||
QFile f {m_config.writeable_data_dir ().absoluteFilePath ("ALL.TXT")};
|
||||
if (f.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append)) {
|
||||
QTextStream out(&f);
|
||||
@ -2779,24 +2776,34 @@ void MainWindow::readFromStdout() //readFromStdout
|
||||
.arg (f.fileName ()).arg (f.errorString ()));
|
||||
}
|
||||
|
||||
if (m_config.insert_blank () && m_blankLine)
|
||||
{
|
||||
QString band;
|
||||
if((QDateTime::currentMSecsSinceEpoch() / 1000 - m_secBandChanged) > 4*m_TRperiod/4) {
|
||||
band = ' ' + m_config.bands ()->find (m_freqNominal);
|
||||
}
|
||||
ui->decodedTextBrowser->insertLineSpacer (band.rightJustified (40, '-'));
|
||||
m_blankLine = false;
|
||||
if (m_config.insert_blank () && m_blankLine && !m_config.bFox()) {
|
||||
QString band;
|
||||
if((QDateTime::currentMSecsSinceEpoch() / 1000 - m_secBandChanged) > 4*m_TRperiod/4) {
|
||||
band = ' ' + m_config.bands ()->find (m_freqNominal);
|
||||
}
|
||||
ui->decodedTextBrowser->insertLineSpacer (band.rightJustified (40, '-'));
|
||||
m_blankLine = false;
|
||||
}
|
||||
|
||||
DecodedText decodedtext {QString::fromUtf8 (t.constData ()).remove (QRegularExpression {"\r|\n"}), "FT8" == m_mode &&
|
||||
ui->cbVHFcontest->isChecked(), m_config.my_grid ()};
|
||||
|
||||
//Left (Band activity) window
|
||||
if(!bAvgMsg) {
|
||||
ui->decodedTextBrowser->displayDecodedText(decodedtext,m_baseCall,m_config.DXCC(),
|
||||
if(m_config.bFox()) {
|
||||
if(!m_bDisplayedOnce) {
|
||||
// This hack sets the font. Surely there's a better way!
|
||||
DecodedText dt{".",false," "};
|
||||
ui->decodedTextBrowser->displayDecodedText(dt,m_baseCall,m_config.DXCC(),
|
||||
m_logBook,m_config.color_CQ(),m_config.color_MyCall(),
|
||||
m_config.color_DXCC(), m_config.color_NewCall());
|
||||
m_bDisplayedOnce=true;
|
||||
}
|
||||
} else {
|
||||
ui->decodedTextBrowser->displayDecodedText(decodedtext,m_baseCall,m_config.DXCC(),
|
||||
m_logBook,m_config.color_CQ(),m_config.color_MyCall(),
|
||||
m_config.color_DXCC(), m_config.color_NewCall());
|
||||
}
|
||||
}
|
||||
|
||||
//Right (Rx Frequency) window
|
||||
@ -4744,19 +4751,14 @@ 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_foxCalls->isVisible()) {
|
||||
m_foxCalls->show();
|
||||
}
|
||||
} else {
|
||||
if(m_foxCalls) m_foxCalls->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");
|
||||
if(m_config.bFox()) ui->labDXped->setText("DXpedition: Fox");
|
||||
if(m_config.bHound()) ui->labDXped->setText("DXpedition: Hound");
|
||||
ui->labDXped->setVisible(true);
|
||||
ui->cbVHFcontest->setVisible(false);
|
||||
} else {
|
||||
ui->labDXped->setVisible(false);
|
||||
ui->cbVHFcontest->setVisible(true);
|
||||
}
|
||||
statusChanged();
|
||||
}
|
||||
@ -6919,3 +6921,74 @@ void MainWindow::write_transmit_entry (QString const& file_name)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
QString MainWindow::sortFoxCalls(QString t, int isort, int max_N, int min_dB, int max_dB)
|
||||
{
|
||||
QMap<QString,QString> map;
|
||||
QStringList lines,lines2;
|
||||
QString msg,c2,t1;
|
||||
QString ABC{"ABCDEFGHIJKLMNOPQRSTUVWXYZ"};
|
||||
QList<int> list;
|
||||
int i,j,k,n,nlines;
|
||||
bool bReverse;
|
||||
|
||||
bReverse=(isort<0);
|
||||
isort=qAbs(isort);
|
||||
// Save only the most recent transmission from each caller.
|
||||
lines = t.split("\n");
|
||||
nlines=lines.length()-1;
|
||||
for(i=0; i<nlines; i++) {
|
||||
msg=lines.at(i);
|
||||
c2=msg.split(" ").at(0);
|
||||
map[c2]=msg;
|
||||
}
|
||||
|
||||
j=0;
|
||||
t="";
|
||||
for(auto a: map.keys()) {
|
||||
t1=map[a].split(" ",QString::SkipEmptyParts).at(2);
|
||||
int nsnr=t1.toInt();
|
||||
if(nsnr >= min_dB and nsnr <= max_dB) {
|
||||
if(isort==1) t += map[a] + "\n";
|
||||
if(isort==3 or isort==4) {
|
||||
i=2;
|
||||
if(isort==4) i=4;
|
||||
t1=map[a].split(" ",QString::SkipEmptyParts).at(i);
|
||||
n=1000*(t1.toInt()+100) + j;
|
||||
}
|
||||
|
||||
if(isort==2) {
|
||||
t1=map[a].split(" ",QString::SkipEmptyParts).at(1);
|
||||
int i1=ABC.indexOf(t1.mid(0,1));
|
||||
int i2=ABC.indexOf(t1.mid(1,1));
|
||||
n=100*(26*i1+i2)+t1.mid(2,2).toInt();
|
||||
n=1000*n + j;
|
||||
}
|
||||
|
||||
list.insert(j,n);
|
||||
lines2.insert(j,map[a]);
|
||||
j++;
|
||||
}
|
||||
}
|
||||
|
||||
if(isort>1) {
|
||||
if(bReverse) {
|
||||
qSort(list.begin(),list.end(),qGreater<int>());
|
||||
} else {
|
||||
qSort(list.begin(),list.end());
|
||||
}
|
||||
}
|
||||
|
||||
if(isort>1) {
|
||||
for(i=0; i<j; i++) {
|
||||
k=list[i]%1000;
|
||||
n=list[i]/1000 - 100;
|
||||
t += lines2.at(k) + "\n";
|
||||
}
|
||||
}
|
||||
|
||||
// QString uniqueCalls;
|
||||
// uniqueCalls.sprintf(" Unique callers: %d",j);
|
||||
// ui->labCallers->setText(uniqueCalls);
|
||||
return t;
|
||||
}
|
||||
|
@ -65,7 +65,6 @@ class QFont;
|
||||
class QHostInfo;
|
||||
class EchoGraph;
|
||||
class FastGraph;
|
||||
class FoxCalls;
|
||||
class WideGraph;
|
||||
class LogQSO;
|
||||
class Transceiver;
|
||||
@ -97,6 +96,7 @@ public:
|
||||
QSharedMemory *shdmem, unsigned downSampleFactor,
|
||||
QSplashScreen *,
|
||||
QWidget *parent = nullptr);
|
||||
qint32 m_isort;
|
||||
~MainWindow();
|
||||
|
||||
public slots:
|
||||
@ -269,7 +269,6 @@ private slots:
|
||||
void on_actionEcho_triggered();
|
||||
void on_actionISCAT_triggered();
|
||||
void on_actionFast_Graph_triggered();
|
||||
void on_actionFox_Callers_triggered();
|
||||
void fast_decode_done();
|
||||
void on_actionMeasure_reference_spectrum_triggered();
|
||||
void on_actionErase_reference_spectrum_triggered();
|
||||
@ -342,7 +341,6 @@ private:
|
||||
QScopedPointer<HelpTextWindow> m_prefixes;
|
||||
QScopedPointer<HelpTextWindow> m_mouseCmnds;
|
||||
QScopedPointer<MessageAveraging> m_msgAvgWidget;
|
||||
QScopedPointer<FoxCalls> m_foxCalls;
|
||||
|
||||
Transceiver::TransceiverState m_rigState;
|
||||
Frequency m_lastDialFreq;
|
||||
@ -569,6 +567,7 @@ private:
|
||||
bool m_block_pwr_tooltip;
|
||||
bool m_PwrBandSetOK;
|
||||
bool m_bVHFwarned;
|
||||
bool m_bDisplayedOnce;
|
||||
Frequency m_lastMonitoredFrequency;
|
||||
double m_toneSpacing;
|
||||
int m_firstDecode;
|
||||
@ -629,6 +628,7 @@ private:
|
||||
, Frequency frequency
|
||||
, QString const& his_call
|
||||
, QString const& his_grid) const;
|
||||
QString sortFoxCalls(QString t, int m_isort, int max_N, int min_dB, int max_dB);
|
||||
void read_wav_file (QString const& fname);
|
||||
void decodeDone ();
|
||||
void subProcessFailed (QProcess *, int exit_code, QProcess::ExitStatus);
|
||||
|
@ -67,8 +67,7 @@ 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 \
|
||||
foxcalls.cpp
|
||||
EqualizationToolsDialog.cpp
|
||||
|
||||
HEADERS += qt_helpers.hpp \
|
||||
pimpl_h.hpp pimpl_impl.hpp \
|
||||
@ -84,8 +83,7 @@ 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 \
|
||||
foxcalls.h
|
||||
IARURegions.hpp MessageBox.hpp EqualizationToolsDialog.hpp
|
||||
|
||||
|
||||
INCLUDEPATH += qmake_only
|
||||
@ -97,8 +95,7 @@ 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 \
|
||||
foxcalls.ui
|
||||
fastgraph.ui
|
||||
|
||||
RC_FILE = wsjtx.rc
|
||||
RESOURCES = wsjtx.qrc
|
||||
|
Loading…
Reference in New Issue
Block a user