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 <KLocalizedString>
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)
51 "Some images in KStars are for non-commercial use only. See README.images.").
toString();
54#if defined(Q_OS_ANDROID)
58int main(
int argc,
char *argv[])
60#if defined(Q_OS_LINUX) || defined(Q_OS_MACOS)
62 signal(SIGPIPE, SIG_IGN);
71 if (!KSUtils::setupMacKStarsIfNeeded())
73 KSNotification::sorry(
i18n(
"Sorry, without a KStars Data Directory, KStars "
74 "cannot operate. Exiting program now."));
78 Options::setKStarsFirstRun(
false);
79 app.setApplicationVersion(KSTARS_VERSION);
86#if defined(KSTARS_LITE)
87#if defined(__ANDROID__)
89 "kstars",
"/data/data/org.kde.kstars.lite/qt-reserved-files/share/kstars/locale");
104 QString(
"%1 %2").
arg(KSTARS_VERSION).
arg(KSTARS_BUILD_RELEASE);
108 i18n(
" (c), The KStars Team\n\nThe Gaussian Process Guider Algorithm: (c) "
109 "2014-2017 Max Planck Society"),
110 i18nc(
"Build number followed by copyright notice",
"Build: %1\n\n%2\n\n%3",
113 "Pre-release beta snapshot. Do not use in production." :
116 "https://edu.kde.org/kstars");
117 aboutData.addAuthor(
i18n(
"Jason Harris"),
i18n(
"Original Author"),
118 "jharris@30doradus.org",
"http://www.30doradus.org");
119 aboutData.addAuthor(
i18n(
"Jasem Mutlaq"),
i18n(
"Current Maintainer"),
120 "mutlaqja@ikarustech.com",
"https://www.indilib.org");
123 aboutData.addAuthor(
i18n(
"Akarsh Simha"),
QString(),
"akarsh@kde.org",
124 "http://www.ph.utexas.edu/~asimha");
125 aboutData.addAuthor(
i18n(
"Robert Lancaster"),
126 i18n(
"FITSViewer & Ekos Improvements. KStars OSX Port"),
127 "rlancaste@gmail.com");
128 aboutData.addAuthor(
i18n(
"Eric Dejouhanet"),
QString(),
"eric.dejouhanet@gmail.com",
129 i18n(
"Ekos Scheduler Improvements"));
130 aboutData.addAuthor(
i18n(
"Wolfgang Reissenberger"),
QString(),
131 "sterne-jaeger@t-online.de",
132 i18n(
"Ekos Scheduler & Observatory Improvements"));
133 aboutData.addAuthor(
i18n(
"Hy Murveit"),
QString(),
"murveit@gmail.com",
134 i18n(
"FITS, Focus, Guide Improvements"));
135 aboutData.addAuthor(
i18n(
"John Evans"),
QString(),
"john.e.evans.email@gmail.com",
136 i18n(
"Focus algorithms"));
139 aboutData.addAuthor(
i18n(
"Csaba Kertesz"),
QString(),
"csaba.kertesz@gmail.com",
"");
140 aboutData.addAuthor(
"Valentin Boettcher",
QString(),
"hiro@protagon.space",
141 i18n(
"Binary Asteroid List, DSO Database & Catalogs"));
142 aboutData.addAuthor(
i18n(
"Artem Fedoskin"),
i18n(
"KStars Lite"),
143 "afedoskin3@gmail.com");
144 aboutData.addAuthor(
i18n(
"James Bowlin"),
QString(),
"bowlin@mindspring.com");
145 aboutData.addAuthor(
i18n(
"Pablo de Vicente"),
QString(),
"pvicentea@wanadoo.es");
146 aboutData.addAuthor(
i18n(
"Thomas Kabelmann"),
QString(),
"tk78@gmx.de");
147 aboutData.addAuthor(
i18n(
"Heiko Evermann"),
QString(),
"heiko@evermann.de",
148 "https://www.evermann.de");
149 aboutData.addAuthor(
i18n(
"Carsten Niehaus"),
QString(),
"cniehaus@gmx.de");
150 aboutData.addAuthor(
i18n(
"Mark Hollomon"),
QString(),
"mhh@mindspring.com");
151 aboutData.addAuthor(
i18n(
"Alexey Khudyakov"),
QString(),
"alexey.skladnoy@gmail.com");
152 aboutData.addAuthor(
i18n(
"Médéric Boquien"),
QString(),
154 aboutData.addAuthor(
i18n(
"Jérôme Sonrier"),
QString(),
155 "jsid@emor3j.fr.eu.org");
156 aboutData.addAuthor(
i18n(
"Prakash Mohan"),
QString(),
"prakash.mohan@kdemail.net");
157 aboutData.addAuthor(
i18n(
"Victor Cărbune"),
QString(),
"victor.carbune@kdemail.net");
158 aboutData.addAuthor(
i18n(
"Henry de Valence"),
QString(),
"hdevalence@gmail.com");
159 aboutData.addAuthor(
i18n(
"Samikshan Bairagya"),
QString(),
160 "samikshan.bairagya@kdemail.net");
161 aboutData.addAuthor(
i18n(
"Rafał Kułaga"),
QString(),
"rl.kulaga@gmail.com");
162 aboutData.addAuthor(
i18n(
"Rishab Arora"),
QString(),
"ra.rishab@gmail.com");
166 i18n(
"Valery Kharitonov"),
167 i18n(
"Converted labels containing technical terms to links to documentation"));
168 aboutData.addCredit(
i18n(
"Ana-Maria Constantin"),
169 i18n(
"Technical documentation on Astronomy and KStars"));
170 aboutData.addCredit(
i18n(
"Andrew Stepanenko"),
171 i18n(
"Guiding code based on lin_guider"));
172 aboutData.addCredit(
i18n(
"Nuno Pinheiro"),
i18n(
"Artwork"));
174 i18n(
"Utkarsh Simha"),
175 i18n(
"Improvements to observation plan execution, star hopper etc."));
176 aboutData.addCredit(
i18n(
"Daniel Holler"),
177 i18n(
"Extensive testing and suggestions for Ekos/INDI."));
179 i18n(
"Stephane Lucas"),
180 i18n(
"Extensive testing and suggestions for Ekos Scheduler. KStars OSX Port"));
181 aboutData.addCredit(
i18n(
"Yuri Fabirovsky"),
182 i18n(
"Splash screen for both regular KStars and KStars Lite."));
183 aboutData.addCredit(
i18n(
"Jamie Smith"),
i18n(
"KStars OSX Port."));
184 aboutData.addCredit(
i18n(
"Patrick Molenaar"),
i18n(
"Bahtinov Focus Assistant."));
185 aboutData.addCredit(
i18n(
"Philipp Auersperg-Castell"),
i18n(
"Supernovae daily updates"));
186 aboutData.addCredit(
i18n(
"Tony Schriber"),
i18n(
"Rotator Dialog improvements"));
187 aboutData.addCredit(
i18n(
"Joseph McGee"),
i18n(
"Sub-exposure calculator based on Dr Robin Glover's work"));
192 aboutData.setupCommandLine(&parser);
205 QStringLiteral(
"[urls...]"));
208 aboutData.processCommandLine(&parser);
210 if (parser.
isSet(
"dump"))
212 qCDebug(KSTARS) <<
"Dumping sky image";
215 const char *format =
"PNG";
226 else if (ext.
toLower() ==
"gif")
230 else if (ext.
toLower() ==
"pnm")
234 else if (ext.
toLower() ==
"bmp")
240 qCWarning(KSTARS) <<
i18n(
"Could not parse image format of %1; assuming PNG.",
252 qCWarning(KSTARS) <<
"Unable to parse arguments Width: "
253 << parser.
value(
"width")
254 <<
" Height: " << parser.
value(
"height");
260 SLOT(slotConsoleMessage(
QString)));
291 kdt = dat->
geo()->LTtoUT(
297 qCWarning(KSTARS) <<
i18n(
298 "Supplied date string is invalid: %1. Using CPU date/time instead.",
317 SkyPoint dest(Options::focusRA(), Options::focusDec());
318 map->setDestination(dest);
319 map->destination()->EquatorialToHorizontal(dat->
lst(), dat->
geo()->
lat());
320 map->setFocus(
map->destination());
321 map->focus()->EquatorialToHorizontal(dat->
lst(), dat->
geo()->
lat());
329 std::cout <<
i18n(
"Script executed.").
toUtf8().
data() << std::endl;
333 qCWarning(KSTARS) <<
i18n(
"Could not execute script.");
337 qApp->processEvents();
338 map->setupProjector();
339 map->exportSkyImage(&sky);
340 qApp->processEvents();
342 if (!sky.save(fname, format))
343 qCWarning(KSTARS) <<
"Unable to save image: " << fname;
345 qCDebug(KSTARS) <<
"Saved to file: %1" << fname;
357 qWarning() <<
i18n(
"Using CPU date/time instead.");
378 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.
KLocalizedString KI18N_EXPORT ki18n(const char *text)
QString i18nc(const char *context, const char *text, const TYPE &arg...)
QString i18n(const char *text, const TYPE &arg...)
KCRASH_EXPORT void initialize()
const QList< QKeySequence > & quit()
const char * versionString()
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
QByteArray toLatin1() const const
QString toLower() const const
QByteArray toUtf8() const const
QFuture< void > map(Iterator begin, Iterator end, MapFunctor &&function)