2015-01-14 18:51:30 +00:00
|
|
|
#ifndef DATAPROXY_SQLITE_H
|
|
|
|
#define DATAPROXY_SQLITE_H
|
|
|
|
|
|
|
|
#include <QString>
|
|
|
|
#include <QStringList>
|
|
|
|
|
|
|
|
#include "dataproxy.h"
|
|
|
|
#include "database.h"
|
|
|
|
|
|
|
|
class DataProxy_SQLite : public DataProxy {
|
|
|
|
|
|
|
|
public:
|
|
|
|
DataProxy_SQLite();
|
|
|
|
~DataProxy_SQLite();
|
|
|
|
|
|
|
|
void createLogModel();
|
|
|
|
void createLogPanel();
|
2015-03-01 11:17:47 +00:00
|
|
|
bool haveAtLeastOneLog();
|
|
|
|
|
2015-01-14 18:51:30 +00:00
|
|
|
int getIdFromModeName(const QString& _modeName);
|
|
|
|
int getIdFromBandName(const QString& _bandName);
|
2015-07-11 10:41:41 +00:00
|
|
|
int getSubModeIdFromSubMode(const QString _subModeName);
|
|
|
|
int getModeIdFromSubModeId(const int _sm);
|
|
|
|
QStringList getBands();
|
|
|
|
QStringList getModes();
|
2016-08-06 09:18:00 +00:00
|
|
|
QStringList sortBandNamesBottonUp(const QStringList _qs);
|
2016-08-04 13:49:51 +00:00
|
|
|
QStringList getBandIDs();
|
|
|
|
QStringList getModesIDs();
|
2015-07-11 10:41:41 +00:00
|
|
|
QStringList getBandsInLog(const int _log);
|
|
|
|
QStringList getModesInLog(const int _log);
|
2015-01-14 18:51:30 +00:00
|
|
|
|
|
|
|
QString getNameFromBandId (const int _id);
|
|
|
|
QString getNameFromModeId (const int _id);
|
2015-07-11 10:41:41 +00:00
|
|
|
QString getNameFromSubModeId (const int _id);
|
|
|
|
QString getSubModeFromId (const int _id);
|
|
|
|
QString getNameFromSubMode (const QString _sm); // Checks if a submode is deprecated TODO: CHeck if really needed
|
|
|
|
QString getModeFromSubMode (const QString _sm);
|
|
|
|
bool isModeDeprecated (const QString _sm);
|
2015-01-14 18:51:30 +00:00
|
|
|
|
2015-11-23 17:36:29 +00:00
|
|
|
QString getFreqFromBandId(const int _id);
|
2015-04-29 19:01:51 +00:00
|
|
|
int getBandIdFromFreq(const double _n);
|
2016-08-04 13:49:51 +00:00
|
|
|
double getLowLimitBandFromBandName(const QString _sm);
|
2016-08-16 15:21:15 +00:00
|
|
|
double getLowLimitBandFromBandId(const QString _sm);
|
2015-01-18 20:04:46 +00:00
|
|
|
|
2015-01-14 18:51:30 +00:00
|
|
|
int getLastQSOid();
|
|
|
|
|
|
|
|
bool deleteQSO(const int _qsoId);
|
|
|
|
int isWorkedB4(const QString _qrz, const int _currentLog);
|
2015-08-17 15:54:45 +00:00
|
|
|
bool isThisQSODuplicated(const QString _qrz, const QString _date, const QString _time, const int _band, const int _mode);
|
2015-01-14 18:51:30 +00:00
|
|
|
bool isDXCCConfirmed(const int _dxcc, const int _currentLog);
|
|
|
|
bool isQSLReceived(const int _qsoId);
|
|
|
|
bool isQSLSent(const int _qsoId);
|
|
|
|
|
|
|
|
bool qslSentViaDirect(const int _qsoId, const QString _updateDate);
|
|
|
|
bool qslSentViaBureau(const int _qsoId, const QString _updateDate);
|
|
|
|
bool qslRecViaBureau(const int _qsoId, const QString _updateDate);
|
|
|
|
bool qslRecViaBureau(const int _qsoId, const QString _updateDate, const bool _queueSentQSL);
|
|
|
|
bool qslRecViaDirect(const int _qsoId, const QString _updateDate);
|
|
|
|
bool qslRecViaDirect(const int _qsoId, const QString _updateDate, const bool _queueSentQSL);
|
|
|
|
bool qslSentAsRequested(const int _qsoId, const QString _updateDate);
|
|
|
|
bool qslRecAsRequested(const int _qsoId, const QString _updateDate);
|
2015-05-23 18:34:30 +00:00
|
|
|
bool setClubLogSent(const int _qsoId, const QString _st, const QString _updateDate);
|
2015-01-14 18:51:30 +00:00
|
|
|
|
|
|
|
bool isHF(const int _band);
|
|
|
|
bool isWARC(const int _band);
|
|
|
|
bool isVHF(const int _band);
|
|
|
|
|
2016-08-04 13:49:51 +00:00
|
|
|
|
2015-01-14 18:51:30 +00:00
|
|
|
QString getCallFromId(const int _qsoId);
|
2015-05-02 19:00:48 +00:00
|
|
|
QStringList getClubLogRealTimeFromId(const int _qsoId);
|
2015-08-02 10:36:48 +00:00
|
|
|
// Complete with previous
|
|
|
|
QString getNameFromQRZ(const QString _call);
|
|
|
|
QString getQTHFromQRZ(const QString _call);
|
|
|
|
QString getLocatorFromQRZ(const QString _call);
|
|
|
|
QString getIOTAFromQRZ(const QString _call);
|
|
|
|
QString getQSLViaFromQRZ(const QString _call);
|
|
|
|
// /Complete with previous
|
|
|
|
|
2015-08-17 15:54:45 +00:00
|
|
|
int getContinentIdFromContinentShortName(const QString _n);
|
|
|
|
QString getContinentShortNameFromEntity(const int _n);
|
|
|
|
int getContinentIdFromEntity(const int _n);
|
2016-08-07 17:04:38 +00:00
|
|
|
QStringList getContinentShortNames();
|
|
|
|
bool isValidContinentShortName(const QString _n);
|
|
|
|
|
2015-08-17 15:54:45 +00:00
|
|
|
int getCQzFromPrefix(const QString _p);
|
|
|
|
int getCQzFromEntity(const int _n);
|
|
|
|
int getITUzFromEntity(const int _n);
|
|
|
|
int getITUzFromPrefix(const QString _p);
|
|
|
|
QString getEntityNameFromId(const int _n);
|
|
|
|
QString getEntityMainPrefix(const int _entityN);
|
|
|
|
bool isNewCQz(int _c);
|
|
|
|
bool isNewEntity(int _e);
|
|
|
|
double getLongitudeFromEntity(const int _e);
|
|
|
|
double getLatitudeFromEntity(const int _e);
|
|
|
|
int getDXCCFromPrefix(const QString _p);
|
|
|
|
QString getEntityPrefixes(const int _enti);
|
|
|
|
QStringList getEntitiesNames();
|
2016-08-04 13:49:51 +00:00
|
|
|
int getHowManyEntities();
|
2015-05-02 19:00:48 +00:00
|
|
|
|
2015-01-14 18:51:30 +00:00
|
|
|
QStringList getOperatingYears(const int _currentLog);
|
|
|
|
void compressDB();
|
|
|
|
|
|
|
|
bool clearLog();
|
|
|
|
|
2015-02-14 19:51:20 +00:00
|
|
|
int getDXCConYear(const int _year, const int _logNumber);
|
|
|
|
int getCQzonYear(const int _year, const int _logNumber);
|
2015-07-30 18:33:44 +00:00
|
|
|
bool newDXMarathon(const int _dxcc, const int _cq, const int _year, const int _logNumber);
|
2015-02-14 19:51:20 +00:00
|
|
|
|
2015-02-17 19:44:44 +00:00
|
|
|
QStringList getContestNames();
|
2015-02-28 20:50:49 +00:00
|
|
|
QStringList getContestCat(const int _catn);
|
2015-04-03 14:44:39 +00:00
|
|
|
QStringList getContestOverlays();
|
|
|
|
int getContestTypeN(const int _co, const int _catop, const int _catas, const int _catpo, const int _catba, const int _catov, const int _catmo);
|
|
|
|
QStringList getDataFromContestType(const int _n);
|
2015-02-28 20:50:49 +00:00
|
|
|
|
|
|
|
QStringList getBandNames();
|
2015-05-28 09:21:45 +00:00
|
|
|
QStringList getPropModeList();
|
2016-07-31 12:41:34 +00:00
|
|
|
QStringList getSatellitesList();
|
2015-05-28 09:21:45 +00:00
|
|
|
|
2015-02-28 20:50:49 +00:00
|
|
|
QStringList getValidCatOptions(const int _currentCat, const int _lowerCa);
|
2015-02-14 19:51:20 +00:00
|
|
|
|
2015-07-30 18:33:44 +00:00
|
|
|
int getHowManyQSOInLog(const int _log);
|
2015-03-01 19:32:29 +00:00
|
|
|
int getNumberOfManagedLogs();
|
2015-08-17 15:54:45 +00:00
|
|
|
QStringList getListOfManagedLogs();
|
|
|
|
int getMaxLogNumber();
|
2015-04-03 14:44:39 +00:00
|
|
|
QString getStationCallSignFromLog(const int _log);
|
2015-08-17 15:54:45 +00:00
|
|
|
bool addNewLog (const QStringList _qs);
|
|
|
|
bool doesThisLogExist(const int _log);
|
2015-03-01 19:32:29 +00:00
|
|
|
|
2016-08-08 15:39:17 +00:00
|
|
|
bool updateISONames(); // Update the entities ISO names for the flags
|
|
|
|
QString getISOName(const int _n);
|
|
|
|
|
2015-01-14 18:51:30 +00:00
|
|
|
private:
|
2016-08-16 15:21:15 +00:00
|
|
|
bool dbCreated;
|
2015-01-14 18:51:30 +00:00
|
|
|
DataBase *db;
|
2016-08-06 09:18:00 +00:00
|
|
|
QStringList sortBandIdBottonUp(const QStringList _qs);
|
2015-01-14 18:51:30 +00:00
|
|
|
//QSqlRelationalTableModel *logModel;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // DATAPROXY_SQLITE_H
|