• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Stellarium / stellarium / 6685397774

29 Oct 2023 07:37PM UTC coverage: 11.735% (-0.002%) from 11.737%
6685397774

push

github

10110111
Deduplicate title bar implementation

131 of 131 new or added lines in 56 files covered. (100.0%)

14842 of 126472 relevant lines covered (11.74%)

21617.74 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/gui/SkylightDialog.cpp
1
/*
2
 * Stellarium
3
 * Copyright (C) 2022 Georg Zotti
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 * You should have received a copy of the GNU General Public License
15
 * along with this program; if not, write to the Free Software
16
 * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA  02110-1335, USA.
17
*/
18

19
#include "SkylightDialog.hpp"
20
#include "ui_skylightDialog.h"
21

22
SkylightDialog::SkylightDialog()
×
23
        : StelDialog("Skylight")
×
24
{
25
        ui = new Ui_skylightDialogForm;
×
26
}
×
27

28
SkylightDialog::~SkylightDialog()
×
29
{
30
        delete ui;
×
31
}
×
32

33
void SkylightDialog::retranslate()
×
34
{
35
        if (dialog)
×
36
                ui->retranslateUi(dialog);
×
37
}
×
38

39
void SkylightDialog::createDialogContent()
×
40
{
41
        ui->setupUi(dialog);
×
42
        
43
        //Signals and slots
44
        connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate()));
×
45
        connect(ui->titleBar, &TitleBar::closeClicked, this, &StelDialog::close);
×
46
        connect(ui->titleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMovedTo(QPoint)));
×
47

48
        connectBoolProperty(ui->checkBox_Schaefer, "Skylight.flagSchaefer");
×
49

50
        ui->comboBox_skylightDecimals->addItem("1", 1);
×
51
        ui->comboBox_skylightDecimals->addItem("0.1", .1);
×
52
        ui->comboBox_skylightDecimals->addItem("0.01", .01);
×
53
        ui->comboBox_skylightDecimals->addItem("0.001", .001);
×
54
        ui->comboBox_skylightDecimals->addItem("0.0001", .0001);
×
55
        ui->comboBox_skylightDecimals->addItem("0.00001", .00001);
×
56
        connect(ui->comboBox_skylightDecimals, SIGNAL(currentIndexChanged(int)), this, SLOT(setIncrements(int)));
×
57
        ui->comboBox_skylightDecimals->setCurrentIndex(2); // start with 0.01 increment
×
58

59
        connectBoolProperty(ui->checkBox_earlySunHalo, "StelSkyDrawer.flagEarlySunHalo");
×
60
        connectBoolProperty(ui->checkBox_drawSunAfterAtmosphere, "StelSkyDrawer.flagDrawSunAfterAtmosphere");
×
61

62
        connectDoubleProperty(ui->doubleSpinBox_zX11, "Skylight.zX11");
×
63
        connectDoubleProperty(ui->doubleSpinBox_zX12, "Skylight.zX12");
×
64
        connectDoubleProperty(ui->doubleSpinBox_zX13, "Skylight.zX13");
×
65
        connectDoubleProperty(ui->doubleSpinBox_zX21, "Skylight.zX21");
×
66
        connectDoubleProperty(ui->doubleSpinBox_zX22, "Skylight.zX22");
×
67
        connectDoubleProperty(ui->doubleSpinBox_zX23, "Skylight.zX23");
×
68
        connectDoubleProperty(ui->doubleSpinBox_zX24, "Skylight.zX24");
×
69
        connectDoubleProperty(ui->doubleSpinBox_zX31, "Skylight.zX31");
×
70
        connectDoubleProperty(ui->doubleSpinBox_zX32, "Skylight.zX32");
×
71
        connectDoubleProperty(ui->doubleSpinBox_zX33, "Skylight.zX33");
×
72
        connectDoubleProperty(ui->doubleSpinBox_zX34, "Skylight.zX34");
×
73
        connectDoubleProperty(ui->doubleSpinBox_zY11, "Skylight.zY11");
×
74
        connectDoubleProperty(ui->doubleSpinBox_zY12, "Skylight.zY12");
×
75
        connectDoubleProperty(ui->doubleSpinBox_zY13, "Skylight.zY13");
×
76
        connectDoubleProperty(ui->doubleSpinBox_zY21, "Skylight.zY21");
×
77
        connectDoubleProperty(ui->doubleSpinBox_zY22, "Skylight.zY22");
×
78
        connectDoubleProperty(ui->doubleSpinBox_zY23, "Skylight.zY23");
×
79
        connectDoubleProperty(ui->doubleSpinBox_zY24, "Skylight.zY24");
×
80
        connectDoubleProperty(ui->doubleSpinBox_zY31, "Skylight.zY31");
×
81
        connectDoubleProperty(ui->doubleSpinBox_zY32, "Skylight.zY32");
×
82
        connectDoubleProperty(ui->doubleSpinBox_zY33, "Skylight.zY33");
×
83
        connectDoubleProperty(ui->doubleSpinBox_zY34, "Skylight.zY34");
×
84

85
        connectDoubleProperty(ui->doubleSpinBox_AYT, "Skylight.AYt");
×
86
        connectDoubleProperty(ui->doubleSpinBox_BYT, "Skylight.BYt");
×
87
        connectDoubleProperty(ui->doubleSpinBox_CYT, "Skylight.CYt");
×
88
        connectDoubleProperty(ui->doubleSpinBox_DYT, "Skylight.DYt");
×
89
        connectDoubleProperty(ui->doubleSpinBox_EYT, "Skylight.EYt");
×
90
        connectDoubleProperty(ui->doubleSpinBox_AY , "Skylight.AYc");
×
91
        connectDoubleProperty(ui->doubleSpinBox_BY , "Skylight.BYc");
×
92
        connectDoubleProperty(ui->doubleSpinBox_CY , "Skylight.CYc");
×
93
        connectDoubleProperty(ui->doubleSpinBox_DY , "Skylight.DYc");
×
94
        connectDoubleProperty(ui->doubleSpinBox_EY , "Skylight.EYc");
×
95

96
        connectDoubleProperty(ui->doubleSpinBox_AxT, "Skylight.Axt");
×
97
        connectDoubleProperty(ui->doubleSpinBox_BxT, "Skylight.Bxt");
×
98
        connectDoubleProperty(ui->doubleSpinBox_CxT, "Skylight.Cxt");
×
99
        connectDoubleProperty(ui->doubleSpinBox_DxT, "Skylight.Dxt");
×
100
        connectDoubleProperty(ui->doubleSpinBox_ExT, "Skylight.Ext");
×
101
        connectDoubleProperty(ui->doubleSpinBox_Ax , "Skylight.Axc");
×
102
        connectDoubleProperty(ui->doubleSpinBox_Bx , "Skylight.Bxc");
×
103
        connectDoubleProperty(ui->doubleSpinBox_Cx , "Skylight.Cxc");
×
104
        connectDoubleProperty(ui->doubleSpinBox_Dx , "Skylight.Dxc");
×
105
        connectDoubleProperty(ui->doubleSpinBox_Ex , "Skylight.Exc");
×
106

107
        connectDoubleProperty(ui->doubleSpinBox_AyT, "Skylight.Ayt");
×
108
        connectDoubleProperty(ui->doubleSpinBox_ByT, "Skylight.Byt");
×
109
        connectDoubleProperty(ui->doubleSpinBox_CyT, "Skylight.Cyt");
×
110
        connectDoubleProperty(ui->doubleSpinBox_DyT, "Skylight.Dyt");
×
111
        connectDoubleProperty(ui->doubleSpinBox_EyT, "Skylight.Eyt");
×
112
        connectDoubleProperty(ui->doubleSpinBox_Ay , "Skylight.Ayc");
×
113
        connectDoubleProperty(ui->doubleSpinBox_By , "Skylight.Byc");
×
114
        connectDoubleProperty(ui->doubleSpinBox_Cy , "Skylight.Cyc");
×
115
        connectDoubleProperty(ui->doubleSpinBox_Dy , "Skylight.Dyc");
×
116
        connectDoubleProperty(ui->doubleSpinBox_Ey , "Skylight.Eyc");
×
117

118
        connect(ui->pushButton_ResetDistYPreetham, SIGNAL(released()), this, SLOT(resetYPreet()));
×
119
        connect(ui->pushButton_ResetDistxPreetham, SIGNAL(released()), this, SLOT(resetxPreet()));
×
120
        connect(ui->pushButton_ResetDistyPreetham, SIGNAL(released()), this, SLOT(resetyPreet()));
×
121
        connect(ui->pushButton_ResetDistYStel    , SIGNAL(released()), this, SLOT(resetYStel()));
×
122
        connect(ui->pushButton_ResetDistxStel    , SIGNAL(released()), this, SLOT(resetxStel()));
×
123
        connect(ui->pushButton_ResetDistyStel    , SIGNAL(released()), this, SLOT(resetyStel()));
×
124
        connect(ui->pushButton_ResetZXpreetham, SIGNAL(released()), this, SLOT(resetZxPreet()));
×
125
        connect(ui->pushButton_ResetZYpreetham, SIGNAL(released()), this, SLOT(resetZyPreet()));
×
126
        connect(ui->pushButton_ResetZXstel,     SIGNAL(released()), this, SLOT(resetZxStel()));
×
127
        connect(ui->pushButton_ResetZYstel,     SIGNAL(released()), this, SLOT(resetZyStel()));
×
128
        connect(ui->resetPreetPushButton,     SIGNAL(released()), this, SLOT(resetPreet()));
×
129
        connect(ui->resetStellPushButton,     SIGNAL(released()), this, SLOT(resetStel()));
×
130
}
×
131

132
void SkylightDialog::setIncrements(int idx)
×
133
{
134
        Q_UNUSED(idx)
135
        const double val=ui->comboBox_skylightDecimals->currentData().toDouble();
×
136
        ui->doubleSpinBox_zX11->setSingleStep(val);
×
137
        ui->doubleSpinBox_zX12->setSingleStep(val);
×
138
        ui->doubleSpinBox_zX13->setSingleStep(val);
×
139
        ui->doubleSpinBox_zX21->setSingleStep(val);
×
140
        ui->doubleSpinBox_zX22->setSingleStep(val);
×
141
        ui->doubleSpinBox_zX23->setSingleStep(val);
×
142
        ui->doubleSpinBox_zX24->setSingleStep(val);
×
143
        ui->doubleSpinBox_zX31->setSingleStep(val);
×
144
        ui->doubleSpinBox_zX32->setSingleStep(val);
×
145
        ui->doubleSpinBox_zX33->setSingleStep(val);
×
146
        ui->doubleSpinBox_zX34->setSingleStep(val);
×
147
        ui->doubleSpinBox_zY11->setSingleStep(val);
×
148
        ui->doubleSpinBox_zY12->setSingleStep(val);
×
149
        ui->doubleSpinBox_zY13->setSingleStep(val);
×
150
        ui->doubleSpinBox_zY21->setSingleStep(val);
×
151
        ui->doubleSpinBox_zY22->setSingleStep(val);
×
152
        ui->doubleSpinBox_zY23->setSingleStep(val);
×
153
        ui->doubleSpinBox_zY24->setSingleStep(val);
×
154
        ui->doubleSpinBox_zY31->setSingleStep(val);
×
155
        ui->doubleSpinBox_zY32->setSingleStep(val);
×
156
        ui->doubleSpinBox_zY33->setSingleStep(val);
×
157
        ui->doubleSpinBox_zY34->setSingleStep(val);
×
158

159
        ui->doubleSpinBox_AYT->setSingleStep(val);
×
160
        ui->doubleSpinBox_BYT->setSingleStep(val);
×
161
        ui->doubleSpinBox_CYT->setSingleStep(val);
×
162
        ui->doubleSpinBox_DYT->setSingleStep(val);
×
163
        ui->doubleSpinBox_EYT->setSingleStep(val);
×
164
        ui->doubleSpinBox_AY ->setSingleStep(val);
×
165
        ui->doubleSpinBox_BY ->setSingleStep(val);
×
166
        ui->doubleSpinBox_CY ->setSingleStep(val);
×
167
        ui->doubleSpinBox_DY ->setSingleStep(val);
×
168
        ui->doubleSpinBox_EY ->setSingleStep(val);
×
169

170
        ui->doubleSpinBox_AxT->setSingleStep(val);
×
171
        ui->doubleSpinBox_BxT->setSingleStep(val);
×
172
        ui->doubleSpinBox_CxT->setSingleStep(val);
×
173
        ui->doubleSpinBox_DxT->setSingleStep(val);
×
174
        ui->doubleSpinBox_ExT->setSingleStep(val);
×
175
        ui->doubleSpinBox_Ax ->setSingleStep(val);
×
176
        ui->doubleSpinBox_Bx ->setSingleStep(val);
×
177
        ui->doubleSpinBox_Cx ->setSingleStep(val);
×
178
        ui->doubleSpinBox_Dx ->setSingleStep(val);
×
179
        ui->doubleSpinBox_Ex ->setSingleStep(val);
×
180

181
        ui->doubleSpinBox_AyT->setSingleStep(val);
×
182
        ui->doubleSpinBox_ByT->setSingleStep(val);
×
183
        ui->doubleSpinBox_CyT->setSingleStep(val);
×
184
        ui->doubleSpinBox_DyT->setSingleStep(val);
×
185
        ui->doubleSpinBox_EyT->setSingleStep(val);
×
186
        ui->doubleSpinBox_Ay ->setSingleStep(val);
×
187
        ui->doubleSpinBox_By ->setSingleStep(val);
×
188
        ui->doubleSpinBox_Cy ->setSingleStep(val);
×
189
        ui->doubleSpinBox_Dy ->setSingleStep(val);
×
190
        ui->doubleSpinBox_Ey ->setSingleStep(val);
×
191
}
×
192

193
void SkylightDialog::resetYPreet()
×
194
{
195
        ui->doubleSpinBox_AYT->setValue( 0.1787);
×
196
        ui->doubleSpinBox_AY ->setValue(-1.4630);
×
197
        ui->doubleSpinBox_BYT->setValue(-0.3554);
×
198
        ui->doubleSpinBox_BY ->setValue(+0.4275);
×
199
        ui->doubleSpinBox_CYT->setValue(-0.0227);
×
200
        ui->doubleSpinBox_CY ->setValue(+5.3251);
×
201
        ui->doubleSpinBox_DYT->setValue( 0.1206);
×
202
        ui->doubleSpinBox_DY ->setValue(-2.5771);
×
203
        ui->doubleSpinBox_EYT->setValue(-0.0670);
×
204
        ui->doubleSpinBox_EY ->setValue(+0.3703);
×
205
}
×
206

207
void SkylightDialog::resetxPreet()
×
208
{
209
        ui->doubleSpinBox_AxT->setValue(-0.0193);
×
210
        ui->doubleSpinBox_Ax ->setValue(-0.2592);
×
211
        ui->doubleSpinBox_BxT->setValue(-0.0665);
×
212
        ui->doubleSpinBox_Bx ->setValue(+0.0008);
×
213
        ui->doubleSpinBox_CxT->setValue(-0.0004);
×
214
        ui->doubleSpinBox_Cx ->setValue(+0.2125);
×
215
        ui->doubleSpinBox_DxT->setValue(-0.0641);
×
216
        ui->doubleSpinBox_Dx ->setValue(-0.8989);
×
217
        ui->doubleSpinBox_ExT->setValue(-0.0033);
×
218
        ui->doubleSpinBox_Ex ->setValue(+0.0452);
×
219
}
×
220

221
void SkylightDialog::resetyPreet()
×
222
{
223
        ui->doubleSpinBox_AyT->setValue(-0.0167);
×
224
        ui->doubleSpinBox_Ay ->setValue(-0.2608);
×
225
        ui->doubleSpinBox_ByT->setValue(-0.0950);
×
226
        ui->doubleSpinBox_By ->setValue(+0.0092);
×
227
        ui->doubleSpinBox_CyT->setValue(-0.0079);
×
228
        ui->doubleSpinBox_Cy ->setValue(+0.2102);
×
229
        ui->doubleSpinBox_DyT->setValue(-0.0441);
×
230
        ui->doubleSpinBox_Dy ->setValue(-1.6537);
×
231
        ui->doubleSpinBox_EyT->setValue(-0.0109);
×
232
        ui->doubleSpinBox_Ey ->setValue(+0.0529);
×
233
}
×
234

235
void SkylightDialog::resetYStel()
×
236
{
237
        resetYPreet();
×
238
        ui->doubleSpinBox_AYT->setValue( 0.2787);
×
239
        ui->doubleSpinBox_AY ->setValue(-1.0630);
×
240
        ui->doubleSpinBox_CY ->setValue(+6.3251);
×
241
}
×
242

243
void SkylightDialog::resetxStel()
×
244
{
245
        ui->doubleSpinBox_AxT->setValue(-0.0148);
×
246
        ui->doubleSpinBox_Ax ->setValue(-0.1703);
×
247
        ui->doubleSpinBox_BxT->setValue(-0.0664);
×
248
        ui->doubleSpinBox_Bx ->setValue(+0.0011);
×
249
        ui->doubleSpinBox_CxT->setValue(-0.0005);
×
250
        ui->doubleSpinBox_Cx ->setValue(+0.2127);
×
251
        ui->doubleSpinBox_DxT->setValue(-0.0641); // ident
×
252
        ui->doubleSpinBox_Dx ->setValue(-0.8992);
×
253
        ui->doubleSpinBox_ExT->setValue(-0.0035);
×
254
        ui->doubleSpinBox_Ex ->setValue(+0.0453);
×
255
}
×
256

257
void SkylightDialog::resetyStel()
×
258
{
259
        ui->doubleSpinBox_AyT->setValue(-0.0131);
×
260
        ui->doubleSpinBox_Ay ->setValue(-0.2498);
×
261
        ui->doubleSpinBox_ByT->setValue(-0.0951);
×
262
        ui->doubleSpinBox_By ->setValue(+0.0092); // ident
×
263
        ui->doubleSpinBox_CyT->setValue(-0.0082);
×
264
        ui->doubleSpinBox_Cy ->setValue(+0.2404);
×
265
        ui->doubleSpinBox_DyT->setValue(-0.0438);
×
266
        ui->doubleSpinBox_Dy ->setValue(-1.0539);
×
267
        ui->doubleSpinBox_EyT->setValue(-0.0109); // ident
×
268
        ui->doubleSpinBox_Ey ->setValue(+0.0531);
×
269
}
×
270

271
//void resetZYPreet();
272
void SkylightDialog::resetZxPreet()
×
273
{
274
        // Note: values from the preprint document have one decimal digit more than the final paper.
275
        ui->doubleSpinBox_zX11->setValue( 0.00166);
×
276
        ui->doubleSpinBox_zX12->setValue(-0.00375);
×
277
        ui->doubleSpinBox_zX13->setValue(+0.00209);
×
278
        ui->doubleSpinBox_zX21->setValue(-0.02903);
×
279
        ui->doubleSpinBox_zX22->setValue(+0.06377);
×
280
        ui->doubleSpinBox_zX23->setValue(-0.03202);
×
281
        ui->doubleSpinBox_zX24->setValue(+0.00394);
×
282
        ui->doubleSpinBox_zX31->setValue( 0.11693);
×
283
        ui->doubleSpinBox_zX32->setValue(-0.21196);
×
284
        ui->doubleSpinBox_zX33->setValue(+0.06052);
×
285
        ui->doubleSpinBox_zX34->setValue(+0.25886);
×
286
}
×
287

288
void SkylightDialog::resetZyPreet()
×
289
{
290
    // Note: values from the preprint document have one decimal digit more than the final paper.
291
        ui->doubleSpinBox_zY11->setValue(  0.00275);
×
292
        ui->doubleSpinBox_zY12->setValue( -0.00610);
×
293
        ui->doubleSpinBox_zY13->setValue( +0.00317);
×
294
        ui->doubleSpinBox_zY21->setValue( -0.04214);
×
295
        ui->doubleSpinBox_zY22->setValue( +0.08970);
×
296
        ui->doubleSpinBox_zY23->setValue( -0.04153);
×
297
        ui->doubleSpinBox_zY24->setValue( +0.00516);
×
298
        ui->doubleSpinBox_zY31->setValue(  0.15346);
×
299
        ui->doubleSpinBox_zY32->setValue( -0.26756);
×
300
        ui->doubleSpinBox_zY33->setValue( +0.06670);
×
301
        ui->doubleSpinBox_zY34->setValue( +0.26688);
×
302
}
×
303
//void resetZYStel();
304
void SkylightDialog::resetZxStel()
×
305
{
306
        resetZxPreet();
×
307
        ui->doubleSpinBox_zX11->setValue( 0.00216); // FC
×
308
        ui->doubleSpinBox_zX31->setValue( 0.10169); // FC
×
309
}
×
310

311
void SkylightDialog::resetZyStel()
×
312
{
313
        resetZyPreet();
×
314
        ui->doubleSpinBox_zY31->setValue(  0.14535); // FC
×
315
}
×
316

317
void SkylightDialog::resetStel()
×
318
{
319
    resetYStel();
×
320
    resetxStel();
×
321
    resetyStel();
×
322
    resetZxStel();
×
323
    resetZyStel();
×
324
}
×
325

326
void SkylightDialog::resetPreet()
×
327
{
328
    resetYPreet();
×
329
    resetxPreet();
×
330
    resetyPreet();
×
331
    resetZxPreet();
×
332
    resetZyPreet();
×
333
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc