-
Notifications
You must be signed in to change notification settings - Fork 0
/
world.h
144 lines (110 loc) · 4.88 KB
/
world.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#ifndef WORLD_H
#define WORLD_H
/***************************************************************************
world.h - description
-------------------
begin : sept 2011
copyright : (C) 2011 by Jaime Robles
email : jaime@robles.es
***************************************************************************/
/*****************************************************************************
* This file is part of KLuster. *
* *
* KLuster is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* KLuster is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with KLuster. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
//#include <QtWidgets>
#include <QString>
#include <QFile>
#include <QStringList>
#include <QSqlRelationalTableModel>
#include <QSqlQuery>
#include <QSqlError>
#include <QProgressBar>
#include <QProgressDialog>
#include <QtGlobal>
#include <QtDebug>
#include "locator.h"
//#include "awards.h"
class QStringList;
enum
{
Entity_Name = 1,
Entity_Continent = 2
};
class World : public QWidget
{
//friend class Awards;
public:
World();
World(const QString _kontestDir);
~World();
bool create(const QString _kontestDir);
bool recreate(const QString _kontestDir);
QString getQRZEntityName(const QString _qrz);
QString getEntityName(const int _entityN);
QString getQRZEntityMainPrefix(const QString _qrz);
QString getEntityMainPrefix(const int _entityN);
QString getQRZContinentNumber(const QString _qrz); // Returns the continent id number
int getContinentNumber(const int _enti); // Returns the continent id number
QString getQRZContinentShortName(const QString _qrz); // Returns the continent shortName (EU, AF, ...)
QString getContinentShortName(const int _enti);
QString getQRZLocator(const QString _qrz); // Returns the entity locator
QString getLocator(const int _entityN); // Returns the entity locator
double getQRZLongitude(const QString _qrz); // Returns the longitude of the Entity
double getLongitude(const int _enti); // Returns the longitude of the Entity
double getQRZLatitude(const QString _qrz); // Returns the latitude of the Entity
double getLatitude(const int _enti); // Returns the latitude of the Entity
int getQRZCqz(const QString _qrz);
int getEntityCqz(const int _enti);
int getQRZItuz(const QString _qrz);
int getEntityItuz(const int _enti);
int getQRZARRLId(const QString _qrz); //Returns the ARRL id of the Entity from a QRZ & Returns -1 if not found.
bool isNewCQz(const int _cqz);
bool isNewEntity(const int _entityN);
int getBandIdFromFreq(const QString fr);
QString getQRZEntityPrefixes(const QString _qrz);
QString getEntityPrefixes(const int _enti);
bool checkQRZValidFormat(const QString _qrz);
QStringList getEntitiesNames();
private slots:
private:
int getPrefixId(const QString _qrz);
bool readCTYDAT();
bool readCTYCSV();
QStringList processLine(const QString _line);
QStringList processLineP(const QString _line, const int _processingEntity);
void createWorldModel();
QStringList readZones(const QString &pref, const int _cq, const int _itu);
QString changeSlashAndFindPrefix(const QString _qrz); // Changes the \ into / and find the country prefix
int progressBarPosition;
bool created;
QString kontestDir, kontestVersion;
int cqz, ituz, numberOfEntities;
QString entityName;
QString currentPrefix; // Used in the progressBar
bool ret;
QStringList list, prefixAndZones;
QString continentName, prefix;
int continentId;
double lat, lon, utc;
//QString line;
//bool readingDataOfAnEntity;
int nullValue;
QSqlRelationalTableModel *worldModel;
//QProgressBar *progressBar;
Locator *locator;
//Awards *awards;
};
#endif // WORLD_H