10#include "modcalcgeodcoord.h"
11#include "modcalcgalcoord.h"
12#include "modcalcsidtime.h"
13#include "modcalcapcoord.h"
14#include "modcalcdaylength.h"
15#include "modcalcaltaz.h"
16#include "modcalcsimple.h"
17#include "modcalcplanets.h"
18#include "modcalceclipticcoords.h"
19#include "modcalcangdist.h"
20#include "modcalcvizequinox.h"
21#include "modcalcvlsr.h"
22#include "conjunctions.h"
23#include "eclipsetool.h"
25#include <QDialogButtonBox>
27#include <QStackedWidget>
30#include <QTreeWidgetItem>
40 "<H2>KStars Astrocalculator</H2>"
42 "The KStars Astrocalculator contains several <B>modules</b> "
43 "which perform a variety of astronomy-related calculations. "
44 "The modules are organized into several categories: "
46 "<LI><B>Time calculators: </B>"
47 "Convert between time systems, and predict the timing of celestial events</LI>"
48 "<LI><B>Coordinate converters: </B>"
49 "Convert between various coordinate systems</LI>"
50 "<LI><B>Solar system: </B>"
51 "Predict the position of any planet, from a given location on Earth at a given time</LI>"
55 "Section which includes algorithms for computing time ephemeris"
57 "<B>Julian Day:</B> Julian Day/Calendar conversion"
59 "<B>Sidereal Time:</B> Sidereal/Universal time conversion"
61 "<B>Almanac:</B> Rise/Set/Transit timing and position data "
62 "for the Sun and Moon"
64 "<B>Equinoxes & Solstices:</B> Equinoxes, Solstices and duration of the "
69 "Section with algorithms for the conversion of "
70 "different astronomical systems of coordinates"
72 "<B>Galactic:</B> Galactic/Equatorial coordinates conversion"
74 "<B>Apparent:</B> Computation of current equatorial coordinates"
77 "<B>Ecliptic:</B> Ecliptic/Equatorial coordinates conversion"
79 "<B>Horizontal:</B> Computation of azimuth and elevation for a "
80 "given source, time, and location on the Earth"
82 "<B>Simple:</B> Conversion between angles in hrs and degrees."
84 "<B>Angular Distance:</B> Computation of angular distance between "
85 "two objects whose positions are given in equatorial coordinates"
87 "<B>Geodetic Coords:</B> Geodetic/XYZ coordinate conversion"
89 "<B>LSR Velocity:</B> Computation of the heliocentric, geocentric "
90 "and topocentric radial velocity of a source from its LSR velocity"
94 "Section with algorithms regarding information "
95 "on solar system bodies coordinates and times"
97 "<B>Planets Coords:</B> Coordinates for the planets, moon and sun "
98 "at a given time and from a given position on Earth "
106 setLayout(mainLayout);
110 connect(buttonBox, SIGNAL(rejected()),
this, SLOT(reject()));
112 setWindowTitle(
i18nc(
"@title:window",
"Calculator"));
116 navigationPanel->setColumnCount(1);
117 navigationPanel->setHeaderLabels(
QStringList(
i18n(
"Calculator modules")));
118 navigationPanel->setSortingEnabled(
false);
121 navigationPanel->setMinimumWidth(200);
125 splashScreen =
new QTextEdit(message, acStack);
126 splashScreen->setReadOnly(
true);
130 splashScreen->setMinimumSize(640, 550);
131 acStack->addWidget(splashScreen);
144 QTreeWidgetItem *timeItem = addTreeTopItem(navigationPanel,
i18n(
"Time Calculators"), messageTime);
148 addTreeItem<modCalcJD>(timeItem,
i18n(
"Julian Day"));
149 addTreeItem<modCalcSidTime>(timeItem,
i18n(
"Sidereal Time"));
150 addTreeItem<modCalcDayLength>(timeItem,
i18n(
"Almanac"));
151 addTreeItem<modCalcEquinox>(timeItem,
i18n(
"Equinoxes & Solstices"));
155 QTreeWidgetItem *coordItem = addTreeTopItem(navigationPanel,
i18n(
"Coordinate Converters"), messageCoord);
156 addTreeItem<modCalcGalCoord>(coordItem,
i18n(
"Equatorial/Galactic"));
157 addTreeItem<modCalcApCoord>(coordItem,
i18n(
"Apparent Coordinates"));
158 addTreeItem<modCalcAltAz>(coordItem,
i18n(
"Horizontal Coordinates"));
159 addTreeItem<modCalcSimple>(coordItem,
i18n(
"Simple Coordinates"));
160 addTreeItem<modCalcEclCoords>(coordItem,
i18n(
"Ecliptic Coordinates"));
161 addTreeItem<modCalcAngDist>(coordItem,
i18n(
"Angular Distance"));
162 addTreeItem<modCalcGeodCoord>(coordItem,
i18n(
"Geodetic Coordinates"));
163 addTreeItem<modCalcVlsr>(coordItem,
i18n(
"LSR Velocity"));
166 QTreeWidgetItem *solarItem = addTreeTopItem(navigationPanel,
i18n(
"Solar System"), messageSolar);
168 addTreeItem<modCalcPlanets>(solarItem,
i18n(
"Planets Coordinates"));
169 addTreeItem<ConjunctionsTool>(solarItem,
i18n(
"Conjunctions"));
170 addTreeItem<EclipseTool>(solarItem,
i18n(
"Eclipses"));
172 acStack->setCurrentWidget(splashScreen);
178QWidget *AstroCalc::addToStack()
180 T *t =
new T(acStack);
189 dispatchTable.
insert(item, WidgetThunk(
this, &AstroCalc::addToStack<T>));
197 htmlTable.
insert(item, html);
207 if (iterHTML != htmlTable.
end())
209 splashScreen->
setHtml(*iterHTML);
215 if (iter != dispatchTable.
end())
223 return QSize(640, 430);
226QWidget *AstroCalc::WidgetThunk::eval()
228 if (widget ==
nullptr)
231 widget = (calc->*func)();
QSize sizeHint() const override
void slotItemSelection(QTreeWidgetItem *it)
Display calculator module or help text based on item selected.
QString i18nc(const char *context, const char *text, const TYPE &arg...)
QString i18n(const char *text, const TYPE &arg...)
iterator find(const Key &key)
iterator insert(const Key &key, const T &value)
QObject * parent() const const
void setHtml(const QString &text)
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)