forked from Xastir/Xastir-Qt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstationsettings.h
183 lines (148 loc) · 3.41 KB
/
stationsettings.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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
#ifndef STATIONSETTINGS_H
#define STATIONSETTINGS_H
#include <QObject>
#include <QSettings>
class StationSettings : public QObject
{
Q_OBJECT
public:
explicit StationSettings(QObject *parent = 0);
enum PositionAmbiguity {
NONE,
point11,
onePoint15,
elevenPoint51,
sixtyNinePoint09
};
Q_PROPERTY(QString callsign READ callsign WRITE setCallsign NOTIFY callsignChanged)
Q_PROPERTY(bool sendCompressed READ sendCompressed WRITE setSendCompressed NOTIFY sendCompressedChanged)
Q_PROPERTY(float lat READ lat WRITE setLat NOTIFY latChanged)
Q_PROPERTY(float lon READ lon WRITE setLon NOTIFY lonChanged)
Q_PROPERTY(QString comment READ comment WRITE setComment NOTIFY commentChanged)
Q_PROPERTY(bool hasPHGD READ hasPHGD WRITE sethasPHGD NOTIFY hasPHGDChanged)
Q_PROPERTY(char group READ group WRITE setGroup NOTIFY groupChanged)
Q_PROPERTY(char symbol READ symbol WRITE setSymbol NOTIFY symbolChanged)
Q_PROPERTY(StationSettings::PositionAmbiguity positionAmbiguity READ positionAmbiguity WRITE setPositionAmbiguity NOTIFY positionAmbiguityChanged)
QString m_callsign;
QString m_comment;
float m_lat;
float m_lon;
bool m_hasPHGD;
bool m_sendCompressed;
char m_group;
char m_symbol;
StationSettings::PositionAmbiguity m_positionAmbiguity;
QString callsign() const
{
return m_callsign;
}
float lat() const
{
return m_lat;
}
float lon() const
{
return m_lon;
}
QString comment() const
{
return m_comment;
}
void saveSettings(QSettings &settings);
bool hasPHGD() const
{
return m_hasPHGD;
}
bool sendCompressed() const
{
return m_sendCompressed;
}
void restoreFromSettings(QSettings &settings);
char group() const
{
return m_group;
}
char symbol() const
{
return m_symbol;
}
StationSettings::PositionAmbiguity positionAmbiguity() const
{
return m_positionAmbiguity;
}
signals:
void callsignChanged(QString arg);
void latChanged(float arg);
void lonChanged(float arg);
void commentChanged(QString arg);
void hasPHGDChanged(bool arg);
void sendCompressedChanged(bool arg);
void groupChanged(char arg);
void symbolChanged(char arg);
void positionAmbiguityChanged( StationSettings::PositionAmbiguity arg);
public slots:
void setCallsign(QString arg)
{
if (m_callsign != arg) {
m_callsign = arg;
emit callsignChanged(arg);
}
}
void setLat(float arg)
{
if (m_lat != arg) {
m_lat = arg;
emit latChanged(arg);
}
}
void setLon(float arg)
{
if (m_lon != arg) {
m_lon = arg;
emit lonChanged(arg);
}
}
void setComment(QString arg)
{
if (m_comment != arg) {
m_comment = arg;
emit commentChanged(arg);
}
}
void sethasPHGD(bool arg)
{
if (m_hasPHGD != arg) {
m_hasPHGD = arg;
emit hasPHGDChanged(arg);
}
}
void setSendCompressed(bool arg)
{
if (m_sendCompressed != arg) {
m_sendCompressed = arg;
emit sendCompressedChanged(arg);
}
}
void setGroup(char arg)
{
if (m_group != arg) {
m_group = arg;
emit groupChanged(arg);
}
}
void setSymbol(char arg)
{
if (m_symbol != arg) {
m_symbol = arg;
emit symbolChanged(arg);
}
}
void setPositionAmbiguity(PositionAmbiguity arg)
{
if (m_positionAmbiguity != arg) {
m_positionAmbiguity = arg;
emit positionAmbiguityChanged(arg);
}
}
};
#endif // STATIONSETTINGS_H