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

Stellarium / stellarium / 17068063291

19 Aug 2025 11:22AM UTC coverage: 11.766%. Remained the same
17068063291

push

github

alex-w
Reformatting

14706 of 124990 relevant lines covered (11.77%)

18303.49 hits per line

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

0.0
/plugins/NavStars/src/NavStars.cpp
1
/*
2
 * Navigational Stars plug-in
3
 * Copyright (C) 2014-2016 Alexander Wolf
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
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA  02110-1335, USA.
18
 */
19

20
#include "StelProjector.hpp"
21
#include "StelPainter.hpp"
22
#include "StelApp.hpp"
23
#include "StelCore.hpp"
24
#include "StelGui.hpp"
25
#include "StelGuiItems.hpp"
26
#include "StelModuleMgr.hpp"
27
#include "StelTextureMgr.hpp"
28
#include "StelTranslator.hpp"
29
#include "StelFileMgr.hpp"
30
#include "StelObjectMgr.hpp"
31
#include "StelPropertyMgr.hpp"
32
#include "StelUtils.hpp"
33
#include "NavStars.hpp"
34
#include "NavStarsWindow.hpp"
35
#include "NavStarsCalculator.hpp"
36
#include "Planet.hpp"
37

38
#include <QList>
39
#include <QSharedPointer>
40
#include <QMetaEnum>
41

42
#include "planetsephems/sidereal_time.h"
43

44
StelModule* NavStarsStelPluginInterface::getStelModule() const
×
45
{
46
        return new NavStars();
×
47
}
48

49
StelPluginInfo NavStarsStelPluginInterface::getPluginInfo() const
×
50
{
51
        Q_INIT_RESOURCE(NavStars);
×
52
 
53
        StelPluginInfo info;
×
54
        info.id = "NavStars";
×
55
        info.displayedName = N_("Navigational Stars");
×
56
        info.authors = "Alexander Wolf, Andy Kirkham";
×
57
        info.contact = STELLARIUM_URL;
×
58
        info.description = N_("This plugin marks navigational stars from a selected set.");
×
59
        info.version = NAVSTARS_PLUGIN_VERSION;
×
60
        info.license = NAVSTARS_PLUGIN_LICENSE;
×
61
        return info;
×
62
}
×
63

64
NavStars::NavStars()
×
65
        : currentNSSet(AngloAmerican)
×
66
        , enableAtStartup(false)        
×
67
        , starLabelsState(true)        
×
68
        , upperLimb(false)
×
69
        , highlightWhenVisible(false)
×
70
        , limitInfoToNavStars(false)        
×
71
        , tabulatedDisplay(false)
×
72
        , useUTCTime(false)
×
73
        , toolbarButton(Q_NULLPTR)
×
74
{
75
        setObjectName("NavStars");
×
76
        conf = StelApp::getInstance().getSettings();
×
77
        propMgr = StelApp::getInstance().getStelPropertyManager();
×
78
        mainWindow = new NavStarsWindow();
×
79
}
×
80

81
NavStars::~NavStars()
×
82
{
83
        delete mainWindow;
×
84
}
×
85

86
double NavStars::getCallOrder(StelModuleActionName actionName) const
×
87
{
88
        if (actionName == StelModule::ActionDraw)
×
89
                return StelApp::getInstance()
×
90
                        .getModuleMgr()
×
91
                        .getModule("ConstellationMgr")->getCallOrder(actionName)+10.;
×
92
        return 0;
×
93
}
94

95
void NavStars::init()
×
96
{
97
        if (!conf->childGroups().contains("NavigationalStars"))
×
98
        {
99
                qDebug() << "[NavStars] no coordinates section exists in main config file - creating with defaults";
×
100
                restoreDefaultConfiguration();
×
101
        }
102
        // save default state for star labels and time zone
103
        starLabelsState = propMgr->getStelPropertyValue("StarMgr.flagLabelsDisplayed").toBool();
×
104
        timeZone = propMgr->getStelPropertyValue("StelCore.currentTimeZone").toString();
×
105

106
        // populate settings from main config file.
107
        loadConfiguration();
×
108

109
        // populate list of navigational stars
110
        populateNavigationalStarsSet();
×
111

112
        setNavStarsMarks(getEnableAtStartup());
×
113

114
        // Marker texture - using the same texture as the planet hints.
115
        QString path = StelFileMgr::findFile("textures/planet-indicator.png");
×
116
        markerTexture = StelApp::getInstance().getTextureManager().createTexture(path);
×
117

118
        // key bindings and other actions
119
        addAction("actionShow_NavStars",        N_("Navigational Stars"), N_("Mark the navigational stars"), "navStarsVisible");
×
120
        addAction("actionShow_NavStars_dialog", N_("Navigational Stars"), N_("Show settings dialog"),        mainWindow, "visible");
×
121

122
        connect(StelApp::getInstance().getCore(), SIGNAL(configurationDataSaved()), this, SLOT(saveSettings()));
×
123
        connect(&StelApp::getInstance(), SIGNAL(flagShowDecimalDegreesChanged(bool)), this, SLOT(setUseDecimalDegrees(bool)));
×
124
        setUseDecimalDegrees(StelApp::getInstance().getFlagShowDecimalDegrees());
×
125

126
        // Toolbar button
127
        StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui());
×
128
        if (gui!=Q_NULLPTR)
×
129
        {
130
                if (toolbarButton == Q_NULLPTR)
×
131
                {
132
                        // Create the nav. stars button
133
                        toolbarButton = new StelButton(Q_NULLPTR,
×
134
                                                       QPixmap(":/NavStars/btNavStars-on.png"),
×
135
                                                       QPixmap(":/NavStars/btNavStars-off.png"),
×
136
                                                       QPixmap(":/graphicGui/miscGlow32x32.png"),
×
137
                                                       "actionShow_NavStars",
138
                                                       false,
139
                                                       "actionShow_NavStars_dialog");
×
140
                }
141
                gui->getButtonBar()->addButton(toolbarButton, "065-pluginsGroup");
×
142
        }
143
}
×
144

145
void NavStars::deinit()
×
146
{
147
        if (getFlagUseUTCTime())
×
148
                propMgr->setStelPropertyValue("StelCore.currentTimeZone", timeZone);
×
149
        markerTexture.clear();
×
150
        stars.clear();
×
151
        starNumbers.clear();
×
152
}
×
153

154
bool NavStars::configureGui(bool show)
×
155
{
156
        if (show)
×
157
        {
158
                mainWindow->setVisible(true);
×
159
        }
160

161
        return true;
×
162
}
163

164
void NavStars::draw(StelCore* core)
×
165
{
166
        // Drawing is enabled?
167
        if (markerFader.getInterstate() <= 0.0f)
×
168
        {
169
                return;
×
170
        }
171
        
172
        QList<int> sn = getStarsNumbers();
×
173

174
        if (stars.isEmpty())
×
175
        {
176
                StelObjectMgr* omgr = GETSTELMODULE(StelObjectMgr);
×
177
                stars.fill(StelObjectP(), sn.size());
×
178
                for (int i = 0; i < sn.size(); ++i)
×
179
                {
180
                        QString name = QString("HIP %1").arg(sn.at(i));
×
181
                        stars[i] = omgr->searchByName(name);
×
182
                }
×
183
        }
184

185
        StelProjectorP prj = core->getProjection(StelCore::FrameJ2000);
×
186
        StelPainter painter(prj);
×
187
        float mlimit = core->getSkyDrawer()->getLimitMagnitude();
×
188

189
        Vec3d pos;
×
190
        for (int i = 0; i < sn.size(); ++i)
×
191
        {
192
                if (stars[i].isNull())
×
193
                        continue;
×
194
                
195
                // Don't show if magnitude too low for visibility.
196
                if (highlightWhenVisible && stars[i]->getVMagnitude(core) > mlimit)
×
197
                        continue;
×
198

199
                // Get the current position of the navigational star...
200
                if (prj->projectCheck(stars[i]->getJ2000EquatorialPos(core), pos))
×
201
                {
202
                        // ... and draw a marker around it
203
                        if (!markerTexture.isNull())
×
204
                        {
205
                                painter.setBlending(true);
×
206
                                painter.setColor(markerColor, markerFader.getInterstate());
×
207
                                markerTexture->bind();
×
208
                                painter.drawSprite2dMode(static_cast<float>(pos[0]), static_cast<float>(pos[1]), 11.f);
×
209
                        }
210

211
                        // Draw the localized name of the star and its ordinal number
212
                        QString label = stars[i]->getNameI18n();
×
213
                        if (label.isEmpty())
×
214
                                label = QString("%1").arg(i+1);
×
215
                        else
216
                                label = QString("%1 (%2)").arg(label).arg(i+1);
×
217
                        painter.drawText(static_cast<float>(pos[0]), static_cast<float>(pos[1]), label, 0, 15.f, 15.f, false);
×
218
                }
×
219
        }
220

221
        addExtraInfo(core);
×
222
}
×
223

224
void NavStars::update(double deltaTime)
×
225
{
226
        markerFader.update(static_cast<int>(deltaTime*1000));
×
227
}
×
228

229
void NavStars::setNavStarsMarks(const bool b)
×
230
{
231
        if (b==getNavStarsMarks())
×
232
                return;
×
233

234
        if (b)
×
235
        {
236
                starLabelsState = propMgr->getStelPropertyValue("StarMgr.flagLabelsDisplayed").toBool();
×
237
                propMgr->setStelPropertyValue("StarMgr.flagLabelsDisplayed", false);
×
238
        }
239
        else
240
                propMgr->setStelPropertyValue("StarMgr.flagLabelsDisplayed", starLabelsState);
×
241

242
        if (getFlagUseUTCTime())
×
243
                propMgr->setStelPropertyValue("StelCore.currentTimeZone", b ? "UTC" : timeZone);
×
244

245
        markerFader = b;
×
246
        emit navStarsMarksChanged(b);
×
247
}
248

249
bool NavStars::getNavStarsMarks() const
×
250
{
251
        return markerFader;
×
252
}
253

254
void NavStars::setEnableAtStartup(bool b)
×
255
{
256
        if (b!=getEnableAtStartup())
×
257
        {
258
                enableAtStartup=b;
×
259
                emit enableAtStartupChanged(b);
×
260
        }
261
}
×
262

263
void NavStars::setHighlightWhenVisible(bool b)
×
264
{
265
        if (b!=getHighlightWhenVisible())
×
266
        {
267
                highlightWhenVisible=b;
×
268
                emit highlightWhenVisibleChanged(b);
×
269
        }
270
}
×
271

272
void NavStars::setLimitInfoToNavStars(bool b)
×
273
{
274
        if (b!=getLimitInfoToNavStars())
×
275
        {
276
                limitInfoToNavStars=b;
×
277
                emit limitInfoToNavStarsChanged(b);
×
278
        }
279
}
×
280

281
void NavStars::setUpperLimb(bool b)
×
282
{
283
        if (b!=getUpperLimb())
×
284
        {
285
                upperLimb=b;
×
286
                emit upperLimbChanged(b);
×
287
        }
288
}
×
289

290
void NavStars::setTabulatedDisplay(bool b)
×
291
{
292
        if (b!=getTabulatedDisplay())
×
293
        {
294
                tabulatedDisplay=b;
×
295
                emit tabulatedDisplayChanged(b);
×
296
        }
297
}
×
298

299
void NavStars::setFlagUseUTCTime(bool b)
×
300
{
301
        if (b!=getFlagUseUTCTime())
×
302
        {
303
                useUTCTime=b;
×
304
                emit flagUseUTCTimeChanged(b);
×
305

306
                if (getNavStarsMarks())
×
307
                        propMgr->setStelPropertyValue("StelCore.currentTimeZone", b ? "UTC" : timeZone);
×
308
        }
309
}
×
310

311
void NavStars::setShowExtraDecimals(bool b)
×
312
{
313
        if (b!=getShowExtraDecimals())
×
314
        {
315
                NavStarsCalculator::useExtraDecimals=b;
×
316
                emit showExtraDecimalsChanged(b);
×
317
        }
318
}
×
319

320
void NavStars::setUseDecimalDegrees(bool flag)
×
321
{
322
        NavStarsCalculator::useDecimalDegrees = flag;
×
323
}
×
324

325
void NavStars::restoreDefaultConfiguration(void)
×
326
{
327
        // Remove the whole section from the configuration file
328
        conf->remove("NavigationalStars");
×
329
        // Load the default values...
330
        loadConfiguration();
×
331
        // ... then save them.
332
        saveConfiguration();
×
333
}
×
334

335
void NavStars::loadConfiguration(void)
×
336
{
337
        conf->beginGroup("NavigationalStars");
×
338

339
        setCurrentNavigationalStarsSetKey(conf->value("current_ns_set", "AngloAmerican").toString());
×
340
        markerColor = Vec3f(conf->value("marker_color", "0.8,0.0,0.0").toString());
×
341
        enableAtStartup = conf->value("enable_at_startup", false).toBool();
×
342
        highlightWhenVisible = conf->value("highlight_when_visible", false).toBool();
×
343
        limitInfoToNavStars  = conf->value("limit_info_to_nav_stars", false).toBool();
×
344
        tabulatedDisplay = conf->value("tabulated_display", false).toBool();
×
345
        upperLimb = conf->value("upper_limb", false).toBool();
×
346
        setShowExtraDecimals(conf->value("extra_decimals", false).toBool());
×
347
        useUTCTime = conf->value("use_utc_time", false).toBool();
×
348

349
        conf->endGroup();
×
350
}
×
351

352
void NavStars::saveConfiguration(void)
×
353
{
354
        conf->beginGroup("NavigationalStars");
×
355

356
        conf->setValue("current_ns_set", getCurrentNavigationalStarsSetKey());
×
357
        conf->setValue("marker_color", markerColor.toStr());
×
358
        conf->setValue("enable_at_startup", getEnableAtStartup());
×
359
        conf->setValue("highlight_when_visible", getHighlightWhenVisible());
×
360
        conf->setValue("limit_info_to_nav_stars", getLimitInfoToNavStars());
×
361
        conf->setValue("tabulated_display", getTabulatedDisplay());
×
362
        conf->setValue("upper_limb", getUpperLimb());
×
363
        conf->setValue("extra_decimals", getShowExtraDecimals());
×
364
        conf->setValue("use_utc_time", getFlagUseUTCTime());
×
365

366
        conf->endGroup();
×
367
}
×
368

369
void NavStars::setCurrentNavigationalStarsSetKey(const QString &key)
×
370
{
371
        const QMetaEnum& en = metaObject()->enumerator(metaObject()->indexOfEnumerator("NavigationalStarsSet"));
×
372
        NavigationalStarsSet nsSet = static_cast<NavigationalStarsSet>(en.keyToValue(key.toLatin1().data()));
×
373
        if (nsSet<0)
×
374
        {
375
                qWarning() << "Unknown navigational stars set:" << key << "setting \"AngloAmerican\" instead";
×
376
                nsSet = AngloAmerican;
×
377
        }
378
        setCurrentNavigationalStarsSet(nsSet);
×
379
        populateNavigationalStarsSet();
×
380
}
×
381

382
QString NavStars::getCurrentNavigationalStarsSetKey() const
×
383
{
384
        return metaObject()->enumerator(metaObject()->indexOfEnumerator("NavigationalStarsSet")).key(currentNSSet);
×
385
}
386

387
QString NavStars::getCurrentNavigationalStarsSetDescription() const
×
388
{
389
        static const QMap<NavigationalStarsSet, QString> description = {
390
                // TRANSLATORS: The emphasis tags mark a title.
391
                {  AngloAmerican, N_("The 57 \"selected stars\" that are listed in <em>The Nautical Almanac</em> jointly published by Her Majesty's Nautical Almanac Office and the US Naval Observatory since 1958; consequently, these stars are also used in navigational aids such as the <em>2102D Star Finder</em> and <em>Identifier</em>.") },
×
392
                {         French, N_("The 81 stars that are listed in the French Nautical Almanac published by the French Bureau des Longitudes.") },
×
393
                // TRANSLATORS: The emphasis tags mark a title.
394
                {        British, N_("The 47 navigational stars that are listed in the Nevil Maskelyne's <em>The British Mariner's Guide</em> published in 1764.") },
×
395
                // TRANSLATORS: The emphasis tags mark a title.
396
                {       Wrinkles, N_("The 47 navigational stars that are listed in the Thornton S. Lecky's <em>Wrinkles in practical navigation</em> published in 1884.") },
×
397
                {         German, N_("The 80 stars that are listed in the German Nautical Almanac published by the Federal Maritime and Hydrographic Agency of Germany.") },
×
398
                {        Russian, N_("The 160 stars that are listed in the Russian Nautical Almanac.") },
×
399
                // TRANSLATORS: The emphasis tags mark a title.
400
                {       USSRAvia, N_("The typical set of navigational stars which was used by aviation of the Soviet Union. These stars can be found in books like <em>Aviation Astronomy</em> or <em>Aviation handbook</em>.") },
×
401
                {      USSRSpace, N_("These 151 stars were used in the Voskhod (Soviet) and Soyuz (Soviet and Russian) manned space programs to navigate in space.") },
×
402
                {         Apollo, N_("These 37 stars were used by the Apollo space program to navigate to the Moon from 1969-1972, Apollo 11 through Apollo 17.") },
×
403
                {      GeminiAPS, N_("Alignment stars from the Gemini Astronomical Positioning System, a professional level computerized device for controlling small to medium German equatorial telescope mounts.") },
×
404
                {     MeadeLX200, N_("The Meade LX200 utilizes 33 bright and well known stars to calibrate the telescope’s Object Library in the ALTAZ and POLAR alignments. These stars were selected to allow observers from anywhere in the world on any given night, to be able to easily and quickly make precision alignments.") },
×
405
                {       MeadeETX, N_("This list from Meade ETX mount will aid the observer to find alignment stars at various times of the year.") },
×
406
                {     MeadeAS494, N_("Alignment stars for the Meade Autostar #494 handset (ETX60AT).") },
×
407
                {     MeadeAS497, N_("Alignment stars for the Meade Autostar #497 handset.") },
×
408
                {    CelestronNS, N_("Even though there are about 250 named stars in the hand control database, only 82 (stars brighter than or equal to magnitude 2.5) can be used for alignment and related tasks.") },
×
409
                {   SkywatcherSS, N_("Alignment stars for the Skywatcher SynScan hand controller and SynScan Pro App.") },
×
410
                {        VixenSB, N_("Alignment stars for Vixen Starbook mounts.") },
×
411
                {      ArgoNavis, N_("Alignment stars for Argo Navis digital setting circles.") },
×
412
                {        OrionIS, N_("Alignment stars for Orion Intelliscope mounts.") },
×
413
                {   SkyCommander, N_("Alignment stars for Sky Commander digital setting circles.")}
×
414
        };
×
415

416
        // Original titles of almanacs
417
        static const QMap<NavigationalStarsSet, QString> almanacTitle = {
418
                {         French, "Ephémérides Nautiques" },
×
419
                {        Russian, "Морской астрономический ежегодник" },
×
420
                {         German, "Nautisches Jahrbuch" }
×
421
        };
×
422

423
        NavigationalStarsSet nsSet = getCurrentNavigationalStarsSet();
×
424

425
        QString almanacText     = almanacTitle.value(nsSet, QString());
×
426
        QString descriptionText = description.value(nsSet, QString());
×
427
        if (almanacText.isEmpty())
×
428
                return q_(descriptionText);
×
429
        else
430
        {
431
                // TRANSLATORS: The full phrase: The original almanac title is NAME_OF_THE_ALMANAC
432
                return QString("%1 %2 <em>%3</em>.").arg(q_(descriptionText), q_("The original almanac title is"), almanacText);
×
433
        }
434
}
×
435

436
void NavStars::populateNavigationalStarsSet(void)
×
437
{
438
        const bool currentState = getNavStarsMarks();
×
439

440
        setNavStarsMarks(false);
×
441
        stars.clear();
×
442
        starNumbers.clear();
×
443

444
        // List of HIP numbers of the navigational stars:
445
        switch(getCurrentNavigationalStarsSet())
×
446
        {
447
                case AngloAmerican:
×
448
                {
449
                        // 57 "selected stars" from The Nautical Almanac + Polar star.
450
                        starNumbers = {
×
451
                                   677,   2081,   3179,   3419,   7588,   9884,  13847,  14135,  15863,  21421,
452
                                 24436,  24608,  25336,  25428,  26311,  27989,  30438,  32349,  33579,  37279,
453
                                 37826,  41037,  44816,  45238,  46390,  49669,  54061,  57632,  59803,  60718,
454
                                 61084,  62956,  65474,  67301,  68702,  68933,  69673,  71683,  72622,  72607,
455
                                 76267,  80763,  82273,  84012,  85927,  86032,  87833,  90185,  91262,  92855,
456
                                 97649, 100751, 102098, 107315, 109268, 113368, 113963
457
                        };
×
458
                        break;
×
459
                }
460
                case French:
×
461
                {
462
                        // 81 stars from French Nautical Almanac
463
                        // Original French name: Ephémérides Nautiques
464
                        starNumbers = {
×
465
                                   677,    746,   1067,   2081,   3179,   3419,   4427,   5447,   7588,   9884,
466
                                 11767,  14135,  14576,  15863,  21421,  24436,  24608,  25336,  25428,  26311,
467
                                 26727,  27989,  28360,  30324,  30438,  31681,  32349,  33579,  34444,  36850,
468
                                 37279,  37826,  39429,  39953,  41037,  42913,  44816,  45238,  45556,  46390,
469
                                 49669,  53910,  54061,  54872,  57632,  58001,  59803,  60718,  61084,  61932,
470
                                 62434,  62956,  65378,  65474,  67301,  68702,  68933,  69673,  71683,  72607,
471
                                 76267,  80763,  82273,  82396,  85927,  86032,  87833,  90185,  91262,  92855,
472
                                 97649, 100453, 100751, 102098, 105199, 107315, 109268, 112122, 113368, 113881,
473
                                113963
474
                        };
×
475
                        break;
×
476
                }
477
                case British:
×
478
                {
479
                        // 47 stars from British Mariner's Guide
480
                        // References:
481
                        //     * https://archive.org/details/bim_eighteenth-century_the-british-mariners-gu_maskelyne-nevil_1763
482
                        //     * https://navlist.net/navigation-star-list-great-star-atlas-FrankReed-may-2024-g55881
483
                        starNumbers = {
×
484
                                  1067,   2081,   3419,   5447,   7588,  14135,  14576,  15863,  21421,  24608,
485
                                 24436,  25428,  25336,  26634,  27989,  30438,  32349,  36850,  37279,  37826,
486
                                 45238,  46390,  49669,  54061,  57632,  60718,  65474,  67301,  68702,  69673,
487
                                 71683,  72622,  74785,  76267,  78820,  80763,  84012,  86032,  91262,  97649,
488
                                100751, 102098, 109268, 113368, 113881, 113963,    677
489
                        };
×
490
                        break;
×
491
                }
492
                case Wrinkles:
×
493
                {
494
                        // 58 stars from Lecky's "Wrinkles in practical navigation", 1884
495
                        // References:
496
                        //     * https://archive.org/details/wrinklesinpract00leckgoog/page/456/mode/2up
497
                        starNumbers = {
×
498
                                   677,   1067,   3179,   3419,   5447,  11767,   7588,   9884,  14135,  15863,
499
                                 21421,  24608,  24436,  25428,  25930,  26311,  26634,  27366,  27989,  30438,
500
                                 32349,  33579,  36850,  37279,  37826,  45556,  46390,  49669,  50583,  54061,
501
                                 57632,  58001,  60718,  63608,  65474,  67301,  68702,  69673,  71683,  72622,
502
                                 72607,  74785,  76267,  77070,  78820,  80763,  82273,  81693,  86032,  87833,
503
                                 91262,  97649, 100751, 102098, 105199, 109268, 113368, 113963
504
                        };
×
505
                        break;
×
506
                }
507
                case Russian:
×
508
                {
509
                        // 160 stars from Russian Nautical Almanac
510
                        // Original Russian name: Морской астрономический ежегодник.
511
                        starNumbers = {
×
512
                                   677,    746,   1067,   2021,   2081,   3179,   3419,          4427,   5447,   6686,
513
                                  7588,   8886,   8903,   9236,   9640,   9884,  13847,  14135,  14576,  15863,
514
                                 17702,  18246,  18532,  21421,  23015,  23875,  24436,  24608,  25336,  25428,
515
                                 25606,  25930,  25985,  26241,  26311,  26451,  26634,  26727,  27913,  27989,
516
                                 28360,  28380,  30324,  30438,  31681,  32349,  32768,  33579,  33152,  34444,
517
                                 35264,  35904,  36188,  36850,  37279,  37826,  39429,  39757,  39953,  41037,
518
                                 42913,  44816,  45238,  45556,  46390,  46701,  49669,  50583,  52419,  52727,
519
                                 53910,  54061,  54872,  57632,  58001,  59196,  59747,  59774,  59803,  60718,
520
                                 61084,  61359,  61585,  61932,  61941,  62434,  62956,  63121,  63608,  65109,
521
                                 65378,  65474,  66657,  67301,  67927,  68002,  68702,  68933,  69673,  71075,
522
                                 71352,  71681,  71860,  72105,  72622,  72607,  73273,  74946,  74785,  76297,
523
                                 76267,  77070,  78401,  78820,  79593,  80331,  80763,  80816,  81266,  81377,
524
                                 81693,  82273,  82396,  83081,  84012,  85258,  85792,  85670,  85927,  86032,
525
                                 86228,  79540,  86742,  87833,  88635,  89931,  90185,  90496,  91262,  95347,
526
                                 93506,  93747,  94141,  97165,  97278,  97649, 100453, 100751, 102098, 102488,
527
                                105199, 107315, 107556, 109268, 110130, 112122, 113368, 113881, 113963,  11767
528
                        };
×
529
                        break;
×
530
                }
531
                case USSRAvia:
×
532
                {
533
                        // The typical set of Soviet aviation navigational stars
534
                        starNumbers = {
×
535
                                   677,  11767,  62956,  49669, 102098, 113368,  80763,  37826,  65474,  27989,
536
                                 21421,  97649,  37279,  24436,  69673,  24608,  91262,  32349,  30438,   7588,
537
                                 71683,  62434,  82273,  90185, 100751,   9884
538
                        };
×
539
                        break;
×
540
                }
541
                case USSRSpace:
×
542
                {
543
                        // The set of navigational stars from Soviet and Russian manned space programs
544
                        starNumbers = {
×
545
                                   677,    746,   1067,   2021,   2081,   3179,   3419,   4427,   5447,   7588,
546
                                  8903,   6686,  11767,   9640,   9884,  10826,  14135,  14576,  15863,  17702,
547
                                 18246,  18532,  21421,  23015,  23875,  24436,  24608,  25336,  25428,  25606,
548
                                 25930,  25985,  26241,  26311,  26451,  26634,  26727,  27366,  27989,  28360,
549
                                 28380,  30324,  30438,  31681,  32349,  32768,  33579,  34444,  35264,  35904,
550
                                 36850,  37279,  37826,  39429,  39757,  39953,  41037,  42913,  44816,  45238,
551
                                 45941,  45556,  46390,  49669,  50583,  52727,  53910,  54061,  54872,  57632,
552
                                 57757,  58001,  59196,  59774,  59803,  60718,  61084,  61359,  61585,  61932,
553
                                 62434,  62956,  63125,  63608,  65109,  65378,  65474,  66657,  67301,  67927,
554
                                 68702,  68756,  68933,  69673,  71075,  71352,  71683,  71860,  72105,  72622,
555
                                 73273,  72607,  74785,  76297,  76267,  77070,  78265,  78401,  78820,  80112,
556
                                 80331,  80763,  80816,  81266,  81693,  82273,  82396,  84012,  84345,  85258,
557
                                 85792,  85670,  85927,  86032,  86228,  86670,  86742,  87833,  89931,  90185,
558
                                 90496,  91262,  92855,  93506,  95947,  97165,  97278,  97649, 100453, 100751,
559
                                102098, 102488, 105199, 107315, 107556, 109268, 110130, 112122, 113368, 113881,
560
                                113963
561
                        };
×
562
                        break;
×
563
                }
564
                case German:
×
565
                {
566
                        // 80 stars from German Nautical Almanac
567
                        // Original German name: Nautisches Jahrbuch
568
                        // The numbers are identical to the "Nautisches Jahrbuch"
569
                        starNumbers = {
×
570
                                   677,   1067,   2081,   3179,   3419,   4427,   5447,   7588,  11767,   9640,
571
                                  9884,  14135,  14576,  15863,  17702,  21421,  24436,  24608,  25336,  25428,
572
                                 26311,  26727,  27366,  27989,  28360,  30324,  30438,  31681,  32349,  33579,
573
                                 34444,  36850,  37279,  37826,  41037,  44816,  45238,  46390,  49669,  52419,
574
                                 54061,  57632,  60718,  61084,  62434,  62956,  63608,  65378,  65474,  67301,
575
                                 68702,  68933,  69673,  71683,  72105,  72622,  72607,  74785,  76267,  77070,
576
                                 80763,  82273,  82396,  85927,  86032,  86228,  87833,  90185,  91262,  92855,
577
                                 97649, 100751, 102098, 105199, 107315, 109268, 112122, 113368, 113881, 113963
578
                        };
×
579
                        break;
×
580
                }
581
                case GeminiAPS:
×
582
                {
583
                        // Gemini Alignment Star List
584
                        // Source: Gemini Users Manual, Level 4, René Görlich et. al., April 2006
585
                        starNumbers = {
×
586
                                   677,   1067,   3419,   5447,   7588,   9884,  11767,  14135,  15863,  18543,
587
                                 21421,  24436,  24608,  27989,  30438,  32349,  36850,  37279,  37826,  46390,
588
                                 49669,  54061,  54872,  57632,  59803,  60718,  63608,  65378,  65474,  68702,
589
                                 69673,  71683,  72603,  77070,  80763,  80816,  85927,  86032,  90185,  91262,
590
                                 92855,  95947,  97649, 102098, 106278, 107315, 109074, 113368, 113963
591
                        };
×
592
                        break;
×
593
                }
594
                case MeadeLX200:
×
595
                {
596
                        // Meade LX200 Alignment Star Library
597
                        // Source:
598
                        //    Meade Instruction Manual
599
                        //    7" LX200 Maksutov-Cassegrain Telescope
600
                        //    8", 10", and 12" LX200 Schmidt-Cassegrain Telescopes
601
                        // HIP 28380 = Bogardus
602
                        starNumbers = {
×
603
                                  7588,  60718,  95947,  67301,  21421,  26311,  46390,  76267,  97649,  80763,
604
                                 69673,  27989,  28380,  30438,  24608,  36850, 102098,  57632,   3419, 107315,
605
                                113368,  68702,   9884, 113963,  10826,  11767,  37826,  37279,  49669,  24436,
606
                                 32349,  65474,  91262
607
                        };
×
608
                        break;
×
609
                }
610
                case MeadeETX:
×
611
                {
612
                        // Meade ETX Alignment Star Library
613
                        // Source:
614
                        //    Meade Instruction Manual
615
                        //    ETX-90EC Astro Telescope
616
                        //    ETX-105EC Astro Telescope
617
                        //    ETX-125EC Astro Telescope
618
                        starNumbers = {
×
619
                                 69673,  49669,  65474,  91262, 102098,  97649,  80763, 113963, 113368,  10826,
620
                                 24436,  27989,  32349,  21421
621
                        };
×
622
                        break;
×
623
                }
624
                case MeadeAS494:
×
625
                {
626
                        // Meade Autostar #494 Alignment Stars
627
                        // Source:
628
                        //    http://www.weasner.com/etx/autostar/as_494align_stars.html
629
                        starNumbers = {
×
630
                                 13847,   7588,  60718,  33579,  95947,  65477,  17702,  21421, 105199,   1067,
631
                                 50583,  14576,  31681,  62956,  67301,   9640, 109268,  25428,  26311,  26727,
632
                                 46390,  76267,    677,  98036,  97649,   2081,  80763,  69673,  25985,  25336,
633
                                 27989,  30438,  24608,  36850,  63125, 102098,  57632,   3419,  54061, 107315,
634
                                 87833, 113368,  68702,   9884,  72105,  90185,  72607, 113963,  59774,  13954,
635
                                 53910,  25930,  10826,   5447,  15863,  65378,  25606,  92855,  58001,  37826,
636
                                 37279,  84345,  86032,  49669,  24436, 109074,  27366, 113881,  85927,   3179,
637
                                 32349,  65474,  97278,  68756,  77070,  91262,  63608
638
                        };
×
639
                        break;
×
640
                }
641
                case MeadeAS497:
×
642
                {
643
                        // Meade Autostar #497 Alignment Stars
644
                        // Source:
645
                        //    http://www.weasner.com/etx/autostar/as_497align_stars.html
646
                        starNumbers = {
×
647
                                 13847,   7588,  60718,  33579,  95947,  65477,  17702,  21421, 105199,   1067,
648
                                 50583,  14576,  31681,  62956,  67301,   9640, 109268,  25428,  26311,  26727,
649
                                 46390,  76267,    677,  98036,  97649,   2081,  80763,  69673,  25985,  25336,
650
                                 27989,  30438,  24608,  36850,  63125, 102098,  57632,   3419,  54061, 107315,
651
                                 87833, 113368,  68702,   9884,  72105,  90185,  72607, 113963,  59774,  13954,
652
                                 53910,  25930,  10826,   5447,  15863,  65378,  25606,  92855,  58001,  11767,
653
                                 37826,  37279,  84345,  86032,  49669,  24436, 109074,  27366, 113881,  85927,
654
                                  3179,  32349,  65474,  97278,  68756,  77070,  91262,  63608
655
                        };
×
656
                        break;
×
657
                }
658
                case CelestronNS:
×
659
                {
660
                        // Celestron NexStar Alignment Star List
661
                        // Source: https://www.celestron.com/blogs/knowledgebase/can-all-named-stars-listed-in-the-hand-control-be-used-for-alignment
662
                        starNumbers = {
×
663
                                 32349,  30438,  69673,  91262,  24608,  24436,  37279,   7588,  27989,  68702,
664
                                 97649,  21421,  65474,  80763,  37826, 113368,  60718,  62434,  71683, 102098,
665
                                 49669,  33579,  25336,  61084,  85927,  26311,  25428,  45238, 109268,  15863,
666
                                 34444,  39953,  54061,  62956,  28360,  31681,  41037,  67301,  82273,  86228,
667
                                 90185, 100751,   3419,   9884,  11767,  30324,  36850,  46390,    677,   5447,
668
                                 14576,  26727,  27366,  57632,  72607,  68933,  86032,  92855,   3179,  25930,
669
                                 44816,  61932,  76267,  87833, 100453,    746,   9640,  66811,  80404,  65378,
670
                                 78401,   2081,  53910,  58001,  84012, 105199, 107315, 113881,   4427,  14135,
671
                                 35904, 113963
672
                        };
×
673
                        break;
×
674
                }
675
                case Apollo:
×
676
                {
677
                        // Apollo Alignment Star List (37 stars)
678
                        // Sources: https://www.nasa.gov/history/alsj/alsj-AOTNavStarsDetents.html
679
                        //          https://www.spaceartifactsarchive.com/2013/05/the-star-chart-of-apollo.html
680
                        starNumbers = {
×
681
                                   677,   3419,   4427,   7588,  11767,  13847,  14135,      0,             0,  15863,
682
                                 21421,  24436,  24608,  30438,  32349,  37279,         39953,      0,      0,  44127,
683
                                 46390,  49669,  57632,  59803,         60718,  65474,  67301,      0,      0,  68933,
684
                                 69673,  76267,         80763,  82273,  86032,         91262,  92855,      0,      0,  97649,
685
                                100345, 100751,        102098, 107315, 113368
686
                        };
×
687
                        break;
×
688
                }
689
                case SkywatcherSS:
×
690
                {
691
                        // Skywatcher SynScan Hand Held Controller and SynScan Pro mobile and desktop App
692
                        // Sources: https://www.iceinspace.com.au/63-501-0-0-1-0.html
693
                        //          https://www.iceinspace.com.au/download.php?10d72300ac5d3762f0529eb11977fb68
694
                        starNumbers  = { 
×
695
                                 13847,  33579,  95947,  67301,  17702,  21421, 105199,  15863,  50583,  14576,
696
                                 31681,  62956,  62956,   9640,  25428,  26311,  26727,  81266,  46390,  76267,
697
                                   677,  97649,  35904,   2081,  80763,  69673,  25985,  23015,  25336,  27989,
698
                                 28380,  24608,    746,  36850, 102098,  57632,   3419,  78401,  54061, 107315,
699
                                 87833,  81377, 113368,  78159, 102488,  36188,   9884,  23015,  72105,  90185,
700
                                 72607,   4427, 113963,  32246,  59774,  28360,  14135,  53910,  59316,  25930,
701
                                 10826,   5447,  15863,  65378,  30324,  39429,  92855,  58001,  11767,  37826,
702
                                 37279,  28437,  84345,  47908,  86032,  49669,  24436, 109074,  27366,  86228,
703
                                113881,   8903,  85927,   3179,  32349,  65474,  97278,  77070,  91262,  34444,
704
                                 79593
705
                        };
×
706
                        break;
×
707
                }
708
                case VixenSB:
×
709
                {
710
                        // Vixen Starbook mounts
711
                        // Source: https://www.skysafariastronomy.com/repositories/skylist/Alignment%20Star%20Lists/Vixen%20Starbook%20Alignment%20Stars.skylist
712
                        starNumbers  = {
×
713
                                  7588,  60718,  95947,  21421, 100027, 109268,  46390,    677,  97649,  80763,
714
                                 69673, 100345,  27989,  30438,  24608, 102098,  57632,   3419,  54061, 113368,
715
                                  9884, 113963,   8832,  10826,  15863,  65378,  92855,  11767,  37826,  37279,
716
                                 84345,  86032,  49669,  71683,   3179,  65474,  44816,  91262
717
                        };
×
718
                        break;
×
719
                }
720
                case ArgoNavis:
×
721
                {
722
                        // Argo Navis digital setting circles
723
                        // Source: https://www.skysafariastronomy.com/repositories/skylist/Alignment%20Star%20Lists/Argo%20Alignment%20Stars.skylist
724
                        starNumbers  = {
×
725
                                   677,  97649,  24608,  69673,  32349,  37279,  30438,   4427,  68702,  60718,
726
                                 62434,  95947,   7588,  36850,  37826, 109268,  46390,  49669,  57632,  91262,
727
                                 86032,  27989,  24436,  15863, 113368,  80763,  21421,  54061,  65378,  11767,
728
                                 44816,  65474, 102098,  90185,  71683
729
                        };
×
730
                        break;
×
731
                }
732
                case OrionIS:
×
733
                {
734
                        // Orion Intelliscope mounts
735
                        // Source: https://www.skysafariastronomy.com/repositories/skylist/Alignment%20Star%20Lists/Orion%20Intelliscope%20Alignment%20Stars.skylist
736
                        starNumbers  = {
×
737
                                 95947,  21421,  46390,    677,  97649,  80763,  69673,  27989,  24608,  36850,
738
                                102098,  57632, 113368,  15863,  65378,  11767,  37279,  86032,  49669,  24436,
739
                                 32349,  65474,  91262
740
                        };
×
741
                        break;
×
742
                }
743
                case SkyCommander:
×
744
                {
745
                        // Sky Commander DSCs
746
                        // Source: https://www.skysafariastronomy.com/repositories/skylist/Alignment%20Star%20Lists/Sky%20Commander%20Alignment%20Stars.skylist
747
                        starNumbers  = {
×
748
                                 11767,   3179,   3419,   5447,   9884,  14576,  15863,  18543,  21421,  24436,
749
                                 24608,  27989,  32349,  37279,  37826,  44127,  46390,  49669,  50372,  54872,
750
                                 58001,  63125,  65474,  67301,  69673,  73555,  74785,  80763,  81693,  86032,
751
                                 91262,  97649, 100453, 102098, 107315, 112158, 113368
752
                        };
×
753
                        break;
×
754
                }
755
        }
756

757
        setNavStarsMarks(currentState);
×
758
}
×
759

760
void NavStars::addExtraInfo(StelCore *core)
×
761
{
762
        if (0 == stars.size() || "Earth" != core->getCurrentPlanet()->getEnglishName()) 
×
763
                return;
×
764

765
        StelApp& stelApp = StelApp::getInstance();
×
766
        bool isSource = stelApp.getStelObjectMgr().getWasSelected();
×
767

768
        if (isSource) 
×
769
        {
770
                bool doExtraInfo = true;
×
771
                StelObjectP selectedObject = stelApp.getStelObjectMgr().getSelectedObject()[0];
×
772
                if (limitInfoToNavStars) 
×
773
                {
774
                        doExtraInfo = false;
×
775
                        if(selectedObject->getType() == QStringLiteral("Star"))
×
776
                        {
777
                                for (QVector<StelObjectP>::const_iterator itor = stars.constBegin();
×
778
                                        itor != stars.constEnd();
×
779
                                        ++itor)
×
780
                                {
781
                                        StelObjectP p = *itor;
×
782
                                        if (!p.isNull() && p->getEnglishName() == selectedObject->getEnglishName())
×
783
                                        {
784
                                                doExtraInfo = true;
×
785
                                                break;
×
786
                                        }
787
                                }
×
788
                        }
789
                        else
790
                        {
791
                                QString englishName = selectedObject->getEnglishName();
×
792
                                if (isPermittedObject(englishName))
×
793
                                {
794
                                        doExtraInfo = true;
×
795
                                }
796
                        }
×
797
                }
798
                if (doExtraInfo)
×
799
                        extraInfo(core, selectedObject);
×
800
        }
×
801
}
802

803
void NavStars::extraInfo(StelCore* core, const StelObjectP& selectedObject)
×
804
{
805
        double jd, jde, x = 0., y = 0.;
×
806
        QString extraText = "", englishName = selectedObject->getEnglishName();
×
807

808
        jd  = core->getJD();
×
809
        jde = core->getJDE();
×
810

811
        NavStarsCalculator calc;
×
812
        calc.setUTC(StelUtils::julianDayToISO8601String(jd))
×
813
                .setLatDeg(core->getCurrentLocation().getLatitude())
×
814
                .setLonDeg(core->getCurrentLocation().getLongitude())
×
815
                .setJd(jd)
×
816
                .setJde(jde)
×
817
                .setGmst(get_mean_sidereal_time(jd, jde));
×
818

819
        StelUtils::rectToSphe(&x, &y, selectedObject->getEquinoxEquatorialPos(core));        
×
820
        calc.setRaRad(x).setDecRad(y);
×
821

822
        StelUtils::rectToSphe(&x,&y,selectedObject->getAltAzPosGeometric(core)); 
×
823
        calc.setAzRad(x).setAltRad(y);
×
824

825
        StelUtils::rectToSphe(&x,&y,selectedObject->getAltAzPosApparent(core)); 
×
826
        calc.setAzAppRad(x).setAltAppRad(y);
×
827

828
        calc.execute();
×
829

830
        if ("Sun" == englishName || "Moon" == englishName) 
×
831
        {
832
                // Adjust Ho if target is Sun or Moon by adding/subtracting the angular radius.
833
                double obj_radius_in_degrees = selectedObject->getAngularRadius(core);
×
834
                if (!upperLimb)
×
835
                        obj_radius_in_degrees *= -1;
×
836
                calc.addAltAppRad((obj_radius_in_degrees * M_PI) / 180.);
×
837
                extraText = upperLimb ?
×
838
                        " (" + QString(qc_("upper limb", "the highest part of the Sun or Moon")) + ")" :
×
839
                        " (" + QString(qc_("lower limb", "the lowest part of the Sun or Moon")) + ")";
×
840
        }
841

842
        if (tabulatedDisplay)
×
843
                displayTabulatedInfo(selectedObject, calc, extraText);
×
844
        else
845
                displayStandardInfo(selectedObject, calc, extraText);
×
846
}
×
847

848
void NavStars::displayStandardInfo(const StelObjectP& selectedObject, NavStarsCalculator& calc, const QString& extraText)
×
849
{
850
        Q_UNUSED(extraText)        
851
        QString temp;
×
852
        StelObject::InfoStringGroup infoGroup = StelObject::OtherCoord;
×
853
        selectedObject->addToExtraInfoString(infoGroup, 
×
854
                oneRowTwoCells(qc_("GHA", "Greenwich Hour Angle") + "&#9800;", calc.gmstPrintable(), "", false));
×
855
        selectedObject->addToExtraInfoString(infoGroup, 
×
856
                oneRowTwoCells(qc_("SHA", "object Sidereal Hour Angle (ERA, Earth rotation angle)"), calc.shaPrintable(), "", false));
×
857
        selectedObject->addToExtraInfoString(infoGroup, 
×
858
                oneRowTwoCells(qc_("LHA", "Local Hour Angle"), calc.lhaPrintable(), "", false));
×
859
        temp = calc.ghaPrintable() + "/" + calc.decPrintable();
×
860
        selectedObject->addToExtraInfoString(infoGroup, 
×
861
                oneRowTwoCells(qc_("GP: GHA/DEC", "Ground Position of object"), temp, "", false));
×
862
        temp = calc.gplatPrintable() + "/" + calc.gplonPrintable();
×
863
        selectedObject->addToExtraInfoString(infoGroup, 
×
864
                oneRowTwoCells(qc_("GP: LAT/LON", "geodetic coordinate system, latitude and longitude of ground point"), temp, "", false));
×
865
        temp = calc.latPrintable() + "/" + calc.lonPrintable();
×
866
        selectedObject->addToExtraInfoString(infoGroup, 
×
867
                oneRowTwoCells(qc_("AP: LAT/LON", "geodetic coordinate system, assumed latitude and longitude of user"), temp, "", false));
×
868
        temp = calc.hcPrintable() + "/" + calc.znPrintable();
×
869
        selectedObject->addToExtraInfoString(infoGroup, 
×
870
                oneRowTwoCells(qc_("Hc/Zn", "Navigation/horizontal coordinate system, calculated altitude and azimuth"), temp, "", false));
×
871
}
×
872

873
void NavStars::displayTabulatedInfo(const StelObjectP& selectedObject, NavStarsCalculator& calc, const QString& extraText)
×
874
{
875
        StelObject::InfoStringGroup infoGroup = StelObject::OtherCoord;                
×
876
        selectedObject->addToExtraInfoString(infoGroup, 
×
877
                oneRowTwoCells(qc_("UTC", "Universal Time Coordinated"), calc.getUTC(), "", false));
×
878
        selectedObject->addToExtraInfoString(infoGroup, "<table style='margin:0em 0em 0em -0.125em;border-spacing:0px;border:0px;'>");
×
879
        selectedObject->addToExtraInfoString(infoGroup, 
×
880
                oneRowTwoCells(qc_("Ho", "Navigation/horizontal coordinate system, sextant measured altitude"), calc.altAppPrintable(), extraText, true));
×
881
        selectedObject->addToExtraInfoString(infoGroup, 
×
882
                oneRowTwoCells(qc_("GHA", "Greenwich Hour Angle") + "&#9800;", calc.gmstPrintable(), "", true));
×
883
        selectedObject->addToExtraInfoString(infoGroup, 
×
884
                oneRowTwoCells(qc_("LMST", "Local Hour Angle"), calc.lmstPrintable(), "", true));
×
885
        selectedObject->addToExtraInfoString(infoGroup, 
×
886
                oneRowTwoCells(qc_("SHA", "object Sidereal Hour Angle (ERA, Earth rotation angle)"), calc.shaPrintable(), "", true));
×
887
        selectedObject->addToExtraInfoString(infoGroup, 
×
888
                oneRowTwoCells(qc_("GHA", "Greenwich Hour Angle"), calc.ghaPrintable(), "", true));
×
889
        selectedObject->addToExtraInfoString(infoGroup, 
×
890
                oneRowTwoCells(qc_("DEC", "Declination"), calc.decPrintable(), "", true));
×
891
        selectedObject->addToExtraInfoString(infoGroup, 
×
892
                oneRowTwoCells(qc_("LHA", "Local Hour Angle"), calc.lhaPrintable(), "", true));
×
893
        selectedObject->addToExtraInfoString(infoGroup, 
×
894
                oneRowTwoCells(qc_("LAT", "geodetic coordinate system, latitude"), calc.gplatPrintable(), "", true));
×
895
        selectedObject->addToExtraInfoString(infoGroup, 
×
896
                oneRowTwoCells(qc_("LON", "geodetic coordinate system, longitude"), calc.gplonPrintable(), "", true));
×
897
        selectedObject->addToExtraInfoString(infoGroup, 
×
898
                oneRowTwoCells(qc_("Hc", "Navigation/horizontal coordinate system, calculated altitude"), calc.hcPrintable(), "", true));
×
899
        selectedObject->addToExtraInfoString(infoGroup, 
×
900
                oneRowTwoCells(qc_("Zn", "Navigation/horizontal coordinate system, calculated azimuth"), calc.znPrintable(), "", true));
×
901
        selectedObject->addToExtraInfoString(infoGroup, "</table>");
×
902
}
×
903

904
QString NavStars::oneRowTwoCells(const QString& a, const QString& b, const QString &extra, bool tabulatedView)
×
905
{
906
        QString rval;
×
907
        if (tabulatedView)
×
908
                rval += QString("<tr><td>%1:</td><td style='text-align:right;'>%2</td><td>%3</td></tr>").arg(a, b, extra);
×
909
        else
910
                rval += QString("%1: %2 %3<br />").arg(a, b, extra);
×
911
        return rval;
×
912
}
×
913

914
bool NavStars::isPermittedObject(const QString& s)
×
915
{
916
        static const QStringList permittedObjects= {"Sun", "Moon", "Venus", "Mars", "Jupiter", "Saturn"};
×
917
        return permittedObjects.contains(s);
×
918
}
×
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