Merged master 8748
This commit is contained in:
@@ -1,196 +0,0 @@
|
||||
64 128
|
||||
9 4
|
||||
8 8 8 8 9 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 7 8 8 8 8 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 9 8 8 8 8 8 8 8
|
||||
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
|
||||
1 17 33 50 67 83 98 114 0
|
||||
2 18 34 50 68 84 99 115 0
|
||||
3 19 35 51 69 85 100 115 0
|
||||
4 20 36 52 70 86 101 115 0
|
||||
2 20 35 53 71 87 102 113 128
|
||||
5 21 33 54 64 88 103 116 0
|
||||
6 19 37 55 72 89 98 117 0
|
||||
7 22 38 56 73 90 96 116 0
|
||||
8 23 34 57 72 91 104 118 0
|
||||
7 24 39 58 74 84 100 119 0
|
||||
9 22 40 59 74 92 105 120 0
|
||||
9 25 41 55 75 91 106 114 0
|
||||
10 25 36 51 67 74 107 121 0
|
||||
11 22 36 54 72 93 102 122 0
|
||||
12 25 42 60 76 89 103 123 0
|
||||
8 26 38 51 77 93 105 124 0
|
||||
13 27 40 61 77 94 99 119 0
|
||||
13 17 43 54 73 85 108 124 0
|
||||
1 28 40 62 71 84 108 125 0
|
||||
12 29 38 53 67 86 108 126 0
|
||||
14 28 43 51 78 94 96 117 0
|
||||
11 17 42 62 79 92 104 126 0
|
||||
4 29 39 57 65 87 109 116 0
|
||||
2 27 38 55 78 79 107 127 0
|
||||
13 24 44 53 66 83 103 117 0
|
||||
15 30 43 55 67 90 105 128 0
|
||||
6 22 45 48 78 88 106 119 0
|
||||
14 25 33 63 65 73 99 118 0
|
||||
6 31 46 64 80 95 102 125 0
|
||||
5 18 37 65 79 94 110 113 0
|
||||
14 23 44 59 71 88 111 123 0
|
||||
13 32 47 62 70 91 109 128 0
|
||||
15 23 41 56 76 95 112 0 0
|
||||
11 29 41 47 68 69 105 117 0
|
||||
10 30 37 64 73 86 111 119 0
|
||||
5 32 45 60 69 96 101 127 0
|
||||
15 24 48 62 65 96 97 115 0
|
||||
3 23 42 64 77 83 109 0 0
|
||||
16 18 40 52 69 89 102 112 0
|
||||
9 20 49 63 76 94 109 121 0
|
||||
15 20 33 66 77 84 110 127 0
|
||||
10 21 44 60 80 82 112 126 0
|
||||
16 26 41 58 81 92 107 125 0
|
||||
3 27 48 59 82 95 110 118 0
|
||||
10 27 49 57 71 89 101 124 0
|
||||
4 26 42 61 68 90 100 122 0
|
||||
6 26 44 50 75 85 101 118 0
|
||||
7 28 37 47 66 76 82 114 0
|
||||
12 19 43 52 80 88 104 121 0
|
||||
2 31 47 56 75 93 108 123 0
|
||||
1 31 36 59 81 87 104 124 0
|
||||
3 32 39 50 81 97 106 121 0
|
||||
12 24 34 54 79 90 98 120 0
|
||||
1 19 49 56 82 92 103 122 0
|
||||
7 21 35 61 70 93 106 125 0
|
||||
14 18 46 60 70 97 107 122 0
|
||||
8 31 39 61 63 86 98 127 128
|
||||
4 28 34 45 75 97 110 126 0
|
||||
16 30 45 63 72 95 100 113 0
|
||||
8 21 48 52 74 87 111 114 0
|
||||
9 32 46 58 68 83 113 123 0
|
||||
11 30 46 53 81 91 99 116 0
|
||||
5 29 49 58 78 85 112 120 0
|
||||
16 17 35 57 66 80 111 120 0
|
||||
1 19 51 54
|
||||
2 5 24 50
|
||||
3 38 44 52
|
||||
4 23 46 58
|
||||
6 30 36 63
|
||||
7 27 29 47
|
||||
8 10 48 55
|
||||
9 16 57 60
|
||||
11 12 40 61
|
||||
13 35 42 45
|
||||
14 22 34 62
|
||||
15 20 49 53
|
||||
17 18 25 32
|
||||
21 28 31 56
|
||||
26 33 37 41
|
||||
39 43 59 64
|
||||
1 18 22 64
|
||||
2 30 39 56
|
||||
3 7 49 54
|
||||
4 5 40 41
|
||||
6 42 55 60
|
||||
8 11 14 27
|
||||
9 31 33 38
|
||||
10 25 37 53
|
||||
12 13 15 28
|
||||
16 43 46 47
|
||||
17 24 44 45
|
||||
19 21 48 58
|
||||
20 23 34 63
|
||||
26 35 59 62
|
||||
29 50 51 57
|
||||
32 36 52 61
|
||||
1 6 28 41
|
||||
2 9 53 58
|
||||
3 5 55 64
|
||||
4 13 14 51
|
||||
7 30 35 48
|
||||
8 16 20 24
|
||||
10 23 52 57
|
||||
11 17 19 39
|
||||
12 33 34 43
|
||||
15 22 38 46
|
||||
18 21 26 49
|
||||
25 31 42 47
|
||||
27 36 58 59
|
||||
29 56 61 62
|
||||
32 34 48 50
|
||||
27 37 44 60
|
||||
40 45 54 63
|
||||
1 2 47 52
|
||||
3 13 16 21
|
||||
4 39 49 60
|
||||
5 20 25 62
|
||||
6 14 18 53
|
||||
7 12 24 26
|
||||
8 33 50 54
|
||||
9 23 45 64
|
||||
10 43 61 63
|
||||
11 31 44 51
|
||||
15 36 42 56
|
||||
17 46 55 57
|
||||
19 22 32 37
|
||||
28 40 57 59
|
||||
6 29 35 38
|
||||
23 28 30 37
|
||||
25 41 48 64
|
||||
1 13 20 26
|
||||
2 34 46 61
|
||||
3 34 36 39
|
||||
4 32 55 56
|
||||
5 19 31 45
|
||||
7 9 14 59
|
||||
8 18 28 35
|
||||
10 11 13 60
|
||||
12 47 50 58
|
||||
15 33 40 48
|
||||
16 17 38 41
|
||||
21 24 27 63
|
||||
22 24 30 53
|
||||
29 42 49 64
|
||||
43 51 52 62
|
||||
42 44 48 54
|
||||
1 25 38 61
|
||||
2 10 19 41
|
||||
3 18 47 63
|
||||
4 20 35 57
|
||||
5 23 51 60
|
||||
6 27 31 49
|
||||
7 15 39 45
|
||||
8 26 46 53
|
||||
9 12 32 62
|
||||
11 22 43 54
|
||||
14 16 50 55
|
||||
17 21 30 40
|
||||
29 33 44 59
|
||||
8 21 36 37
|
||||
37 52 56 58
|
||||
1 7 53 57
|
||||
2 17 28 62
|
||||
3 10 46 59
|
||||
4 36 45 47
|
||||
5 14 29 39
|
||||
6 15 25 54
|
||||
9 22 49 51
|
||||
11 16 26 34
|
||||
12 27 52 55
|
||||
13 24 43 56
|
||||
18 19 20 50
|
||||
23 32 38 40
|
||||
30 41 44 58
|
||||
31 35 60 64
|
||||
33 39 42 63
|
||||
5 30 59 61
|
||||
1 12 48 60
|
||||
2 3 4 37
|
||||
6 8 23 62
|
||||
7 21 25 34
|
||||
9 28 44 47
|
||||
10 17 27 35
|
||||
11 53 63 64
|
||||
13 40 49 52
|
||||
14 46 54 56
|
||||
15 31 50 61
|
||||
16 18 45 51
|
||||
19 29 43 55
|
||||
20 22 42 58
|
||||
24 36 41 57
|
||||
5 26 32 57
|
||||
@@ -1,19 +0,0 @@
|
||||
// Status=review
|
||||
[[FIG_CONFIG_STATION]]
|
||||
image::settings-general.png[align="center",alt="Settings Window"]
|
||||
|
||||
Select the *General* tab on the *Settings* window. Under _Station
|
||||
Details_, enter your callsign and 4-digit or 6-digit grid locator.
|
||||
This information will be sufficient for initial tests.
|
||||
|
||||
Meanings of remaining options on the *General* tab should be
|
||||
self-explanatory after you have made some QSOs using _WSJT-X_. You
|
||||
may return to set these options to your preferences later.
|
||||
|
||||
NOTE: If you are using a callsign with an add-on prefix or
|
||||
suffix, or wish to work a station using such a call, be sure to read
|
||||
the section <<COMP-CALL,Compound Callsigns>>.
|
||||
|
||||
IMPORTANT: Enabling VHF/UHF/Microwave features necessarily disables
|
||||
the wideband multi-decode capability of JT65. In most circumstances
|
||||
you should turn this feature off when operating at HF.
|
||||
@@ -1,49 +0,0 @@
|
||||
/* DISTRIB.H - Interface to module for handling distributions over numbers. */
|
||||
|
||||
/* Copyright (c) 1995-2012 by Radford M. Neal and Peter Junteng Liu.
|
||||
*
|
||||
* Permission is granted for anyone to copy, use, modify, and distribute
|
||||
* these programs and accompanying documents for any purpose, provided
|
||||
* this copyright notice is retained and prominently displayed, and note
|
||||
* is made of any changes made to these programs. These programs and
|
||||
* documents are distributed without any warranty, express or implied.
|
||||
* As the programs were written for research purposes only, they have not
|
||||
* been tested to the degree that would be advisable in any important
|
||||
* application. All use of these programs is entirely at the user's own
|
||||
* risk.
|
||||
*/
|
||||
|
||||
|
||||
/* DATA STRUCTURES USED TO STORE A DISTRIBUTION LIST. Entries in the list
|
||||
* (distrib_entry) are stored in an array (distrib->list[]). */
|
||||
|
||||
typedef struct distrib_entry
|
||||
{ int num; /* A positive number */
|
||||
double prop; /* Proportion for this number */
|
||||
} distrib_entry;
|
||||
|
||||
typedef struct distrib
|
||||
{ struct distrib_entry *list; /* The list of numbers and proportions */
|
||||
int size; /* Number of entries in the list */
|
||||
} distrib;
|
||||
|
||||
|
||||
/* MACROS TO ACCESS ELEMENTS OF A DISTRIBUTION LIST. Note that indexes for
|
||||
entries start at 0. */
|
||||
|
||||
#define distrib_num(d,i) \
|
||||
((d)->list[i].num) /* The number for the i'th entry */
|
||||
|
||||
#define distrib_prop(d,i) \
|
||||
((d)->list[i].prop) /* The i'th entry's proportion [probability] */
|
||||
|
||||
#define distrib_size(d) \
|
||||
((d)->size) /* The length of the list (integer) */
|
||||
|
||||
|
||||
/* PROCEDURES FOR DISTRIBUTION LISTS. */
|
||||
|
||||
distrib *distrib_create (char *);
|
||||
void distrib_free (distrib *);
|
||||
|
||||
int distrib_max(distrib *);
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.1 KiB |
@@ -1,40 +0,0 @@
|
||||
subroutine slope(y,npts,xpk)
|
||||
|
||||
! Remove best-fit slope from data in y(i). When fitting the straight line,
|
||||
! ignore the peak around xpk +/- 2 bins
|
||||
|
||||
real y(npts)
|
||||
|
||||
sumw=0.
|
||||
sumx=0.
|
||||
sumy=0.
|
||||
sumx2=0.
|
||||
sumxy=0.
|
||||
sumy2=0.
|
||||
do i=1,npts
|
||||
if(abs(i-xpk).gt.4.0) then
|
||||
sumw=sumw + 1.0
|
||||
x=i
|
||||
sumx=sumx + x
|
||||
sumy=sumy + y(i)
|
||||
sumx2=sumx2 + x*x
|
||||
sumxy=sumxy + x*y(i)
|
||||
sumy2=sumy2 + y(i)**2
|
||||
endif
|
||||
enddo
|
||||
|
||||
delta=sumw*sumx2 - sumx**2
|
||||
a=(sumx2*sumy - sumx*sumxy) / delta
|
||||
b=(sumw*sumxy - sumx*sumy) / delta
|
||||
|
||||
sq=0.
|
||||
do i=1,npts
|
||||
y(i)=y(i)-(a + b*i)
|
||||
if(abs(i-xpk).gt.2.0) sq=sq + y(i)**2
|
||||
enddo
|
||||
rms=sqrt(sq/(sumw-2.0))
|
||||
y=y/rms
|
||||
|
||||
return
|
||||
end subroutine slope
|
||||
|
||||
@@ -1,209 +0,0 @@
|
||||
//
|
||||
// UDPDaemon - an example console application that utilizes the WSJT-X
|
||||
// messaging facility
|
||||
//
|
||||
// This application is only provided as a simple console application
|
||||
// example to demonstrate the WSJT-X messaging facility. It allows
|
||||
// the user to set the server details either as a unicast UDP server
|
||||
// or, if a multicast group address is provided, as a multicast
|
||||
// server. The benefit of the multicast server is that multiple
|
||||
// servers can be active at once each receiving all WSJT-X broadcast
|
||||
// messages and each able to respond to individual WSJT_X clients. To
|
||||
// utilize the multicast group features each WSJT-X client must set
|
||||
// the same multicast group address as the UDP server address for
|
||||
// example 239.255.0.0 for a site local multicast group.
|
||||
//
|
||||
//
|
||||
|
||||
#include <iostream>
|
||||
#include <exception>
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QCommandLineParser>
|
||||
#include <QDateTime>
|
||||
#include <QTime>
|
||||
#include <QHash>
|
||||
#include <QDebug>
|
||||
|
||||
#include "MessageServer.hpp"
|
||||
#include "Radio.hpp"
|
||||
|
||||
#include "qt_helpers.hpp"
|
||||
|
||||
using port_type = MessageServer::port_type;
|
||||
using Frequency = MessageServer::Frequency;
|
||||
|
||||
class Client
|
||||
: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit Client (QString const& id, QObject * parent = nullptr)
|
||||
: QObject {parent}
|
||||
, id_ {id}
|
||||
, dial_frequency_ {0u}
|
||||
{
|
||||
}
|
||||
|
||||
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*/)
|
||||
{
|
||||
if (id == id_)
|
||||
{
|
||||
if (f != dial_frequency_)
|
||||
{
|
||||
std::cout << tr ("%1: Dial frequency changed to %2").arg (id_).arg (f).toStdString () << std::endl;
|
||||
dial_frequency_ = f;
|
||||
}
|
||||
if (mode + sub_mode != mode_)
|
||||
{
|
||||
std::cout << tr ("%1: Mode changed to %2").arg (id_).arg (mode + sub_mode).toStdString () << std::endl;
|
||||
mode_ = mode + sub_mode;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Q_SLOT void decode_added (bool is_new, QString const& client_id, QTime time, qint32 snr
|
||||
, float delta_time, quint32 delta_frequency, QString const& mode
|
||||
, QString const& message, bool low_confidence)
|
||||
{
|
||||
if (client_id == id_)
|
||||
{
|
||||
qDebug () << "new:" << is_new << "t:" << time << "snr:" << snr
|
||||
<< "Dt:" << delta_time << "Df:" << delta_frequency
|
||||
<< "mode:" << mode << "Confidence:" << (low_confidence ? "low" : "high");
|
||||
std::cout << tr ("%1: Decoded %2").arg (id_).arg (message).toStdString () << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
Q_SLOT void beacon_spot_added (bool is_new, QString const& client_id, QTime time, qint32 snr
|
||||
, float delta_time, Frequency delta_frequency, qint32 drift, QString const& callsign
|
||||
, QString const& grid, qint32 power)
|
||||
{
|
||||
if (client_id == id_)
|
||||
{
|
||||
qDebug () << "new:" << is_new << "t:" << time << "snr:" << snr
|
||||
<< "Dt:" << delta_time << "Df:" << delta_frequency
|
||||
<< "drift:" << drift;
|
||||
std::cout << tr ("%1: WSPR decode %2 grid %3 power: %4").arg (id_).arg (callsign).arg (grid).arg (power).toStdString () << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
QString id_;
|
||||
Frequency dial_frequency_;
|
||||
QString mode_;
|
||||
};
|
||||
|
||||
class Server
|
||||
: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Server (port_type port, QHostAddress const& multicast_group)
|
||||
: server_ {new MessageServer {this}}
|
||||
{
|
||||
// connect up server
|
||||
connect (server_, &MessageServer::error, [this] (QString const& message) {
|
||||
std::cerr << tr ("Network Error: %1").arg ( message).toStdString () << std::endl;
|
||||
});
|
||||
connect (server_, &MessageServer::client_opened, this, &Server::add_client);
|
||||
connect (server_, &MessageServer::client_closed, this, &Server::remove_client);
|
||||
|
||||
server_->start (port, multicast_group);
|
||||
}
|
||||
|
||||
private:
|
||||
void add_client (QString const& id, QString const& version, QString const& revision)
|
||||
{
|
||||
auto client = new Client {id};
|
||||
connect (server_, &MessageServer::status_update, client, &Client::update_status);
|
||||
connect (server_, &MessageServer::decode, client, &Client::decode_added);
|
||||
connect (server_, &MessageServer::WSPR_decode, client, &Client::beacon_spot_added);
|
||||
clients_[id] = client;
|
||||
server_->replay (id);
|
||||
std::cout << "Discovered WSJT-X instance: " << id.toStdString ();
|
||||
if (version.size ())
|
||||
{
|
||||
std::cout << " v" << version.toStdString ();
|
||||
}
|
||||
if (revision.size ())
|
||||
{
|
||||
std::cout << " (" << revision.toStdString () << ")";
|
||||
}
|
||||
std::cout << std::endl;
|
||||
}
|
||||
|
||||
void remove_client (QString const& id)
|
||||
{
|
||||
auto iter = clients_.find (id);
|
||||
if (iter != std::end (clients_))
|
||||
{
|
||||
clients_.erase (iter);
|
||||
(*iter)->deleteLater ();
|
||||
}
|
||||
std::cout << "Removed WSJT-X instance: " << id.toStdString () << std::endl;
|
||||
}
|
||||
|
||||
MessageServer * server_;
|
||||
|
||||
// maps client id to clients
|
||||
QHash<QString, Client *> clients_;
|
||||
};
|
||||
|
||||
#include "UDPDaemon.moc"
|
||||
|
||||
int main (int argc, char * argv[])
|
||||
{
|
||||
QCoreApplication app {argc, argv};
|
||||
try
|
||||
{
|
||||
setlocale (LC_NUMERIC, "C"); // ensure number forms are in
|
||||
// consistent format, do this after
|
||||
// instantiating QApplication so
|
||||
// that GUI has correct l18n
|
||||
|
||||
app.setApplicationName ("WSJT-X UDP Message Server Daemon");
|
||||
app.setApplicationVersion ("1.0");
|
||||
|
||||
QCommandLineParser parser;
|
||||
parser.setApplicationDescription ("\nWSJT-X UDP Message Server Daemon.");
|
||||
auto help_option = parser.addHelpOption ();
|
||||
auto version_option = parser.addVersionOption ();
|
||||
|
||||
QCommandLineOption port_option (QStringList {"p", "port"},
|
||||
app.translate ("UDPDaemon",
|
||||
"Where <PORT> is the UDP service port number to listen on.\n"
|
||||
"The default service port is 2237."),
|
||||
app.translate ("UDPDaemon", "PORT"),
|
||||
"2237");
|
||||
parser.addOption (port_option);
|
||||
|
||||
QCommandLineOption multicast_addr_option (QStringList {"g", "multicast-group"},
|
||||
app.translate ("UDPDaemon",
|
||||
"Where <GROUP> is the multicast group to join.\n"
|
||||
"The default is a unicast server listening on all interfaces."),
|
||||
app.translate ("UDPDaemon", "GROUP"));
|
||||
parser.addOption (multicast_addr_option);
|
||||
|
||||
parser.process (app);
|
||||
|
||||
Server server {static_cast<port_type> (parser.value (port_option).toUInt ()), QHostAddress {parser.value (multicast_addr_option)}};
|
||||
|
||||
return app.exec ();
|
||||
}
|
||||
catch (std::exception const & e)
|
||||
{
|
||||
std::cerr << "Error: " << e.what () << '\n';
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
std::cerr << "Unexpected error\n";
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
@@ -1,99 +0,0 @@
|
||||
#include "logbook.h"
|
||||
#include <QDebug>
|
||||
#include <QFontMetrics>
|
||||
#include <QStandardPaths>
|
||||
#include <QDir>
|
||||
|
||||
namespace
|
||||
{
|
||||
auto logFileName = "wsjtx_log.adi";
|
||||
auto countryFileName = "cty.dat";
|
||||
}
|
||||
|
||||
void LogBook::init()
|
||||
{
|
||||
QDir dataPath {QStandardPaths::writableLocation (QStandardPaths::DataLocation)};
|
||||
QString countryDataFilename;
|
||||
if (dataPath.exists (countryFileName))
|
||||
{
|
||||
// User override
|
||||
countryDataFilename = dataPath.absoluteFilePath (countryFileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
countryDataFilename = QString {":/"} + countryFileName;
|
||||
}
|
||||
|
||||
_countries.init(countryDataFilename);
|
||||
_countries.load();
|
||||
|
||||
_worked.init(_countries.getCountryNames());
|
||||
|
||||
_log.init(dataPath.absoluteFilePath (logFileName));
|
||||
_log.load();
|
||||
|
||||
_setAlreadyWorkedFromLog();
|
||||
|
||||
/*
|
||||
int QSOcount = _log.getCount();
|
||||
int count = _worked.getWorkedCount();
|
||||
qDebug() << QSOcount << "QSOs and" << count << "countries worked in file" << logFilename;
|
||||
*/
|
||||
|
||||
// QString call = "ok1ct";
|
||||
// QString countryName;
|
||||
// bool callWorkedBefore,countryWorkedBefore;
|
||||
// match(/*in*/call, /*out*/ countryName,callWorkedBefore,countryWorkedBefore);
|
||||
// qDebug() << countryName;
|
||||
|
||||
}
|
||||
|
||||
|
||||
void LogBook::_setAlreadyWorkedFromLog()
|
||||
{
|
||||
QList<QString> calls = _log.getCallList();
|
||||
QString c;
|
||||
foreach(c,calls)
|
||||
{
|
||||
QString countryName = _countries.find(c);
|
||||
if (countryName.length() > 0)
|
||||
{
|
||||
_worked.setAsWorked(countryName);
|
||||
//qDebug() << countryName << " worked " << c;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LogBook::match(/*in*/const QString call,
|
||||
/*out*/ QString &countryName,
|
||||
bool &callWorkedBefore,
|
||||
bool &countryWorkedBefore)
|
||||
{
|
||||
if (call.length() > 0)
|
||||
{
|
||||
QString currentMode = "JT9"; // JT65 == JT9 in ADIF::match()
|
||||
QString currentBand = ""; // match any band
|
||||
callWorkedBefore = _log.match(call,currentBand,currentMode);
|
||||
countryName = _countries.find(call);
|
||||
if (countryName.length() > 0) // country was found
|
||||
countryWorkedBefore = _worked.getHasWorked(countryName);
|
||||
else
|
||||
{
|
||||
countryName = "where?"; //error: prefix not found
|
||||
countryWorkedBefore = false;
|
||||
}
|
||||
}
|
||||
//qDebug() << "Logbook:" << call << ":" << countryName << "Cty B4:" << countryWorkedBefore << "call B4:" << callWorkedBefore;
|
||||
}
|
||||
|
||||
void LogBook::addAsWorked(const QString call, const QString band, const QString mode, const QString date)
|
||||
{
|
||||
//qDebug() << "adding " << call << " as worked";
|
||||
_log.add(call,band,mode,date);
|
||||
QString countryName = _countries.find(call);
|
||||
if (countryName.length() > 0)
|
||||
_worked.setAsWorked(countryName);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,141 +0,0 @@
|
||||
#include "DecodesModel.hpp"
|
||||
|
||||
#include <QStandardItem>
|
||||
#include <QModelIndex>
|
||||
#include <QTime>
|
||||
#include <QString>
|
||||
#include <QFont>
|
||||
#include <QList>
|
||||
|
||||
namespace
|
||||
{
|
||||
char const * const headings[] = {
|
||||
QT_TRANSLATE_NOOP ("DecodesModel", "Client"),
|
||||
QT_TRANSLATE_NOOP ("DecodesModel", "Time"),
|
||||
QT_TRANSLATE_NOOP ("DecodesModel", "Snr"),
|
||||
QT_TRANSLATE_NOOP ("DecodesModel", "DT"),
|
||||
QT_TRANSLATE_NOOP ("DecodesModel", "DF"),
|
||||
QT_TRANSLATE_NOOP ("DecodesModel", "Md"),
|
||||
QT_TRANSLATE_NOOP ("DecodesModel", "Message"),
|
||||
QT_TRANSLATE_NOOP ("DecodesModel", "Confidence"),
|
||||
};
|
||||
|
||||
QString confidence_string (bool low_confidence)
|
||||
{
|
||||
return low_confidence ? QT_TRANSLATE_NOOP ("DecodesModel", "low") : QT_TRANSLATE_NOOP ("DecodesModel", "high");
|
||||
}
|
||||
|
||||
QFont text_font {"Courier", 10};
|
||||
|
||||
QList<QStandardItem *> make_row (QString const& client_id, QTime time, qint32 snr, float delta_time
|
||||
, quint32 delta_frequency, QString const& mode, QString const& message
|
||||
, bool low_confidence, bool is_fast)
|
||||
{
|
||||
auto time_item = new QStandardItem {time.toString (is_fast || "~" == mode ? "hh:mm:ss" : "hh:mm")};
|
||||
time_item->setData (time);
|
||||
time_item->setTextAlignment (Qt::AlignRight);
|
||||
|
||||
auto snr_item = new QStandardItem {QString::number (snr)};
|
||||
snr_item->setData (snr);
|
||||
snr_item->setTextAlignment (Qt::AlignRight);
|
||||
|
||||
auto dt = new QStandardItem {QString::number (delta_time)};
|
||||
dt->setData (delta_time);
|
||||
dt->setTextAlignment (Qt::AlignRight);
|
||||
|
||||
auto df = new QStandardItem {QString::number (delta_frequency)};
|
||||
df->setData (delta_frequency);
|
||||
df->setTextAlignment (Qt::AlignRight);
|
||||
|
||||
auto md = new QStandardItem {mode};
|
||||
md->setTextAlignment (Qt::AlignHCenter);
|
||||
|
||||
auto confidence = new QStandardItem {confidence_string (low_confidence)};
|
||||
confidence->setTextAlignment (Qt::AlignHCenter);
|
||||
|
||||
QList<QStandardItem *> row {
|
||||
new QStandardItem {client_id}, time_item, snr_item, dt, df, md, new QStandardItem {message}, confidence};
|
||||
Q_FOREACH (auto& item, row)
|
||||
{
|
||||
item->setEditable (false);
|
||||
item->setFont (text_font);
|
||||
item->setTextAlignment (item->textAlignment () | Qt::AlignVCenter);
|
||||
}
|
||||
return row;
|
||||
}
|
||||
}
|
||||
|
||||
DecodesModel::DecodesModel (QObject * parent)
|
||||
: QStandardItemModel {0, sizeof (headings) / sizeof (headings[0]), parent}
|
||||
{
|
||||
int column {0};
|
||||
for (auto const& heading : headings)
|
||||
{
|
||||
setHeaderData (column++, Qt::Horizontal, tr (heading));
|
||||
}
|
||||
}
|
||||
|
||||
void DecodesModel::add_decode (bool is_new, QString const& client_id, QTime time, qint32 snr, float delta_time
|
||||
, quint32 delta_frequency, QString const& mode, QString const& message
|
||||
, bool low_confidence, bool is_fast)
|
||||
{
|
||||
if (!is_new)
|
||||
{
|
||||
int target_row {-1};
|
||||
for (auto row = 0; row < rowCount (); ++row)
|
||||
{
|
||||
if (data (index (row, 0)).toString () == client_id)
|
||||
{
|
||||
auto row_time = item (row, 1)->data ().toTime ();
|
||||
if (row_time == time
|
||||
&& item (row, 2)->data ().toInt () == snr
|
||||
&& item (row, 3)->data ().toFloat () == delta_time
|
||||
&& item (row, 4)->data ().toUInt () == delta_frequency
|
||||
&& data (index (row, 5)).toString () == mode
|
||||
&& data (index (row, 6)).toString () == message
|
||||
&& data (index (row, 7)).toString () == confidence_string (low_confidence))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (time <= row_time)
|
||||
{
|
||||
target_row = row; // last row with same time
|
||||
}
|
||||
}
|
||||
}
|
||||
if (target_row >= 0)
|
||||
{
|
||||
insertRow (target_row + 1, make_row (client_id, time, snr, delta_time, delta_frequency, mode
|
||||
, message, low_confidence, is_fast));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
appendRow (make_row (client_id, time, snr, delta_time, delta_frequency, mode, message, low_confidence, is_fast));
|
||||
}
|
||||
|
||||
void DecodesModel::clear_decodes (QString const& client_id)
|
||||
{
|
||||
for (auto row = rowCount () - 1; row >= 0; --row)
|
||||
{
|
||||
if (data (index (row, 0)).toString () == client_id)
|
||||
{
|
||||
removeRow (row);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DecodesModel::do_reply (QModelIndex const& source)
|
||||
{
|
||||
auto row = source.row ();
|
||||
Q_EMIT reply (data (index (row, 0)).toString ()
|
||||
, item (row, 1)->data ().toTime ()
|
||||
, item (row, 2)->data ().toInt ()
|
||||
, item (row, 3)->data ().toFloat ()
|
||||
, item (row, 4)->data ().toInt ()
|
||||
, data (index (row, 5)).toString ()
|
||||
, data (index (row, 6)).toString ()
|
||||
, confidence_string (true) == data (index (row, 7)).toString ());
|
||||
}
|
||||
|
||||
#include "moc_DecodesModel.cpp"
|
||||
@@ -1,12 +0,0 @@
|
||||
rate 1/2 constraint len 13, bpsk, ngood, nbad 10^6 trials
|
||||
0.00 43968 30
|
||||
0.50 111824 33
|
||||
1.00 238157 21
|
||||
1.50 425263 20
|
||||
2.00 634824 14
|
||||
2.50 812206 2
|
||||
3.00 924507 2
|
||||
3.50 975836 0
|
||||
4.00 993832 0
|
||||
4.50 998695 0
|
||||
5.00 999771 0
|
||||
Reference in New Issue
Block a user