-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqgopdd.h
157 lines (122 loc) · 3.7 KB
/
qgopdd.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
145
146
147
148
149
150
151
152
153
154
155
156
157
#ifndef QGOPDD_H
#define QGOPDD_H
#include <QMainWindow>
#include <QtWebEngineWidgets>
#include <QtCore>
#include <QStringConverter>
#include <QVector>
#include <QMap>
#include <QNetworkAccessManager>
#include <QWebChannel>
#include <tuple>
#include <QDate>
#include "calendarwidget.h"
#include "progresscaller.h"
#include "ftpdownloader.h"
#include "batchdownload.h"
#include "textviewer.h"
#include "downloadfinished.h"
// #include "fineftp/server.h"
class Stations {
public:
Stations(QString name, qreal lat, qreal lon, qreal height)
: name_(name), lat_(lat), lon_(lon), height_(height) { }
Stations() {}
auto GetInfo() -> std::tuple<QString, qreal, qreal, qreal> {return {name_, lat_, lon_, height_};}
void SetInfo(QString name, qreal lat, qreal lon) {
name_ = name;
lat_ = lat;
lon_ = lon;
}
private:
QString name_ = "";
qreal lat_ = 0.0, lon_ = 0.0, height_ = -1e5;
};
class DataDate { // Storing the begin and end of data waiting for downloading
public:
DataDate(QDate date) : date_(date) {this->doy_ = date.dayOfYear(), this->year_ = date.year();}
DataDate(int year, int doy) : doy_(doy), year_(year){}
DataDate() {}
int GetYear() {return year_;}
int GetDayOfYear() {return doy_;}
void SetYear(int yy) {this->year_ = yy;}
void SetDayOfYear(int doy) {this->doy_ = doy;}
QDate GetDate() {return date_;}
void SetDate(QDate d) {this->date_ = d;}
private:
int doy_ = 0, year_ = 0;
QDate date_;
int gps_week = 0;
};
QT_BEGIN_NAMESPACE
namespace Ui {
class QGOPDD;
class IgsNetwork;
}
QT_END_NAMESPACE
class QGOPDD : public QMainWindow {
Q_OBJECT
public:
friend class BatchDownload;
QGOPDD(QWidget *parent = nullptr);
~QGOPDD();
// std::tuple<QString, qreal, qreal>
BatchDownload* ToBatchDownload();
void AddStationsComboBox(QJsonDocument igs_file);
QMap<QString, Stations> igs_stations;
DataDate begin, end;
QWebEnginePage* igs_page;
QStringList waiting_list;
QStringList GetWaitingDownloadList();
void SetDownloadType(QString type) {
this->download_type_[type] = true;
}
QVector<bool> CheckDownloadType(QStringList products) {
QVector<bool> ret;
for (auto product_type : products) {
if (this->download_type_[product_type]) {
ret.append(this->download_type_[product_type]);
}
}
return ret;
}
void StartDownloading(QDate &curr_date, QDate &end_date,
int &daydiff);
public slots:
void GetEndDateSelected(QDate date);
void GetBeginDateSelected(QDate date);
private slots:
void on_BtnAddSta_clicked();
void on_BtnEndCalender_clicked(bool checked);
void on_BtnBeginCalendar_clicked(bool checked);
void on_BtnGotoStation_clicked(bool check);
void on_BtnStartDownload_clicked();
void on_BtnDownloadDir_clicked();
void on_CheckBoxBrdm_stateChanged(int arg1);
void on_CheckBoxBrd4_stateChanged(int arg1);
void on_CheckBoxSp3_stateChanged(int arg1);
void on_BtnOpenDownloadDir_clicked();
private:
Ui::QGOPDD *ui;
QString working_directory_ = "";
CalendarWidget* begincalender = new CalendarWidget(),* endcalendar = new CalendarWidget();
ProgressCaller* progress_caller = new ProgressCaller();
FtpDownloader* ftp_downloader = new FtpDownloader();
QString GetWd() {return working_directory_;}
void SetWd(QString wd) {working_directory_ = wd;}
QMap<QString, bool> download_type_{
{"BRDM", false},
{"BRD4", false},
{"CLK", false},
{"EPH", false},
{"SP3", false},
{"ION", false},
{"DCB", false}
};
TextViewer* text_viewer_ = new TextViewer();
DownloadFinished* finished_widget_ = new DownloadFinished();
};
class IgsNetwork : public QWidget {
};
QJsonDocument LoadIgsStationsFromJson(QString path);
#endif // QGOPDD_H