-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainwindow.h
153 lines (99 loc) · 4.48 KB
/
mainwindow.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
/**
** This file is part of the CatRotator project.
** Copyright 2022-2024 Gianfranco Sordetti IZ8EWD <[email protected]>.
**
** This program 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.
**
** This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
**/
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QTimer>
#include <QFileSystemWatcher>
#define RELEASE_DATE __DATE__
#define VERSION_MAJ 1
#define VERSION_MIN 5
#define VERSION_MIC 1
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
public slots:
void rotUpdate(); //Slot fot QTimer
void on_rotDaemonResultReady(int rotNumber); //Slot for rotDaemon resultReady
void on_lineEditEnterPressed(); //Slot for enter pressed in lineEdit
void on_lineEditEnterPressed2();
void on_lineEditEnterPressed3();
//void parseWSJTXStatus(QString *status); //Read WSJT-X wsjtx_status.txt locator or call
void parseWSJTXStatus();
private slots:
void on_actionRotator_triggered();
void on_actionAbout_CatRotator_triggered();
void on_actionAbout_Qt_triggered();
void on_actionAbout_Hamlib_triggered();
void on_pushButton_connect_toggled(bool checked);
void on_pushButton_go_clicked();
void on_pushButton_park_clicked();
void on_pushButton_stop_clicked();
void on_actionSetup_triggered();
void on_pushButton_go_2_clicked();
void on_pushButton_p0_clicked();
void on_pushButton_p1_clicked();
void on_pushButton_p2_clicked();
void on_pushButton_p3_clicked();
void on_pushButton_p4_clicked();
void on_pushButton_p5_clicked();
void on_pushButton_p6_clicked();
void on_pushButton_p7_clicked();
void on_pushButton_p8_clicked();
void on_actionCatRotator_homepage_triggered();
void on_actionPresets_triggered();
void on_toolButton_pathSL_toggled(bool checked);
void on_toolButton_pathSL_2_toggled(bool checked);
void on_pushButton_go_3_clicked();
void on_toolButton_pathSL_3_toggled(bool checked);
void on_toolButton_minus_clicked();
void on_toolButton_plus_clicked();
void on_toolButton_minus_2_clicked();
void on_toolButton_plus_2_clicked();
void on_toolButton_minus_3_clicked();
void on_toolButton_plus_3_clicked();
void on_toolButton_track_toggled(bool checked);
void on_toolButton_track_2_toggled(bool checked);
void on_toolButton_track_3_toggled(bool checked);
void on_actionAbout_cty_dat_triggered();
void on_actionAbout_DarkTheme_triggered();
private:
Ui::MainWindow *ui;
QTimer *timer;
QFileSystemWatcher statusWsjtxWatch;
QString statusWsjtx;
QString versionCTY(); //Extract CTY.DAT version
void guiInit();
void guiUpdate(int rotNumber);
void presetGo(int presetNumber);
void presetInit();
void setPosition(int rot, float azim, float elev);
void parseWSJTXMoon(double *azim, double *elev); //Read WSJT-X azel.dat tracking data
void parseAirScout(double *azim, double *elev); //Read AirScout azel.dat tracking data
bool azElInput(QString value, bool lPath, double *azim, double *elev); //Convert pointing value input, from format degree or QTH locator, into azimuth bearing angle and elevation
bool bearingAngle(const char *locator1, const char *locator2, double *azim, double *dist); //Calculate Short Path bearing angle and distance between two locators
bool bearingAngleLP(const char *locator1, const char *locator2, double *azim, double *dist); //Calculate Long Path bearing angle and distance between two locators
void parseCTY(QString callsign, QString *countryName, QString *country, double *lat, double *lon); //Find Country in CTY.DAT from callsign
};
#endif // MAINWINDOW_H