Skip to content

Commit cbb54c0

Browse files
committed
Database and other updates
1 parent db09c6b commit cbb54c0

20 files changed

+395
-272
lines changed

src/Changelog

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
WIP: LoTW confirmations are not correctly imported to logbook.dat #798
2-
TODO: Check DISTANCE on ADIF EXPORT
3-
CHECK TYPES: Distance should be a double but it is an int or String in some functions
4-
1+
TODO: KLog crashes on Database update:
2+
qt.sql.qsqlquery: QSqlQuery::prepare: empty query
3+
ASSERT: "!isEmpty()" in file /usr/include/x86_64-linux-gnu/qt6/QtCore/qlist.h, line 658
54

5+
WIP: LoTW confirmations are not correctly imported to logbook.dat #798
6+
TODO: CHECK: HOW QSO_COMPLETE is being read/managed
67
-TODO: When downloading from LoTW, if there is no QSOs in the log the message that is shown appears ()
8+
79
TBD 2025 - 2.4.2
810
- Enhancement: Updated some DataBase fields to match ADIF definition better.
911
- Enhancement: Sevral refactors & optimization: ADIF import/export

src/adif.cpp

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -296,29 +296,29 @@ bool Adif::isValidDXCC(const int _b)
296296
return ((_b>=0) && (_b<=522));
297297
}
298298

299-
bool Adif::isValidAge(const int _b)
299+
bool Adif::isValidAge(const double _b)
300300
{
301-
return ((_b>0) && (_b<=120));
301+
return ((_b>0.0) && (_b<=120.0));
302302
}
303303

304-
bool Adif::isValidAnt_EL(const int _b)
304+
bool Adif::isValidAnt_EL(const double _b)
305305
{
306-
return ((_b>=-90) && (_b<=900));
306+
return ((_b>=-90.0) && (_b<=900.0));
307307
}
308308

309-
bool Adif::isValidAnt_AZ(const int _b)
309+
bool Adif::isValidAnt_AZ(const double _b)
310310
{
311-
return ((_b>=0) && (_b<=360));
311+
return ((_b>=0.0) && (_b<=360.0));
312312
}
313313

314-
bool Adif::isValidA_Index(const int _b)
314+
bool Adif::isValidA_Index(const double _b)
315315
{
316-
return ((_b>=0) && (_b<=400));
316+
return ((_b>=0.0) && (_b<=400.0));
317317
}
318318

319319
bool Adif::isValidDistance(const double _b)
320320
{
321-
return (_b>0);
321+
return (_b>0.0);
322322
}
323323

324324
//bool Adif::isValidAltitude(const double _b)
@@ -386,29 +386,40 @@ bool Adif::isValidQSO_COMPLETE(const QString &_s)
386386
return ((_s == "Y") || (_s == "N") || (_s == "NIL") || (_s == "?"));
387387
}
388388

389+
int Adif::setQSO_COMPLETEToDB(const QString &_s)
390+
{
391+
if (_s == "Y")
392+
return 1;
393+
if (_s == "N")
394+
return 2;
395+
if (_s == "NIL")
396+
return 3;
397+
return 4;
398+
}
399+
389400
QString Adif::getQSO_COMPLETEFromDB(const QString &_s)
390401
{// Returns the ADIF QSO_COMPLETE
391402
//1=Y, 2=N, 3=NIL, 4=?
392403
//qDebug() << Q_FUNC_INFO << ": " << _s;
393404
int i = _s.toInt();
394405
switch (i)
395406
{
396-
case 2:
397-
{
398-
return "N";
399-
}
400-
case 3:
401-
{
402-
return "NIL";
403-
}
404-
case 4:
405-
{
406-
return "?";
407-
}
408-
default:
409-
{
410-
return "Y";
411-
}
407+
case 2:
408+
{
409+
return "N";
410+
}
411+
case 3:
412+
{
413+
return "NIL";
414+
}
415+
case 4:
416+
{
417+
return "?";
418+
}
419+
default:
420+
{
421+
return "Y";
422+
}
412423
}
413424
}
414425

src/adif.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ class Adif : public QObject {
5656
bool isValidCQz(const int _b); //1-40
5757
bool isValidITUz(const int _b); // 1-90
5858
bool isValidDXCC(const int _b); // 0-522
59-
bool isValidAge(const int _b); // 0-120
59+
bool isValidAge(const double _b); // 0-120
6060
bool isValidDistance(const double _b); //>0.0
61-
bool isValidAnt_EL(const int _b); //>=0-360
62-
bool isValidAnt_AZ(const int _b); //>=-90-90
63-
bool isValidA_Index(const int _b); //0-400
61+
bool isValidAnt_EL(const double _b); //>=0-360
62+
bool isValidAnt_AZ(const double _b); //>=-90-90
63+
bool isValidA_Index(const double _b); //0-400
6464
bool isValidIOTA_islandID(const int _b); //1-99999999
6565
bool isValidNRBursts(const int _b); //>0
6666
bool isValidPings(const int _b); //>0
@@ -75,7 +75,9 @@ class Adif : public QObject {
7575
bool isValidAntPath(const QString &_s);
7676
bool isValidMode (const QString &_s);
7777
bool isValidQSO_COMPLETE(const QString &_s); // "Y", "N", "NIL", "?"
78-
QString getQSO_COMPLETEFromDB(const QString &_s); // Translates the DB value into an ADIF value
78+
QString getQSO_COMPLETEFromDB(const QString &_s); // Translates the DB value into an ADIF value
79+
int setQSO_COMPLETEToDB(const QString &_s); // Translates the ADIF to a DB value
80+
7981
bool isValidPOTA(const QString &_s); // TODO
8082
bool isValidWWFF_Ref(const QString &_s); // TODO
8183
bool isValidQSLRCVD(const QString &_s, bool _importing=true); // Y, I, or V) (V on import only)

0 commit comments

Comments
 (0)