8#include "kstars_debug.h"
10#include "kstarsdatetime.h"
11#if defined(KSTARS_LITE)
12#include "kstarslite.h"
18#if !defined(KSTARS_LITE)
23#if !defined(KSTARS_LITE)
27#include <KLazyLocalizedString>
29#if defined(Q_OS_MACOS)
30#include <ksnotification.h>
33#include <QApplication>
34#if !defined(KSTARS_LITE)
35#include <QCommandLineParser>
36#include <QCommandLineOption>
44#if defined(Q_OS_LINUX) || defined(Q_OS_MACOS)
49static const auto description = kli18n(
"Desktop Planetarium");
50static const auto notice = kli18n(
"Some images in KStars are for non-commercial use only. See README.images.");
53#if defined(Q_OS_ANDROID)
57int main(
int argc,
char *argv[])
59#if defined(Q_OS_LINUX) || defined(Q_OS_MACOS)
61 signal(SIGPIPE, SIG_IGN);
70 if (!KSUtils::setupMacKStarsIfNeeded())
72 KSNotification::sorry(
i18n(
"Sorry, without a KStars Data Directory, KStars "
73 "cannot operate. Exiting program now."));
77 Options::setKStarsFirstRun(
false);
78 app.setApplicationVersion(KSTARS_VERSION);
85#if defined(KSTARS_LITE)
86#if defined(__ANDROID__)
88 "kstars",
"/data/data/org.kde.kstars.lite/qt-reserved-files/share/kstars/locale");
103 QString(
"%1 %2").
arg(KSTARS_VERSION).
arg(KSTARS_BUILD_RELEASE);
107 i18n(
" (c), The KStars Team\n\nThe Gaussian Process Guider Algorithm: (c) "
108 "2014-2017 Max Planck Society"),
109 i18nc(
"Build number followed by copyright notice",
"Build: %1\n\n%2\n\n%3",
112 "Pre-release beta snapshot. Do not use in production." :
115 "https://edu.kde.org/kstars");
116 aboutData.addAuthor(
i18n(
"Jason Harris"),
i18n(
"Original Author"),
117 "jharris@30doradus.org",
"http://www.30doradus.org");
118 aboutData.addAuthor(
i18n(
"Jasem Mutlaq"),
i18n(
"Current Maintainer"),
119 "mutlaqja@ikarustech.com",
"https://www.indilib.org");
122 aboutData.addAuthor(
i18n(
"Akarsh Simha"),
QString(),
"akarsh@kde.org",
123 "http://www.ph.utexas.edu/~asimha");
124 aboutData.addAuthor(
i18n(
"Robert Lancaster"),
125 i18n(
"FITSViewer & Ekos Improvements. KStars OSX Port"),
126 "rlancaste@gmail.com");
127 aboutData.addAuthor(
i18n(
"Eric Dejouhanet"),
QString(),
"eric.dejouhanet@gmail.com",
128 i18n(
"Ekos Scheduler Improvements"));
129 aboutData.addAuthor(
i18n(
"Wolfgang Reissenberger"),
QString(),
130 "sterne-jaeger@t-online.de",
131 i18n(
"Ekos Scheduler & Observatory Improvements"));
132 aboutData.addAuthor(
i18n(
"Hy Murveit"),
QString(),
"murveit@gmail.com",
133 i18n(
"FITS, Focus, Guide Improvements"));
134 aboutData.addAuthor(
i18n(
"John Evans"),
QString(),
"john.e.evans.email@gmail.com",
135 i18n(
"Focus algorithms"));
138 aboutData.addAuthor(
i18n(
"Csaba Kertesz"),
QString(),
"csaba.kertesz@gmail.com",
"");
139 aboutData.addAuthor(
"Valentin Boettcher",
QString(),
"hiro@protagon.space",
140 i18n(
"Binary Asteroid List, DSO Database & Catalogs"));
141 aboutData.addAuthor(
i18n(
"Artem Fedoskin"),
i18n(
"KStars Lite"),
142 "afedoskin3@gmail.com");
143 aboutData.addAuthor(
i18n(
"James Bowlin"),
QString(),
"bowlin@mindspring.com");
144 aboutData.addAuthor(
i18n(
"Pablo de Vicente"),
QString(),
"pvicentea@wanadoo.es");
145 aboutData.addAuthor(
i18n(
"Thomas Kabelmann"),
QString(),
"tk78@gmx.de");
146 aboutData.addAuthor(
i18n(
"Heiko Evermann"),
QString(),
"heiko@evermann.de",
147 "https://www.evermann.de");
148 aboutData.addAuthor(
i18n(
"Carsten Niehaus"),
QString(),
"cniehaus@gmx.de");
149 aboutData.addAuthor(
i18n(
"Mark Hollomon"),
QString(),
"mhh@mindspring.com");
150 aboutData.addAuthor(
i18n(
"Alexey Khudyakov"),
QString(),
"alexey.skladnoy@gmail.com");
151 aboutData.addAuthor(
i18n(
"Médéric Boquien"),
QString(),
153 aboutData.addAuthor(
i18n(
"Jérôme Sonrier"),
QString(),
154 "jsid@emor3j.fr.eu.org");
155 aboutData.addAuthor(
i18n(
"Prakash Mohan"),
QString(),
"prakash.mohan@kdemail.net");
156 aboutData.addAuthor(
i18n(
"Victor Cărbune"),
QString(),
"victor.carbune@kdemail.net");
157 aboutData.addAuthor(
i18n(
"Henry de Valence"),
QString(),
"hdevalence@gmail.com");
158 aboutData.addAuthor(
i18n(
"Samikshan Bairagya"),
QString(),
159 "samikshan.bairagya@kdemail.net");
160 aboutData.addAuthor(
i18n(
"Rafał Kułaga"),
QString(),
"rl.kulaga@gmail.com");
161 aboutData.addAuthor(
i18n(
"Rishab Arora"),
QString(),
"ra.rishab@gmail.com");
165 i18n(
"Valery Kharitonov"),
166 i18n(
"Converted labels containing technical terms to links to documentation"));
167 aboutData.addCredit(
i18n(
"Ana-Maria Constantin"),
168 i18n(
"Technical documentation on Astronomy and KStars"));
169 aboutData.addCredit(
i18n(
"Andrew Stepanenko"),
170 i18n(
"Guiding code based on lin_guider"));
171 aboutData.addCredit(
i18n(
"Nuno Pinheiro"),
i18n(
"Artwork"));
173 i18n(
"Utkarsh Simha"),
174 i18n(
"Improvements to observation plan execution, star hopper etc."));
175 aboutData.addCredit(
i18n(
"Daniel Holler"),
176 i18n(
"Extensive testing and suggestions for Ekos/INDI."));
178 i18n(
"Stephane Lucas"),
179 i18n(
"Extensive testing and suggestions for Ekos Scheduler. KStars OSX Port"));
180 aboutData.addCredit(
i18n(
"Yuri Fabirovsky"),
181 i18n(
"Splash screen for both regular KStars and KStars Lite."));
182 aboutData.addCredit(
i18n(
"Jamie Smith"),
i18n(
"KStars OSX Port."));
183 aboutData.addCredit(
i18n(
"Patrick Molenaar"),
i18n(
"Bahtinov Focus Assistant."));
184 aboutData.addCredit(
i18n(
"Philipp Auersperg-Castell"),
i18n(
"Supernovae daily updates"));
185 aboutData.addCredit(
i18n(
"Tony Schriber"),
i18n(
"Rotator Dialog improvements"));
186 aboutData.addCredit(
i18n(
"Joseph McGee"),
i18n(
"Sub-exposure calculator based on Dr Robin Glover's work"));
191 aboutData.setupCommandLine(&parser);
204 QStringLiteral(
"[urls...]"));
207 aboutData.processCommandLine(&parser);
209 if (parser.
isSet(
"dump"))
211 qCDebug(KSTARS) <<
"Dumping sky image";
214 const char *format =
"PNG";
225 else if (ext.
toLower() ==
"gif")
229 else if (ext.
toLower() ==
"pnm")
233 else if (ext.
toLower() ==
"bmp")
239 qCWarning(KSTARS) <<
i18n(
"Could not parse image format of %1; assuming PNG.",
251 qCWarning(KSTARS) <<
"Unable to parse arguments Width: "
252 << parser.
value(
"width")
253 <<
" Height: " << parser.
value(
"height");
259 SLOT(slotConsoleMessage(
QString)));
290 kdt = dat->
geo()->LTtoUT(
296 qCWarning(KSTARS) <<
i18n(
297 "Supplied date string is invalid: %1. Using CPU date/time instead.",
316 SkyPoint dest(Options::focusRA(), Options::focusDec());
317 map->setDestination(dest);
318 map->destination()->EquatorialToHorizontal(dat->
lst(), dat->
geo()->
lat());
319 map->setFocus(
map->destination());
320 map->focus()->EquatorialToHorizontal(dat->
lst(), dat->
geo()->
lat());
328 std::cout <<
i18n(
"Script executed.").
toUtf8().
data() << std::endl;
332 qCWarning(KSTARS) <<
i18n(
"Could not execute script.");
336 qApp->processEvents();
337 map->setupProjector();
338 map->exportSkyImage(&sky);
339 qApp->processEvents();
341 if (!sky.save(fname, format))
342 qCWarning(KSTARS) <<
"Unable to save image: " << fname;
344 qCDebug(KSTARS) <<
"Saved to file: %1" << fname;
356 qWarning() <<
i18n(
"Using CPU date/time instead.");
377 foreach (
const QString &url, urls)
void loadFromConfig()
Read color-scheme data from the Config object.
const CachingDms * lat() const
static void setApplicationData(const KAboutData &aboutData)
static void addDomainLocaleDir(const QByteArray &domain, const QString &path)
static void setApplicationDomain(const QByteArray &domain)
KStarsData is the backbone of KStars.
void setFullTimeUpdate()
The Sky is updated more frequently than the moon, which is updated more frequently than the planets.
void updateTime(GeoLocation *geo, const bool automaticDSTchange=true)
Update the Simulation Clock.
bool initialize()
Initialize KStarsData while running splash screen.
ColorScheme * colorScheme()
bool executeScript(const QString &name, SkyMap *map)
Execute a script.
Q_INVOKABLE SimClock * clock()
void setLocationFromOptions()
Set the GeoLocation according to the values stored in the configuration file.
Extension of QDateTime for KStars KStarsDateTime can represent the date/time as a Julian Day,...
static KStarsDateTime fromString(const QString &s)
void setDate(const QDate &d)
Assign the Date according to a QDate object.
static KStarsDateTime currentDateTimeUtc()
void setTime(const QTime &t)
Assign the Time according to a QTime object.
static KStarsLite * createInstance(bool doSplash, bool clockrunning=true, const QString &startDateString=QString())
Create an instance of this class.
static KStars * Instance()
Q_SCRIPTABLE Q_NOREPLY void openFITS(const QUrl &imageUrl)
DBUS interface function.
static KStars * createInstance(bool doSplash, bool clockrunning=true, const QString &startDateString=QString())
Create an instance of this class.
Q_SCRIPTABLE Q_NOREPLY void setUTC(const KStarsDateTime &newtime)
DBUS function to set the time of the SimClock.
This is the canvas on which the sky is painted.
The sky coordinates of a point in the sky.
QString i18nc(const char *context, const char *text, const TYPE &arg...)
QString i18n(const char *text, const TYPE &arg...)
KCOREADDONS_EXPORT QString versionString()
KCRASH_EXPORT void initialize()
const QList< QKeySequence > & quit()
bool addOption(const QCommandLineOption &option)
void addPositionalArgument(const QString &name, const QString &description, const QString &syntax)
bool isSet(const QCommandLineOption &option) const const
QStringList positionalArguments() const const
void process(const QCoreApplication &app)
void setApplicationDescription(const QString &description)
QString value(const QCommandLineOption &option) const const
void setAttribute(Qt::ApplicationAttribute attribute, bool on)
QDate fromString(QStringView string, QStringView format, QCalendar cal)
QDateTime fromString(QStringView string, QStringView format, QCalendar cal)
bool isValid() const const
bool mkdir(const QString &dirName) const const
bool mkpath(const QString &dirPath) const const
bool isEmpty() const const
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
QString arg(Args &&... args) const const
bool contains(QChar ch, Qt::CaseSensitivity cs) const const
bool isEmpty() const const
qsizetype lastIndexOf(QChar ch, Qt::CaseSensitivity cs) const const
QString mid(qsizetype position, qsizetype n) const const
QString number(double n, char format, int precision)
int toInt(bool *ok, int base) const const
QString toLower() const const
QByteArray toUtf8() const const
QFuture< void > map(Iterator begin, Iterator end, MapFunctor &&function)