Skip to content

Commit ef782af

Browse files
dd
d
authored and
d
committed
ADIF fields inclusion
1 parent 73e6b9b commit ef782af

16 files changed

+371
-155
lines changed

src/Changelog

+2-42
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,3 @@
1-
DONE: altitude
2-
DONE: my_altitude
3-
gridsquare_ext
4-
my_gridsquare_ext
5-
hamlogeu_qso_upload_date
6-
WIP: hamlogeu_qso_upload_status
7-
hamqth_qso_upload_date
8-
WIP: hamqth_qso_upload_status
9-
my_arrl_sect
10-
my_pota_ref
11-
my_wwff_ref
12-
pota_ref
13-
wwff_ref
14-
15-
16-
17-
ADDRESS_INTL
18-
COMMENT_INTL
19-
COUNTRY_INTL
20-
MY_ANTENNA_INTL
21-
MY_CITY_INTL
22-
MY_COUNTRY_INTL
23-
MY_NAME_INTL
24-
MY_POSTAL_CODE_INTL
25-
MY_RIG_INTL
26-
MY_SIG_INTL
27-
MY_SIG_INFO_INTL
28-
MY_STREET_INTL
29-
NAME_INTL
30-
NOTES_INTL
31-
QSLMSG_INTL
32-
QTH_INTL
33-
RIG_INTL
34-
SIG_INTL
35-
SIG_INFO_INTL
36-
37-
38-
BUG: Detect the need to update the DB https://github.com/ea4k/klog/issues/721
391
BUG: When entering/modifying a QSO thre is an error related to awarddxcc table not existing
402

413
TODO: Update the DB (modes table) updateToLatest() => updateTo026
@@ -59,10 +21,7 @@ TESTS to do during RC releases:
5921
- check if they are properly imported to the log.
6022
- Test a dupe QSO, a message should be shown
6123

62-
TEST
63-
WIP: #396, #507, #508 (User selectable fields: my_pota_ref, my_sig, my_sig_info, my_wwff_ref)
64-
WIP: #396, #507, #508 (User selectable fields: pota_ref, sig, sig_info, wwff_ref)
65-
24+
Close: #396, #507, #508
6625

6726

6827
TBD - 2.4
@@ -75,6 +34,7 @@ TBD - 2.4
7534
- Enhancement: Added all the modes/submodes of ADIF 3.1.4
7635
- Enhancement: Added many tests to test code before releasing.
7736
- Enhancement: ADIF Added SUBMM band.
37+
- Enhancement: Added several ADIF fields (Closes #396, #507, #508, #719)
7838
- BugFix: Fixed the ISO name for Togo.
7939
- BugFix: Country fix read failed with complex prefixes.
8040
- Bugfix: CQ & ITU zones may be wrong for callsigns from specific DXCC if coming from WSJTX.

src/adif.cpp

+28
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,32 @@ bool Adif::isValidQSO_COMPLETE(const QString &_s)
368368
return ((_s == "Y") || (_s == "N") || (_s == "NIL") || (_s == "?"));
369369
}
370370

371+
QString Adif::getQSO_COMPLETEFromDB(const QString &_s)
372+
{// Returns the ADIF QSO_COMPLETE
373+
//1=Y, 2=N, 3=NIL, 4=?
374+
//qDebug() << Q_FUNC_INFO << ": " << _s;
375+
int i = _s.toInt();
376+
switch (i)
377+
{
378+
case 2:
379+
{
380+
return "N";
381+
}
382+
case 3:
383+
{
384+
return "NIL";
385+
}
386+
case 4:
387+
{
388+
return "?";
389+
}
390+
default:
391+
{
392+
return "Y";
393+
}
394+
}
395+
}
396+
371397
bool Adif::isValidPOTA(const QString &_s)
372398
{
373399
if (_s.length()<1)
@@ -382,6 +408,8 @@ bool Adif::isValidWWFF_Ref(const QString &_s)
382408
return true;
383409
}
384410

411+
412+
385413
/*
386414
bool Utilities::isValidComment(const QString &_b)
387415
{

src/adif.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include <QString>
3838
#include <QtDebug>
3939
#include <QStringList>
40+
4041
//#include "locator.h"
4142
#include "klogdefinitions.h"
4243

@@ -71,7 +72,8 @@ class Adif : public QObject {
7172
bool isValidTenTen(const QString &_b); //>0
7273
bool isValidLogId(const QString &_b); //>0
7374
bool isValidAntPath(const QString &_s);
74-
bool isValidQSO_COMPLETE(const QString &_s); // "Y", "N", "NIL", "?"
75+
bool isValidQSO_COMPLETE(const QString &_s); // "Y", "N", "NIL", "?"
76+
QString getQSO_COMPLETEFromDB(const QString &_s); // Translates the DB value into an ADIF value
7577
bool isValidPOTA(const QString &_s); // TODO
7678
bool isValidWWFF_Ref(const QString &_s); // TODO
7779

src/charts/statsdxccsonsatswidget.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef CHARTS_KLOG_STATSDXCCSONSATSWIDGET_H
2-
#define CHARTS_KLOG_STATSDXCCSONSATSWIDGET_H
1+
#ifndef KLOG_CHARTS_STATSDXCCSONSATSWIDGET_H
2+
#define KLOG_CHARTS_STATSDXCCSONSATSWIDGET_H
33
/***************************************************************************
44
statsdxccsonsatswidget.h - description
55
-------------------

src/database.cpp

+6-23
Original file line numberDiff line numberDiff line change
@@ -456,11 +456,7 @@ bool DataBase::createTableLog(bool temp)
456456
"ituz INTEGER, "
457457
"dxcc INTEGER, "
458458
"address VARCHAR, "
459-
"address_intl VARCHAR, "
460459
"age INTEGER, "
461-
"cnty VARCHAR, "
462-
"comment VARCHAR, "
463-
"comment_intl VARCHAR, "
464460
"a_index INTEGER, "
465461
"altitude REAL, "
466462
"ant_az INTEGER, "
@@ -474,11 +470,12 @@ bool DataBase::createTableLog(bool temp)
474470
"class VARCHAR, "
475471
"clublog_qso_upload_date DATETIME, "
476472
"clublog_qso_upload_status VARCHAR(1), "
473+
"cnty VARCHAR, "
474+
"comment VARCHAR, "
477475
"cont VARCHAR(2), "
478476
"contacted_op VARCHAR(40), "
479477
"contest_id VARCHAR, "
480478
"country VARCHAR, "
481-
"country_intl VARCHAR, "
482479
"credit_submitted VARCHAR, "
483480
"credit_granted VARCHAR, "
484481
"darc_dok VARCHAR,"
@@ -501,7 +498,7 @@ bool DataBase::createTableLog(bool temp)
501498
"hamqth_qso_upload_date DATETIME, "
502499
"hamqth_qso_upload_status VARCHAR(1), "
503500
"hrdlog_qso_upload_date DATETIME, "
504-
"hrdlog_qso_upload_status VARCHAR(1), "
501+
"hrdlog_qso_upload_status VARCHAR(1), "
505502
"iota VARCHAR(6), "
506503
"iota_island_id VARCHAR, "
507504
"k_index INTEGER, "
@@ -515,13 +512,10 @@ bool DataBase::createTableLog(bool temp)
515512
"ms_shower VARCHAR, "
516513
"my_altitude REAL, "
517514
"my_antenna VARCHAR, "
518-
"my_antenna_intl VARCHAR, "
519515
"my_arrl_sect VARCHAR(3), "
520516
"my_city VARCHAR, "
521-
"my_city_intl VARCHAR, "
522517
"my_cnty VARCHAR, "
523518
"my_country INTEGER, "
524-
"my_country_intl INTEGER, "
525519
"my_cq_zone INTEGER, "
526520
"my_dxcc INTEGER, "
527521
"my_fists INTEGER, "
@@ -533,16 +527,11 @@ bool DataBase::createTableLog(bool temp)
533527
"my_lat VARCHAR(11), "
534528
"my_lon VARCHAR(11), "
535529
"my_name VARCHAR, "
536-
"my_name_intl VARCHAR, "
537530
"my_pota_ref VARCHAR, "
538531
"my_postal_code VARCHAR ,"
539-
"my_postal_code_intl VARCHAR ,"
540532
"my_rig VARCHAR, "
541-
"my_rig_intl VARCHAR, "
542533
"my_sig VARCHAR, "
543-
"my_sig_intl VARCHAR, "
544534
"my_sig_info VARCHAR, "
545-
"my_sig_info_intl VARCHAR, "
546535
"my_sota_ref VARCHAR, "
547536
"my_state VARCHAR, "
548537
"my_street VARCHAR, "
@@ -551,7 +540,6 @@ bool DataBase::createTableLog(bool temp)
551540
"my_wwff_ref VARCHAR(11), "
552541
"name VARCHAR, "
553542
"notes VARCHAR, "
554-
"notes_intl VARCHAR, "
555543
"nr_bursts INTEGER, "
556544
"nr_pings INTEGER, "
557545
"operator VARCHAR, "
@@ -564,7 +552,6 @@ bool DataBase::createTableLog(bool temp)
564552
"qrzcom_qso_upload_date DATETIME, "
565553
"qrzcom_qso_upload_status VARCHAR(1), "
566554
"qslmsg VARCHAR, "
567-
"qslmsg_intl VARCHAR, "
568555
"qslrdate DATETIME, "
569556
"qslsdate DATETIME, "
570557
"qsl_rcvd VARCHAR(1), "
@@ -575,18 +562,14 @@ bool DataBase::createTableLog(bool temp)
575562
"qso_complete VARCHAR(1), "
576563
"qso_random INTEGER, "
577564
"qth VARCHAR, "
578-
"qth_intl VARCHAR, "
579565
"region VARCHAR, "
580566
"rig VARCHAR, "
581-
"rig_intl VARCHAR, "
582567
"rx_pwr REAL, "
583568
"sat_mode VARCHAR, "
584569
"sat_name VARCHAR, "
585570
"sfi INTEGER, "
586571
"sig VARCHAR, "
587-
"sig_intl VARCHAR, "
588572
"sig_info VARCHAR, "
589-
"sig_info_intl VARCHAR, "
590573
"silent_key VARCHAR(1), "
591574
"skcc VARCHAR, "
592575
"sota_ref VARCHAR, "
@@ -596,14 +579,14 @@ bool DataBase::createTableLog(bool temp)
596579
"stx VARCHAR(10), "
597580
"state VARCHAR, "
598581
"station_callsign VARCHAR, "
599-
"submode VARCHAR,"
582+
"submode VARCHAR, "
600583
"swl INTEGER, "
584+
"ten_ten INTEGER, "
585+
"tx_pwr REAL, "
601586
"uksmg INTEGER, "
602587
"usaca_counties VARCHAR, "
603588
"ve_prov VARCHAR, "
604589
"vucc_grids VARCHAR, "
605-
"ten_ten INTEGER, "
606-
"tx_pwr REAL, "
607590
"web VARCHAR, "
608591
"wwff_ref VARCHAR(11), "
609592
"qso_date_off DATETIME, " //2020-01-01

src/database/db_adif_primary_subdvisions_data.h

+35-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,39 @@
1-
#ifndef DB_ADIF_PRIMARY_SUBDVISIONS_DATA_H
2-
#define DB_ADIF_PRIMARY_SUBDVISIONS_DATA_H
1+
#ifndef KLOG_DATABASE_DB_ADIF_PRIMARY_SUBDVISIONS_DATA_H
2+
#define KLOG_DATABASE_DB_ADIF_PRIMARY_SUBDVISIONS_DATA_H
3+
/***************************************************************************
4+
db_adif_primary_subdivisions_data.h - description
5+
-------------------
6+
begin : Apr 2024
7+
copyright : (C) 2024 by Jaime Robles
8+
9+
***************************************************************************/
310

11+
/*****************************************************************************
12+
* This file is part of KLog. *
13+
* *
14+
* KLog is free software: you can redistribute it and/or modify *
15+
* it under the terms of the GNU General Public License as published by *
16+
* the Free Software Foundation, either version 3 of the License, or *
17+
* (at your option) any later version. *
18+
* *
19+
* KLog is distributed in the hope that it will be useful, *
20+
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
21+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
22+
* GNU General Public License for more details. *
23+
* *
24+
* You should have received a copy of the GNU General Public License *
25+
* along with KLog. If not, see <https://www.gnu.org/licenses/>. *
26+
* *
27+
*****************************************************************************/
28+
/*
29+
This class contains the data of the Primary Subdivisions of ADIF as listed
30+
here:
31+
https://www.adif.org/314/ADIF_314.htm#Primary_Administrative_Subdivision
32+
33+
This class exists just to have one single place to maintain any ADIF
34+
modification in the future.
35+
36+
*/
437
#include <QObject>
538
#include "queryexecutor.h"
639

src/database/queryexecutor.h

+32-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,35 @@
1-
#ifndef QUERYEXECUTOR_H
2-
#define QUERYEXECUTOR_H
1+
#ifndef KLOG_DATABASE_QUERYEXECUTOR_H
2+
#define KLOG_DATABASE_QUERYEXECUTOR_H
3+
/***************************************************************************
4+
queryexecutor.h - description
5+
-------------------
6+
begin : Apr 2024
7+
copyright : (C) 2024 by Jaime Robles
8+
9+
***************************************************************************/
10+
11+
/*****************************************************************************
12+
* This file is part of KLog. *
13+
* *
14+
* KLog is free software: you can redistribute it and/or modify *
15+
* it under the terms of the GNU General Public License as published by *
16+
* the Free Software Foundation, either version 3 of the License, or *
17+
* (at your option) any later version. *
18+
* *
19+
* KLog is distributed in the hope that it will be useful, *
20+
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
21+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
22+
* GNU General Public License for more details. *
23+
* *
24+
* You should have received a copy of the GNU General Public License *
25+
* along with KLog. If not, see <https://www.gnu.org/licenses/>. *
26+
* *
27+
*****************************************************************************/
28+
/*
29+
This class defines a test to try to control DB executions from one
30+
single place.
31+
This class may be removed without any notice :)
32+
*/
333

434
#include <QObject>
535
#include <QSqlQuery>

src/dataproxy_sqlite.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ class DataProxy_SQLite : public QObject
310310
bool addDXCCEntitySubdivision(const QString &_name, const QString &_short, const QString &_pref, const QString &_group, const int _regId, const int _dxcc, const int _cq, const int _itu, const QDate &_startDate, const QDate &_endDate, const bool _deleted);
311311

312312
//void getFoundInLog(const QString &_txt, const int _log=-1);
313-
QString getADIFQSO(const int _qsoId, ExportMode _em = ModeADIF);
313+
KLOG_DEPRECATED QString getADIFQSO(const int _qsoId, ExportMode _em = ModeADIF);
314314
QString getADIFValueFromRec(QSqlRecord _rec, const QString &_fieldName); // To refactor the getADIFFromQSOQuery function
315315
QString getADIFFromQSOQuery(QSqlRecord _rec, ExportMode _em = ModeADIF, bool _justMarked = false, bool _onlyRequested = false, int _logN = -1);
316316
//QString getADIFFromQSOQuery2(QSqlRecord _rec, ExportMode _em = ModeADIF, bool _justMarked = false, bool _onlyRequested = false, int _logN = -1);

src/elogqrzlog.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,12 @@ int eLogQrzLog::sendQSO(const int _qsoID)
639639
// Received an ID, obtains the ADIF fo QRZ.com from dataProxy and sends it t QRZ.com
640640
//qDebug() << "eLogQrzLog::sendQSO: " << QString::number(_qsoID);
641641
showDebugLog (Q_FUNC_INFO, "Start: " + QString::number(_qsoID));
642-
QString adifQSO = dataProxy->getADIFQSO(_qsoID, ModeEQSL);
642+
QSO qso;
643+
qso.fromDB(_qsoID);
644+
if (!qso.isComplete())
645+
return -1;
646+
//QString adifQSO = dataProxy->getADIFQSO(_qsoID, ModeEQSL);
647+
QString adifQSO = qso.getADIF();
643648

644649
//qDebug()<< "eLogQrzLog::sendQSO: (ADIF) :" << adifQSO;
645650
//qDebug()<< "eLogQrzLog::sendQSO: (KEY) :" << logbookkey;

src/global.h

+27
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,33 @@
11
#ifndef KLOG_GLOBAL_H
22
#define KLOG_GLOBAL_H
3+
/***************************************************************************
4+
global.h - description
5+
-------------------
6+
begin : Apr 2023
7+
copyright : (C) 2023 by Jaime Robles
8+
9+
***************************************************************************/
310

11+
/*****************************************************************************
12+
* This file is part of KLog. *
13+
* *
14+
* KLog is free software: you can redistribute it and/or modify *
15+
* it under the terms of the GNU General Public License as published by *
16+
* the Free Software Foundation, either version 3 of the License, or *
17+
* (at your option) any later version. *
18+
* *
19+
* KLog is distributed in the hope that it will be useful, *
20+
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
21+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
22+
* GNU General Public License for more details. *
23+
* *
24+
* You should have received a copy of the GNU General Public License *
25+
* along with KLog. If not, see <https://www.gnu.org/licenses/>. *
26+
* *
27+
*****************************************************************************/
28+
/*
29+
This class defines global topics.
30+
*/
431
extern bool g_callsignCheck;
532
#if __cplusplus >= 201309L
633
// use modern deprecation feature

src/inputwidgets/mainwindowmydatatab.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ bool MainWindowMyDataTab::setMySig_info(const QString &_op)
704704
{
705705
if (_op.length()<=0)
706706
return false;
707-
my_sig = _op;
707+
my_sig_info = _op;
708708
slotMyUserADIFComboBoxChanged();
709709
return true;
710710
}

0 commit comments

Comments
 (0)