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

Stellarium / stellarium / 9545309360

16 Jun 2024 08:38PM UTC coverage: 12.262% (-0.01%) from 12.274%
9545309360

push

github

web-flow
Translate stellarium-remotecontrol.pot in gl

100% translated source file: 'stellarium-remotecontrol.pot'
on 'gl'.

14429 of 117670 relevant lines covered (12.26%)

18515.08 hits per line

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

0.0
/src/core/modules/SpecificTimeMgr.cpp
1
/*
2
 * Copyright (C) 2022 Alexander Wolf
3
 *
4
 * This program is free software; you can redistribute it and/or
5
 * modify it under the terms of the GNU General Public License
6
 * as published by the Free Software Foundation; either version 2
7
 * of the License, or (at your option) any later version.
8
 *
9
 * This program is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 * GNU General Public License for more details.
13
 *
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 "Planet.hpp"
20
#include "SolarSystem.hpp"
21
#include "StelApp.hpp"
22
#include "StelCore.hpp"
23
#include "StelModuleMgr.hpp"
24
#include "StelObjectMgr.hpp"
25
#include "StelUtils.hpp"
26
#include "SpecificTimeMgr.hpp"
27
#include "StelActionMgr.hpp"
28
#include "StelTranslator.hpp"
29

30
#include <QSettings>
31

32
SpecificTimeMgr::SpecificTimeMgr()
×
33
        : twilightAltitude(0.)
×
34
{
35
        setObjectName("SpecificTimeMgr");
×
36
        core = StelApp::getInstance().getCore();
×
37
        conf = StelApp::getInstance().getSettings();
×
38
        objMgr = GETSTELMODULE(StelObjectMgr);
×
39
}
×
40

41
SpecificTimeMgr::~SpecificTimeMgr()
×
42
{
43
        //
44
}
×
45

46
//double SpecificTimeMgr::getCallOrder(StelModuleActionName actionName) const
47
//{
48
//        if (actionName==StelModule::ActionDraw)
49
//                return StelApp::getInstance().getModuleMgr().getModule("LandscapeMgr")->getCallOrder(actionName)+10.;
50
//        return 0;
51
//}
52

53
void SpecificTimeMgr::init()
×
54
{
55
        sun = GETSTELMODULE(SolarSystem)->getSun();
×
56

57
        QString timeGroup = N_("Specific Time");
×
58

59
        addAction("actionNext_Transit",                      timeGroup, N_("Next transit of the selected object"),     this, "nextTransit()");
×
60
        addAction("actionNext_Rising",                      timeGroup, N_("Next rising of the selected object"),      this, "nextRising()");
×
61
        addAction("actionNext_Setting",                      timeGroup, N_("Next setting of the selected object"),     this, "nextSetting()");
×
62
        addAction("actionToday_Transit",              timeGroup, N_("Today's transit of the selected object"),  this, "todayTransit()");
×
63
        addAction("actionToday_Rising",                      timeGroup, N_("Today's rising of the selected object"),   this, "todayRising()");
×
64
        addAction("actionToday_Setting",              timeGroup, N_("Today's setting of the selected object"),  this, "todaySetting()");
×
65
        addAction("actionPrevious_Transit",              timeGroup, N_("Previous transit of the selected object"), this, "previousTransit()");
×
66
        addAction("actionPrevious_Rising",              timeGroup, N_("Previous rising of the selected object"),  this, "previousRising()");
×
67
        addAction("actionPrevious_Setting",              timeGroup, N_("Previous setting of the selected object"), this, "previousSetting()");
×
68

69
        addAction("actionNext_MorningTwilight",       timeGroup, N_("Next morning twilight"),     this, "nextMorningTwilight()");
×
70
        addAction("actionNext_EveningTwilight",       timeGroup, N_("Next evening twilight"),     this, "nextEveningTwilight()");
×
71
        addAction("actionToday_MorningTwilight",      timeGroup, N_("Today's morning twilight"),  this, "todayMorningTwilight()");
×
72
        addAction("actionToday_EveningTwilight",      timeGroup, N_("Today's evening twilight"),  this, "todayEveningTwilight()");
×
73
        addAction("actionPrevious_MorningTwilight",   timeGroup, N_("Previous morning twilight"), this, "previousMorningTwilight()");
×
74
        addAction("actionPrevious_EveningTwilight",   timeGroup, N_("Previous evening twilight"), this, "previousEveningTwilight()");
×
75

76
        addAction("actionNext_MorningAtAltitude",     timeGroup, N_("Selected object at altitude at next morning"),      this, "nextMorningAtAltitude()");
×
77
        addAction("actionToday_MorningAtAltitude",    timeGroup, N_("Selected object at altitude this morning"),         this, "todayMorningAtAltitude()");
×
78
        addAction("actionPrevious_MorningAtAltitude", timeGroup, N_("Selected object at altitude at previous morning"),  this, "previousMorningAtAltitude()");
×
79
        addAction("actionNext_EveningAtAltitude",     timeGroup, N_("Selected object at altitude at next evening"),      this, "nextEveningAtAltitude()");
×
80
        addAction("actionToday_EveningAtAltitude",    timeGroup, N_("Selected object at altitude this evening"),         this, "todayEveningAtAltitude()");
×
81
        addAction("actionPrevious_EveningAtAltitude", timeGroup, N_("Selected object at altitude at previous evening"),  this, "previousEveningAtAltitude()");
×
82

83
        addAction("actionCurrent_March_Equinox",      timeGroup, N_("March equinox at current year"),      this, "currentMarchEquinox()");
×
84
        addAction("actionNext_March_Equinox",         timeGroup, N_("March equinox at next year"),         this, "nextMarchEquinox()");
×
85
        addAction("actionPrevious_March_Equinox",     timeGroup, N_("March equinox at previous year"),     this, "previousMarchEquinox()");
×
86

87
        addAction("actionCurrent_September_Equinox",  timeGroup, N_("September equinox at current year"),  this, "currentSeptemberEquinox()");
×
88
        addAction("actionNext_September_Equinox",     timeGroup, N_("September equinox at next year"),     this, "nextSeptemberEquinox()");
×
89
        addAction("actionPrevious_September_Equinox", timeGroup, N_("September equinox at previous year"), this, "previousSeptemberEquinox()");
×
90

91
        addAction("actionCurrent_June_Solstice",      timeGroup, N_("June solstice at current year"),      this, "currentJuneSolstice()");
×
92
        addAction("actionNext_June_Solstice",         timeGroup, N_("June solstice at next year"),         this, "nextJuneSolstice()");
×
93
        addAction("actionPrevious_June_Solstice",     timeGroup, N_("June solstice at previous year"),     this, "previousJuneSolstice()");
×
94

95
        addAction("actionCurrent_December_Solstice",  timeGroup, N_("December solstice at current year"),  this, "currentDecemberSolstice()");
×
96
        addAction("actionNext_December_Solstice",     timeGroup, N_("December solstice at next year"),     this, "nextDecemberSolstice()");
×
97
        addAction("actionPrevious_December_Solstice", timeGroup, N_("December solstice at previous year"), this, "previousDecemberSolstice()");
×
98

99
        setTwilightAltitude(conf->value("astro/twilight_altitude", -6.).toDouble());
×
100
}
×
101

102
void SpecificTimeMgr::deinit()
×
103
{
104
        //
105
}
×
106

107
//void SpecificTimeMgr::draw(StelCore* core)
108
//{
109
//        StelProjectorP prj = core->getProjection(StelCore::FrameJ2000);
110
//        StelPainter painter(prj);
111
//}
112

113
void SpecificTimeMgr::setTwilightAltitude(double alt)
×
114
{
115
        if (!qFuzzyCompare(alt, twilightAltitude))
×
116
        {
117
                twilightAltitude=alt;
×
118
                emit twilightAltitudeChanged(alt);
×
119
        }
120
}
×
121

122
void SpecificTimeMgr::nextTransit()
×
123
{
124
        const QList<StelObjectP> selected = objMgr->getSelectedObject();
×
125
        if (!selected.isEmpty() && selected[0]->getType()!="Satellite")
×
126
        {
127
                core->addSolarDays(1.0);
×
128
                core->update(0);
×
129
                Vec4d rts = selected[0]->getRTSTime(core);
×
130
                if (rts[3]>-1000.)
×
131
                {
132
                        if (rts[3]!=20)
×
133
                                core->setJD(rts[1]);
×
134
                        else { // no transit
135
                                core->addSolarDays(1.0);
×
136
                                core->update(0);
×
137
                                rts = selected[0]->getRTSTime(core);
×
138
                                core->setJD(rts[1]);
×
139
                        }
140
                }
141
        }
142
}
×
143

144
void SpecificTimeMgr::nextRising()
×
145
{
146
        const QList<StelObjectP> selected = objMgr->getSelectedObject();
×
147
        if (!selected.isEmpty() && selected[0]->getType()!="Satellite")
×
148
        {
149
                core->addSolarDays(1.0);
×
150
                core->update(0);
×
151
                Vec4d rts = selected[0]->getRTSTime(core);
×
152
                if (rts[3]>-1000.)
×
153
                {
154
                        if (rts[3]!=30)
×
155
                                core->setJD(rts[0]);
×
156
                        else { // no rise
157
                                core->addSolarDays(1.0);
×
158
                                core->update(0);
×
159
                                rts = selected[0]->getRTSTime(core);
×
160
                                core->setJD(rts[0]);
×
161
                        }
162
                }
163
        }
164
}
×
165

166
void SpecificTimeMgr::nextSetting()
×
167
{
168
        const QList<StelObjectP> selected = objMgr->getSelectedObject();
×
169
        if (!selected.isEmpty() && selected[0]->getType()!="Satellite")
×
170
        {
171
                core->addSolarDays(1.0);
×
172
                core->update(0);
×
173
                Vec4d rts = selected[0]->getRTSTime(core);
×
174
                if (rts[3]>-1000.)
×
175
                {
176
                        if (rts[3]!=40)
×
177
                                core->setJD(rts[2]);
×
178
                        else { // no set
179
                                core->addSolarDays(1.0);
×
180
                                core->update(0);
×
181
                                rts = selected[0]->getRTSTime(core);
×
182
                                core->setJD(rts[2]);
×
183
                        }
184
                }
185
        }
186
}
×
187

188
void SpecificTimeMgr::previousTransit()
×
189
{
190
        const QList<StelObjectP> selected = objMgr->getSelectedObject();
×
191
        if (!selected.isEmpty() && selected[0]->getType()!="Satellite")
×
192
        {
193
                core->addSolarDays(-1.0);
×
194
                core->update(0);
×
195
                Vec4d rts = selected[0]->getRTSTime(core);
×
196
                if (rts[3]>-1000.)
×
197
                {
198
                        if (rts[3]!=20)
×
199
                                core->setJD(rts[1]);
×
200
                        else { // no transit
201
                                core->addSolarDays(-1.0);
×
202
                                core->update(0);
×
203
                                rts = selected[0]->getRTSTime(core);
×
204
                                core->setJD(rts[1]);
×
205
                        }
206
                }
207
        }
208
}
×
209

210
void SpecificTimeMgr::previousRising()
×
211
{
212
        const QList<StelObjectP> selected = objMgr->getSelectedObject();
×
213
        if (!selected.isEmpty() && selected[0]->getType()!="Satellite")
×
214
        {
215
                core->addSolarDays(-1.0);
×
216
                core->update(0);
×
217
                Vec4d rts = selected[0]->getRTSTime(core);
×
218
                if (rts[3]>-1000.)
×
219
                {
220
                        if (rts[3]!=30)
×
221
                                core->setJD(rts[0]);
×
222
                        else { // no rise
223
                                core->addSolarDays(-1.0);
×
224
                                core->update(0);
×
225
                                rts = selected[0]->getRTSTime(core);
×
226
                                core->setJD(rts[0]);
×
227
                        }
228
                }
229
        }
230
}
×
231

232
void SpecificTimeMgr::previousSetting()
×
233
{
234
        const QList<StelObjectP> selected = objMgr->getSelectedObject();
×
235
        if (!selected.isEmpty() && selected[0]->getType()!="Satellite")
×
236
        {
237
                core->addSolarDays(-1.0);
×
238
                core->update(0);
×
239
                Vec4d rts = selected[0]->getRTSTime(core);
×
240
                if (rts[3]>-1000.)
×
241
                {
242
                        if (rts[3]!=40)
×
243
                                core->setJD(rts[2]);
×
244
                        else { // no set
245
                                core->addSolarDays(-1.0);
×
246
                                core->update(0);
×
247
                                rts = selected[0]->getRTSTime(core);
×
248
                                core->setJD(rts[2]);
×
249
                        }
250
                }
251
        }
252
}
×
253

254
void SpecificTimeMgr::todayTransit()
×
255
{
256
        const QList<StelObjectP> selected = objMgr->getSelectedObject();
×
257
        if (!selected.isEmpty() && selected[0]->getType()!="Satellite")
×
258
        {
259
                Vec4d rts = selected[0]->getRTSTime(core);
×
260
                if (rts[3]>-1000.)
×
261
                        core->setJD(rts[1]);
×
262
        }
263
}
×
264

265
void SpecificTimeMgr::todayRising()
×
266
{
267
        const QList<StelObjectP> selected = objMgr->getSelectedObject();
×
268
        if (!selected.isEmpty() && selected[0]->getType()!="Satellite")
×
269
        {
270
                Vec4d rts = selected[0]->getRTSTime(core);
×
271
                if (rts[3]>-1000.)
×
272
                        core->setJD(rts[0]);
×
273
        }
274
}
×
275

276
void SpecificTimeMgr::todaySetting()
×
277
{
278
        const QList<StelObjectP> selected = objMgr->getSelectedObject();
×
279
        if (!selected.isEmpty() && selected[0]->getType()!="Satellite")
×
280
        {
281
                Vec4d rts = selected[0]->getRTSTime(core);
×
282
                if (rts[3]>-1000.)
×
283
                        core->setJD(rts[2]);
×
284
        }
285
}
×
286

287
void SpecificTimeMgr::todayMorningTwilight()
×
288
{
289
        Vec4d rts = sun->getRTSTime(core, twilightAltitude);
×
290
        if (rts[3]>-1000.)
×
291
                core->setJD(rts[0]);
×
292
}
×
293

294
void SpecificTimeMgr::todayEveningTwilight()
×
295
{
296
        Vec4d rts = sun->getRTSTime(core, twilightAltitude);
×
297
        if (rts[3]>-1000.)
×
298
                core->setJD(rts[2]);
×
299
}
×
300

301
void SpecificTimeMgr::previousMorningTwilight()
×
302
{
303
        core->addSolarDays(-1.0);
×
304
        core->update(0);
×
305
        Vec4d rts = sun->getRTSTime(core, twilightAltitude);
×
306
        if (rts[3]>-1000.)
×
307
                core->setJD(rts[0]);
×
308
}
×
309

310
void SpecificTimeMgr::previousEveningTwilight()
×
311
{
312
        core->addSolarDays(-1.0);
×
313
        core->update(0);
×
314
        Vec4d rts = sun->getRTSTime(core, twilightAltitude);
×
315
        if (rts[3]>-1000.)
×
316
                core->setJD(rts[2]);
×
317
}
×
318

319
void SpecificTimeMgr::nextMorningTwilight()
×
320
{
321
        core->addSolarDays(1.0);
×
322
        core->update(0);
×
323
        Vec4d rts = sun->getRTSTime(core, twilightAltitude);
×
324
        if (rts[3]>-1000.)
×
325
                core->setJD(rts[0]);
×
326
}
×
327

328
void SpecificTimeMgr::nextEveningTwilight()
×
329
{
330
        core->addSolarDays(1.0);
×
331
        core->update(0);
×
332
        Vec4d rts = sun->getRTSTime(core, twilightAltitude);
×
333
        if (rts[3]>-1000.)
×
334
                core->setJD(rts[2]);
×
335
}
×
336

337
void SpecificTimeMgr::todayMorningAtAltitude()
×
338
{
339
        const QList<StelObjectP> selected = objMgr->getSelectedObject();
×
340
        if (!selected.isEmpty() && selected[0]->getType()!="Satellite")
×
341
        {
342
                double az, alt;
343
                StelUtils::rectToSphe(&az, &alt, selected[0]->getAltAzPosGeometric(core));
×
344
                Vec4d rts = selected[0]->getRTSTime(core, alt*M_180_PI);
×
345
                if (rts[3]>-1000.)
×
346
                        core->setJD(rts[0]);
×
347
        }
348
}
×
349

350
void SpecificTimeMgr::nextMorningAtAltitude()
×
351
{
352
        const QList<StelObjectP> selected = objMgr->getSelectedObject();
×
353
        if (!selected.isEmpty() && selected[0]->getType()!="Satellite")
×
354
        {
355
                double az, alt;
356
                StelUtils::rectToSphe(&az, &alt, selected[0]->getAltAzPosGeometric(core));
×
357
                core->addSolarDays(1.0);
×
358
                core->update(0);
×
359
                Vec4d rts = selected[0]->getRTSTime(core, alt*M_180_PI);
×
360
                if (rts[3]>-1000.)
×
361
                        core->setJD(rts[0]);
×
362
        }
363
}
×
364

365
void SpecificTimeMgr::previousMorningAtAltitude()
×
366
{
367
        const QList<StelObjectP> selected = objMgr->getSelectedObject();
×
368
        if (!selected.isEmpty() && selected[0]->getType()!="Satellite")
×
369
        {
370
                double az, alt;
371
                StelUtils::rectToSphe(&az, &alt, selected[0]->getAltAzPosGeometric(core));
×
372
                core->addSolarDays(-1.0);
×
373
                core->update(0);
×
374
                Vec4d rts = selected[0]->getRTSTime(core, alt*M_180_PI);
×
375
                if (rts[3]>-1000.)
×
376
                        core->setJD(rts[0]);
×
377
        }
378
}
×
379

380
void SpecificTimeMgr::todayEveningAtAltitude()
×
381
{
382
        const QList<StelObjectP> selected = objMgr->getSelectedObject();
×
383
        if (!selected.isEmpty() && selected[0]->getType()!="Satellite")
×
384
        {
385
                double az, alt;
386
                StelUtils::rectToSphe(&az, &alt, selected[0]->getAltAzPosGeometric(core));
×
387
                Vec4d rts = selected[0]->getRTSTime(core, alt*M_180_PI);
×
388
                if (rts[3]>-1000.)
×
389
                        core->setJD(rts[2]);
×
390
        }
391
}
×
392

393
void SpecificTimeMgr::nextEveningAtAltitude()
×
394
{
395
        const QList<StelObjectP> selected = objMgr->getSelectedObject();
×
396
        if (!selected.isEmpty() && selected[0]->getType()!="Satellite")
×
397
        {
398
                double az, alt;
399
                StelUtils::rectToSphe(&az, &alt, selected[0]->getAltAzPosGeometric(core));
×
400
                core->addSolarDays(1.0);
×
401
                core->update(0);
×
402
                Vec4d rts = selected[0]->getRTSTime(core, alt*M_180_PI);
×
403
                if (rts[3]>-1000.)
×
404
                        core->setJD(rts[2]);
×
405
        }
406
}
×
407

408
void SpecificTimeMgr::previousEveningAtAltitude()
×
409
{
410
        const QList<StelObjectP> selected = objMgr->getSelectedObject();
×
411
        if (!selected.isEmpty() && selected[0]->getType()!="Satellite")
×
412
        {
413
                double az, alt;
414
                StelUtils::rectToSphe(&az, &alt, selected[0]->getAltAzPosGeometric(core));
×
415
                core->addSolarDays(-1.0);
×
416
                core->update(0);
×
417
                Vec4d rts = selected[0]->getRTSTime(core, alt*M_180_PI);
×
418
                if (rts[3]>-1000.)
×
419
                        core->setJD(rts[2]);
×
420
        }
421
}
×
422

423
static const double MeeusCoefficients[24][3] = {
424
        //  i (row) a{i}   b{i}       c{i}
425
        /*  1 */ { 485.0, 324.96,   1934.136 },
426
        /*  2 */ { 203.0, 337.23,  32964.467 },
427
        /*  3 */ { 199.0, 342.08,     20.186 },
428
        /*  4 */ { 182.0,  27.85, 445267.112 },
429
        /*  5 */ { 156.0,  73.14,  45036.886 },
430
        /*  6 */ { 136.0, 171.52,  22518.443 },
431
        /*  7 */ {  77.0, 222.54,  65928.934 },
432
        /*  8 */ {  74.0, 296.72,   3034.906 },
433
        /*  9 */ {  70.0, 243.58,   9037.513 },
434
        /* 10 */ {  58.0, 119.81,  33718.147 },
435
        /* 11 */ {  52.0, 297.17,    150.678 },
436
        /* 12 */ {  50.0,  21.02,   2281.226 },
437
        /* 13 */ {  45.0, 247.54,  29929.562 },
438
        /* 14 */ {  44.0, 325.15,  31555.956 },
439
        /* 15 */ {  29.0,  60.93,   4443.417 },
440
        /* 16 */ {  18.0, 155.12,  67555.328 },
441
        /* 17 */ {  17.0, 288.79,   4562.452 },
442
        /* 18 */ {  16.0, 198.04,  62894.029 },
443
        /* 19 */ {  14.0, 199.76,  31436.921 },
444
        /* 20 */ {  12.0,  95.39,  14577.848 },
445
        /* 21 */ {  12.0, 287.11,  31931.756 },
446
        /* 22 */ {  12.0, 320.81,  34777.259 },
447
        /* 23 */ {   9.0, 227.73,   1222.114 },
448
        /* 24 */ {   8.0,  15.45,  16859.074 }
449
};
450

451
double SpecificTimeMgr::getEquinox(int year, SpecificTimeMgr::Equinox equinox)
×
452
{
453
        double JDE0, Y;
454
        if (-1000<=year && year<=1000)
×
455
        {
456
                Y = year/1000.;
×
457
                if (equinox==Equinox::March) // March equinox
×
458
                        JDE0 = 1721139.29189 + Y*(365242.13740 + Y*( 0.06134 + Y*( 0.00111 + Y*(-0.00071))));
×
459
                else // September equinox
460
                        JDE0 = 1721325.70455 + Y*(365242.49558 + Y*(-0.11677 + Y*(-0.00297 + Y*( 0.00074))));
×
461
        }
462
        else if (1000<year && year<=3000)
×
463
        {
464
                Y = (year - 2000.)/1000.;
×
465
                if (equinox==Equinox::March) // March equinox
×
466
                        JDE0 = 2451623.80984 + Y*(365242.37404 + Y*( 0.05169 + Y*(-0.00411 + Y*(-0.00057))));
×
467
                else // September equinox
468
                        JDE0 = 2451810.21715 + Y*(365242.01767 + Y*(-0.11575 + Y*( 0.00337 + Y*( 0.00078))));
×
469
        }
470
        else
471
                return 0.0;
×
472

473
        const double T = (JDE0 - 2451545.0)/36525.;
×
474
        const double W = 35999.373*T - 2.47; // degrees!
×
475
        const double deltaLambda = 1 + 0.0334*cos(W*M_PI_180) + 0.0007*cos(2*W*M_PI_180);
×
476
        double S = 0.;
×
477
        for (int i=0; i<24; i++)
×
478
        {
479
                S += MeeusCoefficients[i][0]*cos((MeeusCoefficients[i][1] + MeeusCoefficients[i][2]*T)*M_PI_180);
×
480
        }
481

482
        return JDE0 + 0.00001*S/deltaLambda;
×
483
}
484

485
double SpecificTimeMgr::getSolstice(int year, SpecificTimeMgr::Solstice solstice)
×
486
{
487
        double JDE0, Y;
488
        if (-1000<=year && year<=1000)
×
489
        {
490
                Y = year/1000.;
×
491
                if (solstice==Solstice::June) // June solstice
×
492
                        JDE0 = 1721233.25401 + Y*(365241.72562 + Y*(-0.05323 + Y*( 0.00907 + Y*( 0.00025))));
×
493
                else // December solstice
494
                        JDE0 = 1721414.39987 + Y*(365242.88257 + Y*(-0.00769 + Y*(-0.00933 + Y*(-0.00006))));
×
495
        }
496
        else if (1000<year && year<=3000)
×
497
        {
498
                Y = (year - 2000.)/1000.;
×
499
                if (solstice==Solstice::June) // June solstice
×
500
                        JDE0 = 2451716.56767 + Y*(365241.62603 + Y*( 0.00325 + Y*( 0.00888 + Y*(-0.00030))));
×
501
                else // December solstice
502
                        JDE0 = 2451900.05952 + Y*(365242.74049 + Y*(-0.06223 + Y*(-0.00823 + Y*( 0.00032))));
×
503
        }
504
        else
505
                return 0.0;
×
506

507
        const double T = (JDE0 - 2451545.0)/36525.;
×
508
        const double W = 35999.373*T - 2.47; // degrees!
×
509
        const double deltaLambda = 1 + 0.0334*cos(W*M_PI_180) + 0.0007*cos(2*W*M_PI_180);
×
510
        double S = 0.;
×
511
        for (int i=0; i<24; i++)
×
512
        {
513
                S += MeeusCoefficients[i][0]*cos((MeeusCoefficients[i][1] + MeeusCoefficients[i][2]*T)*M_PI_180);
×
514
        }
515

516
        return JDE0 + 0.00001*S/deltaLambda;
×
517
}
518

519
void SpecificTimeMgr::currentMarchEquinox()
×
520
{
521
        double JD = core->getJD();
×
522
        int year, month, day;
523
        StelUtils::getDateFromJulianDay(JD, &year, &month, &day);
×
524
        double estime = getEquinox(year, Equinox::March);
×
525
        if (estime>0.)
×
526
                core->setJD(estime);
×
527
}
×
528

529
void SpecificTimeMgr::nextMarchEquinox()
×
530
{
531
        double JD = core->getJD();
×
532
        int year, month, day;
533
        StelUtils::getDateFromJulianDay(JD, &year, &month, &day);
×
534
        double estime = getEquinox(year + 1, Equinox::March);
×
535
        if (estime>0.)
×
536
                core->setJD(estime);
×
537

538
        emit eventYearChanged();
×
539
}
×
540

541
void SpecificTimeMgr::previousMarchEquinox()
×
542
{
543
        double JD = core->getJD();
×
544
        int year, month, day;
545
        StelUtils::getDateFromJulianDay(JD, &year, &month, &day);
×
546
        double estime = getEquinox(year - 1, Equinox::March);
×
547
        if (estime>0.)
×
548
                core->setJD(estime);
×
549

550
        emit eventYearChanged();
×
551
}
×
552

553
void SpecificTimeMgr::currentSeptemberEquinox()
×
554
{
555
        double JD = core->getJD();
×
556
        int year, month, day;
557
        StelUtils::getDateFromJulianDay(JD, &year, &month, &day);
×
558
        double estime = getEquinox(year, Equinox::September);
×
559
        if (estime>0.)
×
560
                core->setJD(estime);
×
561
}
×
562

563
void SpecificTimeMgr::nextSeptemberEquinox()
×
564
{
565
        double JD = core->getJD();
×
566
        int year, month, day;
567
        StelUtils::getDateFromJulianDay(JD, &year, &month, &day);
×
568
        double estime = getEquinox(year + 1, Equinox::September);
×
569
        if (estime>0.)
×
570
                core->setJD(estime);
×
571

572
        emit eventYearChanged();
×
573
}
×
574

575
void SpecificTimeMgr::previousSeptemberEquinox()
×
576
{
577
        double JD = core->getJD();
×
578
        int year, month, day;
579
        StelUtils::getDateFromJulianDay(JD, &year, &month, &day);
×
580
        double estime = getEquinox(year - 1, Equinox::September);
×
581
        if (estime>0.)
×
582
                core->setJD(estime);
×
583

584
        emit eventYearChanged();
×
585
}
×
586

587
void SpecificTimeMgr::currentJuneSolstice()
×
588
{
589
        double JD = core->getJD();
×
590
        int year, month, day;
591
        StelUtils::getDateFromJulianDay(JD, &year, &month, &day);
×
592
        double estime = getSolstice(year, Solstice::June);
×
593
        if (estime>0.)
×
594
                core->setJD(estime);
×
595
}
×
596

597
void SpecificTimeMgr::nextJuneSolstice()
×
598
{
599
        double JD = core->getJD();
×
600
        int year, month, day;
601
        StelUtils::getDateFromJulianDay(JD, &year, &month, &day);
×
602
        double estime = getSolstice(year + 1, Solstice::June);
×
603
        if (estime>0.)
×
604
                core->setJD(estime);
×
605

606
        emit eventYearChanged();
×
607
}
×
608

609
void SpecificTimeMgr::previousJuneSolstice()
×
610
{
611
        double JD = core->getJD();
×
612
        int year, month, day;
613
        StelUtils::getDateFromJulianDay(JD, &year, &month, &day);
×
614
        double estime = getSolstice(year - 1, Solstice::June);
×
615
        if (estime>0.)
×
616
                core->setJD(estime);
×
617

618
        emit eventYearChanged();
×
619
}
×
620

621
void SpecificTimeMgr::currentDecemberSolstice()
×
622
{
623
        double JD = core->getJD();
×
624
        int year, month, day;
625
        StelUtils::getDateFromJulianDay(JD, &year, &month, &day);
×
626
        double estime = getSolstice(year, Solstice::December);
×
627
        if (estime>0.)
×
628
                core->setJD(estime);
×
629
}
×
630

631
void SpecificTimeMgr::nextDecemberSolstice()
×
632
{
633
        double JD = core->getJD();
×
634
        int year, month, day;
635
        StelUtils::getDateFromJulianDay(JD, &year, &month, &day);
×
636
        double estime = getSolstice(year + 1, Solstice::December);
×
637
        if (estime>0.)
×
638
                core->setJD(estime);
×
639

640
        emit eventYearChanged();
×
641
}
×
642

643
void SpecificTimeMgr::previousDecemberSolstice()
×
644
{
645
        double JD = core->getJD();
×
646
        int year, month, day;
647
        StelUtils::getDateFromJulianDay(JD, &year, &month, &day);
×
648
        double estime = getSolstice(year - 1, Solstice::December);
×
649
        if (estime>0.)
×
650
                core->setJD(estime);
×
651

652
        emit eventYearChanged();
×
653
}
×
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