diff --git a/guide/ch_astronomical_concepts.tex b/guide/ch_astronomical_concepts.tex index cdee39a54a92e..0313215b200d6 100644 --- a/guide/ch_astronomical_concepts.tex +++ b/guide/ch_astronomical_concepts.tex @@ -270,6 +270,7 @@ \subsection{Ecliptical Coordinates} The Earth's orbit around the Sun, i.e., the \indexterm{ecliptic}, defines the ``equatorial line'' of this coordinate system, which is traditionally used when computing the coordinates for planets because of their close proximity to this line. +Mirroring Earth's motion, the Sun is seen to move along the ecliptic. The zero point of \indexterm{ecliptical longitude} $\lambda$ is the same as for equatorial coordinates (\Aries), and the \indexterm{ecliptical @@ -286,11 +287,12 @@ \subsection{Ecliptical Coordinates} In addition, \indexterm[obliquity, ecliptic]{ecliptic obliquity} against the equatorial coordinates, which mirrors the Earth's axial tilt, slowly changes. -Therefore, also for ecliptical coordinates is is required to specify +Therefore, also for ecliptical coordinates it is required to specify which date (epoch) the coordinates refer to. Stellarium can draw grids for two epochs. Use the \key{,} key to draw the \indexterm{ecliptic} for the simulation time. The Markings dialog -(\ref{sec:gui:view:markings}) allows you to also show a line for epoch +(\ref{sec:gui:view:markings}) allows you to add date marks to the ecliptic +line \newFeature{23.1} and also show a line for epoch J2000.0 and grids for the ecliptical coordinates for current epoch and epoch J2000.0. You can assign your own shortcut keys (section~\ref{sec:gui:help:hotkeys}) if you frequently operate with @@ -309,7 +311,7 @@ \subsection{Ecliptical Coordinates} ecliptic \indexterm[obliquity, ecliptic]{obliquity}. The real track of where Earth's axis is pointing forms an open helical loop. The inner planets are best observed when their apparent distance from -the Sun, or \indexterm{elongation} reaches a maximum. Unfortunately +the Sun, or \indexterm{elongation}, reaches a maximum. Unfortunately there are two definitions for elongation, though: \begin{description} \item[$\psi$] angular distance on the sphere. This is today the most widely used definition. diff --git a/guide/ch_interface.tex b/guide/ch_interface.tex index 03dc45ff93bca..d9ca50769b813 100644 --- a/guide/ch_interface.tex +++ b/guide/ch_interface.tex @@ -696,7 +696,7 @@ \subsection{The Solar System Objects (SSO) Tab} \end{figure} \begin{figure}[p] -\centering\includegraphics[width=0.75\textwidth]{view_dialog_markings_tab.png} +\centering\includegraphics[width=0.75\textwidth]{view_dialog_markings_tab.jpg} \caption{View Settings Window: Markings Tab} \label{fig:gui:view:markings} \end{figure} @@ -732,13 +732,13 @@ \subsection{The Markings Tab} \label{sec:gui:view:markings} \noindent The Markings tab of the View window -(Fig.~\ref{fig:gui:view:markings}) controls plot various grids and -lines on celestial sphere. Colors for grids, lines and points can be +(Fig.~\ref{fig:gui:view:markings}) controls plotting various grids and +lines on the celestial sphere. Colors for grids, lines and points can be adjusted by clicking on the corresponding colored square. The central column governs lines like equator, ecliptic, meridian etc., where each can optionally be fine-tuned to \newFeature{0.20.0} show partition marks and labels. Color settings are stored immediately, all other -flags need an explicit saving of the settings (see section +flags need explicit saving of the settings (see section \ref{sec:gui:configuration:main}). \subsection{The Landscape Tab} diff --git a/guide/pictures/view_dialog_markings_tab.jpg b/guide/pictures/view_dialog_markings_tab.jpg new file mode 100644 index 0000000000000..526904d8a5e3e Binary files /dev/null and b/guide/pictures/view_dialog_markings_tab.jpg differ diff --git a/guide/pictures/view_dialog_markings_tab.png b/guide/pictures/view_dialog_markings_tab.png deleted file mode 100644 index 1aac822076526..0000000000000 Binary files a/guide/pictures/view_dialog_markings_tab.png and /dev/null differ diff --git a/src/core/StelCore.hpp b/src/core/StelCore.hpp index 0069c8b27c19f..28750a37c7919 100644 --- a/src/core/StelCore.hpp +++ b/src/core/StelCore.hpp @@ -811,7 +811,7 @@ public slots: //! This signal is emitted when the date has changed for a month. void dateChangedForMonth(); //! This signal is emitted when the date has changed by one year. - void dateChangedByYear(); + void dateChangedByYear(const int year); //! This signal indicates a horizontal display flip void flipHorzChanged(bool b); //! This signal indicates a vertical display flip diff --git a/src/core/StelMovementMgr.cpp b/src/core/StelMovementMgr.cpp index eac4664dbe397..1e470eb729ec9 100644 --- a/src/core/StelMovementMgr.cpp +++ b/src/core/StelMovementMgr.cpp @@ -537,11 +537,12 @@ void StelMovementMgr::handleMouseWheel(QWheelEvent* event) double jdNow=core->getJD(); int year, month, day, hour, min, sec, millis; StelUtils::getDateTimeFromJulianDay(jdNow, &year, &month, &day, &hour, &min, &sec, &millis); + year+=qRound(numSteps); double jdNew; - StelUtils::getJDFromDate(&jdNew, year+qRound(numSteps), month, day, hour, min, static_cast(sec)); + StelUtils::getJDFromDate(&jdNew, year, month, day, hour, min, static_cast(sec)); core->setJD(jdNew); emit core->dateChanged(); - emit core->dateChangedByYear(); + emit core->dateChangedByYear(year); } else if (event->modifiers() & Qt::AltModifier) { diff --git a/src/core/StelUtils.cpp b/src/core/StelUtils.cpp index 019ca02ed0ee2..e6ed83d29a83d 100644 --- a/src/core/StelUtils.cpp +++ b/src/core/StelUtils.cpp @@ -1147,10 +1147,21 @@ bool isLeapYear(const int year) // Meeus, AA 2nd, 1998, ch.7 p.65 int dayInYear(const int year, const int month, const int day) { - int k=(isLeapYear(year) ? 1:2); + const int k=(isLeapYear(year) ? 1:2); return static_cast(275*month/9) - k*static_cast((month+9)/12) + day -30; } +// Find date from day number within year and the year. +// Meeus, AA 2nd, 1998, ch.7 p.66 +Vec3i dateFromDayYear(const int day, const int year) +{ + const int k=(isLeapYear(year) ? 1:2); + int month = day<32 ? 1 : static_cast(9.f*(k+day)/275.f+0.98f); + + int monthDay = day - static_cast(275.f*month/9.f) + k*static_cast((month+9)/12.f) + 30; + return {year, month, monthDay}; +} + // Return a fractional year like YYYY.ddddd. For negative years, the year number is of course decrease. E.g. -500.5 occurs in -501. double yearFraction(const int year, const int month, const double day) { diff --git a/src/core/StelUtils.hpp b/src/core/StelUtils.hpp index 46c6ee0983c4a..8abf6fa2f9a9c 100644 --- a/src/core/StelUtils.hpp +++ b/src/core/StelUtils.hpp @@ -539,6 +539,10 @@ namespace StelUtils //! Find day number for date in year. //! Meeus, Astronomical Algorithms 2nd ed., 1998, ch.7, p.65 int dayInYear(const int year, const int month, const int day); + //! Find date from day number within year and the year. + //! Meeus, AA 2nd, 1998, ch.7 p.66 + //! @returns Vec3i(year, month, day) + Vec3i dateFromDayYear(const int day, const int year); //! Return a fractional year like YYYY.ddddd. For negative years, the year number is decreased. E.g. -500.5 occurs in -501. double yearFraction(const int year, const int month, const double day); diff --git a/src/core/modules/GridLinesMgr.cpp b/src/core/modules/GridLinesMgr.cpp index 4739b3f4f8662..b0971e86a9130 100644 --- a/src/core/modules/GridLinesMgr.cpp +++ b/src/core/modules/GridLinesMgr.cpp @@ -19,6 +19,7 @@ #include "GridLinesMgr.hpp" #include "StelApp.hpp" +#include "StelLocaleMgr.hpp" #include "StelUtils.hpp" #include "StelTranslator.hpp" #include "StelProjector.hpp" @@ -125,6 +126,7 @@ class SkyLine FIXED_EQUATOR, ECLIPTIC_J2000, ECLIPTIC_OF_DATE, + ECLIPTIC_WITH_DATE, PRECESSIONCIRCLE_N, PRECESSIONCIRCLE_S, MERIDIAN, @@ -168,6 +170,8 @@ class SkyLine //! Re-translates the label and sets the frameType. Must be called in the constructor! void updateLabel(); static void setSolarSystem(SolarSystem* ss); + //! Compute eclipticOnDatePartitions for @param year. Trigger a call to this from a signal StelCore::dateChangedByYear() + static void computeEclipticDatePartitions(int year = std::numeric_limits::min()); private: static QSharedPointer earth, sun, moon; SKY_LINE_TYPE line_type; @@ -181,6 +185,7 @@ class SkyLine bool showPartitions; bool showLabel; static QMap precessionPartitions; + static QMap eclipticOnDatePartitions; //!< Map of up to 366 entries double={eclLongitude, aberration, nutation}, QString label }; // rms added color as parameter @@ -637,6 +642,8 @@ SkyLine::SkyLine(SKY_LINE_TYPE _line_type) : line_type(_line_type), color(0.f, 0 // Contains ecliptic rotations from -13000, -12900, ... , +13000 QMap SkyLine::precessionPartitions; +// Contains ecliptic partitions {eclLongitude, aberration, nutation} with labels for the current year +QMap SkyLine::eclipticOnDatePartitions; QSharedPointer SkyLine::earth, SkyLine::sun, SkyLine::moon; //! call once before creating the first line. @@ -651,6 +658,61 @@ void SkyLine::init() getPrecessionAnglesVondrak(jdY0, &epsilonA, &chiA, &omegaA, &psiA); precessionPartitions.insert(y, psiA); // Store only the value of shift along the ecliptic. } + StelCore *core=StelApp::getInstance().getCore(); + const double jde=core->getJDE(); + int year, month, day; + StelUtils::getDateFromJulianDay(jde, &year, &month, &day); + computeEclipticDatePartitions(year); +} + +void SkyLine::computeEclipticDatePartitions(int year) +{ + static GridLinesMgr* gMgr=GETSTELMODULE(GridLinesMgr); + if (gMgr && (! gMgr->getFlagEclipticDatesLabeled())) + return; + + Q_ASSERT(earth); + StelCore *core=StelApp::getInstance().getCore(); + eclipticOnDatePartitions.clear(); + + if (year==std::numeric_limits::min()) + { + int m, d; + StelUtils::getDateFromJulianDay(core->getJD(), &year, &m, &d); + } + const int lastDoY = (StelUtils::isLeapYear(year) ? 366 : 365); + for (int day=1; day <= lastDoY; day++) + { + const Vec3i date=StelUtils::dateFromDayYear(day, year); + double jd; + StelUtils::getJDFromDate(&jd, year, date[1], date[2], 0, 0, 0.f); + const double tzOffset=core->getUTCOffset(jd)/24.; + const double jde=jd+core->getDeltaT()/86400.-tzOffset; + Vec3d earthPos=earth->getEclipticPos(jde); // J2000 position! + double lng, lat, r; + StelUtils::rectToSphe(&lng, &lat, &r, earthPos); + lng+=M_PI; lat*=-1.; // derive Solar data from this. + double epsilonA, chiA, omegaA, psiA; + getPrecessionAnglesVondrak(jde, &epsilonA, &chiA, &omegaA, &psiA); + lng+=psiA; + double aberration=-20.4898/3600.*M_PI_180/r; // Meeus AA (25.10) + double deltaEps, deltaPsi; + getNutationAngles(jde, &deltaPsi, &deltaEps); + + QString label; + if ((year==1582) && (date[1]==10)) + { + // Gregorian calendar reform. Duplicate ticks are harmless, but we must tweak date labels. + if (QList{1, 4, 15, 20, 25}.contains(date[2])) + label=QString("%1.%2").arg(QString::number(date[2]), StelLocaleMgr::romanMonthName(date[1])); + } + else + { + if (QList{1, 5, 10, 15, 20, 25}.contains(date[2])) + label=QString("%1.%2").arg(QString::number(date[2]), StelLocaleMgr::romanMonthName(date[1])); + } + eclipticOnDatePartitions.insert(Vec3d(lng, aberration, deltaPsi), label); + } } void SkyLine::setSolarSystem(SolarSystem* ss) @@ -692,6 +754,10 @@ void SkyLine::updateLabel() frameType = StelCore::FrameObservercentricEclipticOfDate; label = q_("Ecliptic of Date"); break; + case ECLIPTIC_WITH_DATE: + frameType = StelCore::FrameObservercentricEclipticOfDate; + label = QString(); // No label: parallel to ecliptic. + break; case EQUATOR_J2000: frameType = StelCore::FrameJ2000; label = q_("Equator of J2000.0"); @@ -1092,6 +1158,7 @@ void SkyLine::draw(StelCore *core) const if (showPartitions && !(QList({INVARIABLEPLANE, EARTH_UMBRA, EARTH_PENUMBRA, QUADRATURE}).contains(line_type))) { const float lineThickness=sPainter.getLineWidth(); + const float rotSign= (line_type==ECLIPTIC_WITH_DATE ? -1.f : 1.f); sPainter.setLineWidth(partThickness); // Before drawing the lines themselves (and returning), draw the short partition lines @@ -1113,11 +1180,11 @@ void SkyLine::draw(StelCore *core) const partAxis=sphericalCap.n ^ part0; } - Vec3d part1=part0; part1.transfo4d(Mat4d::rotation(partAxis, 0.10*M_PI/180)); // part1 should point to 0.05deg south of "equator" - Vec3d part5=part0; part5.transfo4d(Mat4d::rotation(partAxis, 0.25*M_PI/180)); - Vec3d part10=part0; part10.transfo4d(Mat4d::rotation(partAxis, 0.45*M_PI/180)); - Vec3d part30=part0; part30.transfo4d(Mat4d::rotation(partAxis, 0.75*M_PI/180)); - Vec3d part30l=part0; part30l.transfo4d(Mat4d::rotation(partAxis, 0.775*M_PI/180)); + Vec3d part1=part0; part1.transfo4d(Mat4d::rotation(partAxis, rotSign*0.10*M_PI/180)); // part1 should point to 0.05deg south of "equator" + Vec3d part5=part0; part5.transfo4d(Mat4d::rotation(partAxis, rotSign*0.25*M_PI/180)); + Vec3d part10=part0; part10.transfo4d(Mat4d::rotation(partAxis, rotSign*0.45*M_PI/180)); + Vec3d part30=part0; part30.transfo4d(Mat4d::rotation(partAxis, rotSign*0.75*M_PI/180)); + Vec3d part30l=part0; part30l.transfo4d(Mat4d::rotation(partAxis, rotSign*0.775*M_PI/180)); const Mat4d& rotZ1 = Mat4d::rotation(partZAxis, 1.0*M_PI/180.); // Limit altitude marks to the displayed range int i_min= 0; @@ -1129,8 +1196,60 @@ void SkyLine::draw(StelCore *core) const if (alt<= 2*M_PI_180) i_min =static_cast(-alt*M_180_PI)+2; if (alt>=-2*M_PI_180) i_max-=static_cast( alt*M_180_PI)+2; } - - for (int i=0; igetCurrentLocation().getLatitude() < 0.f; + const float extraTextAngle = southernHemi ? M_PI_2f : -M_PI_2f; + const float shifty = (southernHemi ? -1.f : 0.25) * static_cast(sPainter.getFontMetrics().height()); + const double currentFoV=core->getMovementMgr()->getCurrentFov(); + + // This special line type does not show the actual ecliptic line but only the partitions. These must be read from the precomputed static array eclipticOnDatePartitions + QMap::const_iterator it=eclipticOnDatePartitions.constBegin(); + while (it != eclipticOnDatePartitions.constEnd()) + { + double lng=it.key()[0]; // ecl. longitude, radians + const double nutation=it.key()[1]; // nutation in longitude, radians + const double aberration=it.key()[2]; // aberration, radians + if (core->getUseNutation()) + lng+=nutation; + if (core->getUseAberration()) + lng+=aberration; + const QString &label=it.value(); + // draw and labels: derive the irregular tick lengths from labeling + Vec3d start=fpt; + Vec3d end= (label.length()>0) ? part10 : part1; + if (label.contains("5")) + end=part5; + Vec3d end10=part10; + + const Mat4d& rotDay = Mat4d::rotation(partZAxis, lng); + start.transfo4d(rotDay); + end.transfo4d(rotDay); + end10.transfo4d(rotDay); + + sPainter.drawGreatCircleArc(start, end, Q_NULLPTR, Q_NULLPTR, Q_NULLPTR); + + if (label.length()>0 && ( + currentFoV<60. // all labels + || (currentFoV<=180. && !label.contains("5")) // 1.MM/10.MM/20.MM + || label.startsWith("1.") // in any case + )) + { + Vec3d screenPosTgt, screenPosTgtL; + prj->project(start, screenPosTgt); + prj->project(end10, screenPosTgtL); + double dx=screenPosTgtL[0]-screenPosTgt[0]; + double dy=screenPosTgtL[1]-screenPosTgt[1]; + float textAngle=static_cast(atan2(dy,dx))+extraTextAngle; + // Gravity labels look outright terrible here! Disable them. + float shiftx = - static_cast(sPainter.getFontMetrics().boundingRect(label).width()) * 0.5f; + sPainter.drawText(end10, label, textAngle*M_180_PIf, shiftx, shifty, true); + } + it++; + } + } + else for (int i=0; i=i_min) || (line_type!=CURRENT_VERTICAL)) { @@ -1296,7 +1415,7 @@ void SkyLine::draw(StelCore *core) const sPainter.drawGreatCircleArc(p1, pHori, Q_NULLPTR, viewportEdgeIntersectCallback, &userData); sPainter.drawGreatCircleArc(p2, pHori, Q_NULLPTR, viewportEdgeIntersectCallback, &userData); } - else + else if (line_type!=ECLIPTIC_WITH_DATE) // Exclude the pseudo-line ecliptic with date marks: This has only partitions! { if (!SphericalCap::intersectionPoints(viewPortSphericalCap, sphericalCap, p1, p2)) { @@ -1643,6 +1762,7 @@ GridLinesMgr::GridLinesMgr() fixedEquatorLine = new SkyLine(SkyLine::FIXED_EQUATOR); eclipticJ2000Line = new SkyLine(SkyLine::ECLIPTIC_J2000); eclipticLine = new SkyLine(SkyLine::ECLIPTIC_OF_DATE); + eclipticWithDateLine = new SkyLine(SkyLine::ECLIPTIC_WITH_DATE); invariablePlaneLine = new SkyLine(SkyLine::INVARIABLEPLANE); solarEquatorLine = new SkyLine(SkyLine::SOLAR_EQUATOR); precessionCircleN = new SkyLine(SkyLine::PRECESSIONCIRCLE_N); @@ -1679,6 +1799,13 @@ GridLinesMgr::GridLinesMgr() earth = GETSTELMODULE(SolarSystem)->getEarth(); connect(GETSTELMODULE(SolarSystem), SIGNAL(solarSystemDataReloaded()), this, SLOT(connectSolarSystem())); + + // Whenever year changes we must recompute the labels for the ecliptic when dates are shown. + connect(StelApp::getInstance().getCore(), &StelCore::dateChangedByYear, this, [=](const int year){ SkyLine::computeEclipticDatePartitions(year);}); + // Likewise, recreate when switching them on... + connect(this, &GridLinesMgr::eclipticDatesLabeledChanged, this, [=](const bool displayed){ if (displayed) SkyLine::computeEclipticDatePartitions();}); + // ... or as timezone changes + connect(StelApp::getInstance().getCore(), &StelCore::currentTimeZoneChanged, this, [=](const QString&){ SkyLine::computeEclipticDatePartitions();}); } GridLinesMgr::~GridLinesMgr() @@ -1695,6 +1822,7 @@ GridLinesMgr::~GridLinesMgr() delete equatorJ2000Line; delete fixedEquatorLine; delete eclipticLine; + delete eclipticWithDateLine; delete eclipticJ2000Line; delete invariablePlaneLine; delete solarEquatorLine; @@ -1775,6 +1903,7 @@ void GridLinesMgr::init() setFlagEclipticLine(conf->value("viewing/flag_ecliptic_line").toBool()); setFlagEclipticParts(conf->value("viewing/flag_ecliptic_parts").toBool()); setFlagEclipticLabeled(conf->value("viewing/flag_ecliptic_labels").toBool()); + setFlagEclipticDatesLabeled(conf->value("viewing/flag_ecliptic_dates_labels", true).toBool()); setFlagEclipticJ2000Line(conf->value("viewing/flag_ecliptic_J2000_line").toBool()); setFlagEclipticJ2000Parts(conf->value("viewing/flag_ecliptic_J2000_parts").toBool()); setFlagEclipticJ2000Labeled(conf->value("viewing/flag_ecliptic_J2000_labels").toBool()); @@ -1951,6 +2080,7 @@ void GridLinesMgr::update(double deltaTime) equatorJ2000Line->update(deltaTime); fixedEquatorLine->update(deltaTime); eclipticLine->update(deltaTime); + eclipticWithDateLine->update(deltaTime); eclipticJ2000Line->update(deltaTime); invariablePlaneLine->update(deltaTime); solarEquatorLine->update(deltaTime); @@ -2020,6 +2150,7 @@ void GridLinesMgr::draw(StelCore* core) umbraCircle->draw(core); eclGrid->draw(core); eclipticLine->draw(core); + eclipticWithDateLine->draw(core); precessionCircleN->draw(core); precessionCircleS->draw(core); colureLine_1->draw(core); @@ -2067,6 +2198,7 @@ void GridLinesMgr::updateLabels() equatorLine->updateLabel(); fixedEquatorLine->updateLabel(); eclipticLine->updateLabel(); + eclipticWithDateLine->updateLabel(); eclipticJ2000Line->updateLabel(); invariablePlaneLine->updateLabel(); solarEquatorLine->updateLabel(); @@ -2557,6 +2689,7 @@ void GridLinesMgr::setFlagEclipticLine(const bool displayed) if(displayed != eclipticLine->isDisplayed()) { eclipticLine->setDisplayed(displayed); + eclipticWithDateLine->setDisplayed(displayed); emit eclipticLineDisplayedChanged(displayed); } } @@ -2593,6 +2726,22 @@ bool GridLinesMgr::getFlagEclipticLabeled() const { return eclipticLine->isLabeled(); } + +//! Set flag for displaying Ecliptic Date partitions +void GridLinesMgr::setFlagEclipticDatesLabeled(const bool displayed) +{ + if(displayed != eclipticWithDateLine->isLabeled()) + { + eclipticWithDateLine->setPartitions(displayed); + eclipticWithDateLine->setLabeled(displayed); + emit eclipticDatesLabeledChanged(displayed); + } +} +//! Get flag for displaying Ecliptic Line partitions +bool GridLinesMgr::getFlagEclipticDatesLabeled() const +{ + return eclipticWithDateLine->isLabeled(); +} Vec3f GridLinesMgr::getColorEclipticLine() const { return eclipticLine->getColor(); @@ -2602,6 +2751,7 @@ void GridLinesMgr::setColorEclipticLine(const Vec3f& newColor) if(newColor != eclipticLine->getColor()) { eclipticLine->setColor(newColor); + eclipticWithDateLine->setColor(newColor); // One color for both! emit eclipticLineColorChanged(newColor); } } @@ -3770,6 +3920,7 @@ void GridLinesMgr::setLineThickness(const float thickness) equatorJ2000Line->setLineThickness(lineThickness); fixedEquatorLine->setLineThickness(lineThickness); eclipticLine->setLineThickness(lineThickness); + eclipticWithDateLine->setLineThickness(lineThickness); eclipticJ2000Line->setLineThickness(lineThickness); invariablePlaneLine->setLineThickness(lineThickness); solarEquatorLine->setLineThickness(lineThickness); @@ -3810,6 +3961,7 @@ void GridLinesMgr::setPartThickness(const float thickness) equatorJ2000Line->setPartThickness(partThickness); fixedEquatorLine->setPartThickness(partThickness); eclipticLine->setPartThickness(partThickness); + eclipticWithDateLine->setPartThickness(partThickness); eclipticJ2000Line->setPartThickness(partThickness); //invariablePlaneLine->setPartThickness(partThickness); solarEquatorLine->setPartThickness(partThickness); @@ -3854,6 +4006,7 @@ void GridLinesMgr::setFontSizeFromApp(int size) equatorJ2000Line->setFontSize(lineFontSize); fixedEquatorLine->setFontSize(lineFontSize); eclipticLine->setFontSize(lineFontSize); + eclipticWithDateLine->setFontSize(lineFontSize); eclipticJ2000Line->setFontSize(lineFontSize); invariablePlaneLine->setFontSize(lineFontSize); solarEquatorLine->setFontSize(lineFontSize); diff --git a/src/core/modules/GridLinesMgr.hpp b/src/core/modules/GridLinesMgr.hpp index 69a89daac0357..4e8b35bfdc782 100644 --- a/src/core/modules/GridLinesMgr.hpp +++ b/src/core/modules/GridLinesMgr.hpp @@ -81,11 +81,12 @@ class GridLinesMgr : public StelModule Q_PROPERTY(bool eclipticLineDisplayed READ getFlagEclipticLine WRITE setFlagEclipticLine NOTIFY eclipticLineDisplayedChanged) Q_PROPERTY(bool eclipticPartsDisplayed READ getFlagEclipticParts WRITE setFlagEclipticParts NOTIFY eclipticPartsDisplayedChanged) Q_PROPERTY(bool eclipticPartsLabeled READ getFlagEclipticLabeled WRITE setFlagEclipticLabeled NOTIFY eclipticPartsLabeledChanged) + Q_PROPERTY(bool eclipticDatesLabeled READ getFlagEclipticDatesLabeled WRITE setFlagEclipticDatesLabeled NOTIFY eclipticDatesLabeledChanged) Q_PROPERTY(Vec3f eclipticLineColor READ getColorEclipticLine WRITE setColorEclipticLine NOTIFY eclipticLineColorChanged) Q_PROPERTY(bool eclipticJ2000LineDisplayed READ getFlagEclipticJ2000Line WRITE setFlagEclipticJ2000Line NOTIFY eclipticJ2000LineDisplayedChanged) Q_PROPERTY(bool eclipticJ2000PartsDisplayed READ getFlagEclipticJ2000Parts WRITE setFlagEclipticJ2000Parts NOTIFY eclipticJ2000PartsDisplayedChanged) - Q_PROPERTY(bool eclipticJ2000PartsLabeled READ getFlagEclipticJ2000Labeled WRITE setFlagEclipticJ2000Labeled NOTIFY eclipticJ2000PartsLabeledChanged) + Q_PROPERTY(bool eclipticJ2000PartsLabeled READ getFlagEclipticJ2000Labeled WRITE setFlagEclipticJ2000Labeled NOTIFY eclipticJ2000PartsLabeledChanged) Q_PROPERTY(Vec3f eclipticJ2000LineColor READ getColorEclipticJ2000Line WRITE setColorEclipticJ2000Line NOTIFY eclipticJ2000LineColorChanged) Q_PROPERTY(bool invariablePlaneLineDisplayed READ getFlagInvariablePlaneLine WRITE setFlagInvariablePlaneLine NOTIFY invariablePlaneLineDisplayedChanged) @@ -453,6 +454,11 @@ public slots: void setFlagEclipticLabeled(const bool displayed); //! Accessor for displaying Ecliptic line partition labels. bool getFlagEclipticLabeled() const; + //! Setter for displaying Ecliptic line partition labels of dates for Solar position in the current year. + void setFlagEclipticDatesLabeled(const bool displayed); + //! Accessor for displaying Ecliptic line partition labels of dates for Solar position in the current year. + bool getFlagEclipticDatesLabeled() const; + //! Get the current color of the Ecliptic Line. Vec3f getColorEclipticLine() const; //! Set the color of the Ecliptic Line. @@ -1001,6 +1007,7 @@ public slots: void eclipticLineDisplayedChanged(const bool displayed); void eclipticPartsDisplayedChanged(const bool displayed); void eclipticPartsLabeledChanged(const bool displayed); + void eclipticDatesLabeledChanged(const bool displayed); void eclipticLineColorChanged(const Vec3f & newColor); void invariablePlaneLineDisplayedChanged(const bool displayed); //void invariablePlanePartsDisplayedChanged(const bool displayed); @@ -1114,6 +1121,7 @@ private slots: SkyLine * equatorJ2000Line; // Celestial Equator line of J2000 SkyLine * fixedEquatorLine; // Fixed Celestial Equator line (hour angles) SkyLine * eclipticLine; // Ecliptic line + SkyLine * eclipticWithDateLine; // Ecliptic line (line actually invisible!) with date partitions for the current year indicating Solar position at midnight SkyLine * eclipticJ2000Line; // Ecliptic line of J2000 SkyLine * invariablePlaneLine; // Invariable Plane of the Solar System (WGCCRE2015 report) SkyLine * solarEquatorLine; // Projected Solar equator (WGCCRE2015 report) diff --git a/src/gui/AstroCalcDialog.cpp b/src/gui/AstroCalcDialog.cpp index d06cf99f8c098..a9a1e17b78c60 100644 --- a/src/gui/AstroCalcDialog.cpp +++ b/src/gui/AstroCalcDialog.cpp @@ -446,7 +446,7 @@ void AstroCalcDialog::createDialogContent() connect(ui->monthlyElevationPositiveCheckBox, SIGNAL(toggled(bool)), this, SLOT(saveMonthlyElevationPositiveFlag(bool))); connect(ui->monthlyElevationPositiveLimitSpinBox, SIGNAL(valueChanged(int)), this, SLOT(saveMonthlyElevationPositiveLimit(int))); connect(objectMgr, SIGNAL(selectedObjectChanged(StelModule::StelModuleSelectAction)), this, SLOT(drawMonthlyElevationGraph())); - connect(core, SIGNAL(dateChangedByYear()), this, SLOT(drawMonthlyElevationGraph())); + connect(core, SIGNAL(dateChangedByYear(const int)), this, SLOT(drawMonthlyElevationGraph())); connect(ui->graphsCelestialBodyComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(saveGraphsCelestialBody(int))); connect(ui->graphsFirstComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(saveGraphsFirstId(int))); diff --git a/src/gui/ConfigurationDialog.cpp b/src/gui/ConfigurationDialog.cpp index f699ba0e24b38..7d44c6a20e3dd 100644 --- a/src/gui/ConfigurationDialog.cpp +++ b/src/gui/ConfigurationDialog.cpp @@ -928,6 +928,7 @@ void ConfigurationDialog::saveAllSettings() conf->setValue("viewing/flag_ecliptic_line", propMgr->getStelPropertyValue("GridLinesMgr.eclipticLineDisplayed").toBool()); conf->setValue("viewing/flag_ecliptic_parts", propMgr->getStelPropertyValue("GridLinesMgr.eclipticPartsDisplayed").toBool()); conf->setValue("viewing/flag_ecliptic_labels", propMgr->getStelPropertyValue("GridLinesMgr.eclipticPartsLabeled").toBool()); + conf->setValue("viewing/flag_ecliptic_dates_labels", propMgr->getStelPropertyValue("GridLinesMgr.eclipticDatesLabeled").toBool()); conf->setValue("viewing/flag_ecliptic_J2000_line", propMgr->getStelPropertyValue("GridLinesMgr.eclipticJ2000LineDisplayed").toBool()); conf->setValue("viewing/flag_ecliptic_J2000_parts", propMgr->getStelPropertyValue("GridLinesMgr.eclipticJ2000PartsDisplayed").toBool()); conf->setValue("viewing/flag_ecliptic_J2000_labels", propMgr->getStelPropertyValue("GridLinesMgr.eclipticJ2000PartsLabeled").toBool()); diff --git a/src/gui/DateTimeDialog.cpp b/src/gui/DateTimeDialog.cpp index 855f0d9f79831..fa470efaad5c6 100644 --- a/src/gui/DateTimeDialog.cpp +++ b/src/gui/DateTimeDialog.cpp @@ -279,7 +279,7 @@ void DateTimeDialog::setDateTime(double newJd) if (oldyear != year || oldmonth != month || oldday != day) emit core->dateChanged(); if (oldyear != year) - emit core->dateChangedByYear(); + emit core->dateChangedByYear(year); if (oldmonth != month) emit core->dateChangedForMonth(); diff --git a/src/gui/ViewDialog.cpp b/src/gui/ViewDialog.cpp index 6a0a02f6995cb..e7edd1f48b91a 100644 --- a/src/gui/ViewDialog.cpp +++ b/src/gui/ViewDialog.cpp @@ -430,6 +430,7 @@ void ViewDialog::createDialogContent() connectBoolProperty(ui->equatorJ2000LabelsCheckBox, "GridLinesMgr.equatorJ2000PartsLabeled"); connectBoolProperty(ui->fixedEquatorLabelsCheckBox, "GridLinesMgr.fixedEquatorPartsLabeled"); connectBoolProperty(ui->eclipticLabelsCheckBox, "GridLinesMgr.eclipticPartsLabeled"); + connectBoolProperty(ui->withSolarTicksCheckbox, "GridLinesMgr.eclipticDatesLabeled"); connectBoolProperty(ui->eclipticJ2000LabelsCheckBox, "GridLinesMgr.eclipticJ2000PartsLabeled"); connectBoolProperty(ui->solarEquatorLabelsCheckBox, "GridLinesMgr.solarEquatorPartsLabeled"); connectBoolProperty(ui->longitudeLabelsCheckBox, "GridLinesMgr.longitudePartsLabeled"); diff --git a/src/gui/viewDialog.ui b/src/gui/viewDialog.ui index 8cfe90de61ba0..72e440b547630 100644 --- a/src/gui/viewDialog.ui +++ b/src/gui/viewDialog.ui @@ -3016,217 +3016,169 @@ - - - - Color of the celestial poles (J2000.0) - + + - + Equinoxes (of date) - - - - - - Show rectangular marker of field of view (FOV) - - - Rectangular FOV - - - - - - - - 75 - 16777215 - - - - Width of rectangle, in degrees - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - 0.100000000000000 - - - 180.000000000000000 - - - 0.100000000000000 - - - 4.000000000000000 - - - - - - - - 75 - 16777215 - - - - Height of rectangle, in degrees - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - 0.100000000000000 - - - 180.000000000000000 - - - 0.100000000000000 - - - 3.000000000000000 - - - - - - - - 75 - 16777215 - - - - Rotation angle of rectangle, in degrees - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - 1 - - - -90.000000000000000 - - - 90.000000000000000 - - - - - - - + + - These circles delimit stars which stay always above (respectively below) the mathematical horizon. + Color of the ecliptical grid (J2000.0) - Circumpolar circles + - - + + - Altitudes and azimuth (counted from North towards East). + Label partitions - Azimuthal grid + - - + + + + Galactic Coordinates, System II (IAU 1958). + - Galactic center and anticenter + Galactic grid - - + + - Label partitions + Show de Vaucouleurs' Supergalactic coordinates (1976), defined by the distribution of nearby galaxies. - + Supergalactic grid - - + + - Show meridian line. + Show line - Meridian + - - + + - Show ecliptic poles of current date. + Show partitions - Ecliptic poles (of date) + - - + + - Label partitions + Show partitions - - + + - Color of equator (J2000.0) + Color of the azimuthal grid - - + + - Color of the solstice points (J2000.0) + Ecliptical coordinates for J2000.0. - + Ecliptic grid (J2000) - - + + + + Solstices (J2000) + + + + + - Color of equator (of date) + Fixed equatorial coordinates (hour angle/declination) of current planet. - + Fixed Equatorial grid - - + + + + 0 + + + + + This circle represents the size of Earth's central, deep shadow in the distance of the Moon. + + + Earth umbra + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Show center point of Earth's shadow in the distance of the Moon. + + + + + + + + + + - Equinoxes (of date) + Equinoxes (J2000) - - + + Label partitions @@ -3235,89 +3187,166 @@ - - + + - Color of the invariable plane of the Solar system + Color of the equatorial grid (J2000.0) - + - - - - Color of the quadrature circle + + + + Solstices (of date) - - + + - Label partitions + Show mathematical horizon line. - + Horizon - - - - Show marker of center for field of view (FOV) - + + + + + + The line thickness for grids and lines + + + Thickness: lines + + + + + + + + 50 + 16777215 + + + + Thickness of line in pixels + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 1 + + + 5 + + + + + + + The line thickness for circle partitions + + + partitions + + + + + + + + 0 + 0 + + + + + 50 + 16777215 + + + + Thickness of partitions in pixels + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 1 + + + 5 + + + + + + + - Center of FOV + Zenith and Nadir - - + + - Instantaneous circles of earth's axis on its motion around ecliptical poles. Displayed on Earth only. + Label partitions - Precession circles + - - + + + + Show line + - Solstices (J2000) + - - + + - Color of the ecliptical grid (of date) + Show partitions - + - - + + - Color of circular marker of FOV + Altitudes and azimuth (counted from North towards East). + + + Azimuthal grid - - + + - Color of supergalactic poles + Show meridian line. - + Meridian - - + + Label partitions @@ -3326,440 +3355,359 @@ - - + + - Show partitions + Opposition/conjunction longitude line - the line of ecliptic longitude which passes through both ecliptic poles, the Sun and opposition point. - + O./C. longitude - - + + - Show partitions + Show a vertical line (with optional altitude marks) in the screen center. - + Altitude - - + + - Label partitions + Show partitions - - - - - 0 - 0 - - + + - Show partitions + Show line - - + + - Color of the supergalactic grid - - - + Show line - - - - - - - - - - Labels for the cardinal directions (4-wind compass rose). - - - Cardinal points - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Labels for the intercardinal (or ordinal) directions (8-wind compass rose). - - - 8 - - - - - - - Labels for the secondary intercardinal directions (16-wind compass rose). - - - 16 - - - - - - - Labels for the tertiary intercardinal directions (32-wind compass rose). - - - 32 - - - - - - - + + - Show line + Color of ecliptic (J2000.0) - + - - + + - Show line + Label partitions - - + + - Color of fixed equator + Color of antisolar point - - + + - Show partitions + Color of galactic equator - + - - + + - Show colures (great circles through poles and solstices/equinoxes). + Equatorial coordinates of current date and planet. - Colures + Equatorial grid (of date) - - + + - Color of ecliptic poles (of date) + Color of celestial poles (of date) - - + + + + Color of circumpolar circles + - Galactic poles + - - + + - Color of altitude line + Color of Zenith and Nadir - + - - + + - Label partitions + Show partitions - - + + - Show line + Color of ecliptic (of date) - + - - + + - Color of meridian + Ecliptical coordinates for current date. Displayed on Earth only. - + Ecliptic grid (of date) - - - - - 0 - 0 - - + + - Show circles + Show line - - + + - Color of Prime Vertical + Color of galactic center and anticenter + + + + + + + Instantaneous circles of earth's axis on its motion around ecliptical poles. Displayed on Earth only. - + Precession circles - - + + - Show partitions + Show equator of de Vaucouleurs' Supergalactic coordinates (1976). - + Supergalactic equator - - + + - Color of horizon + Show line - + - - + + - Equatorial coordinates of J2000.0. + Color of the equinox points (of date) - Equatorial grid (J2000) + - - + + - Color of the equatorial grid (of date) + Color of colures - - + + - Show celestial poles of current planet and date. + Show line - Celestial poles (of date) + - - + + + + Label partitions + - Equinoxes (J2000) + - - + + - Show line + Color of fixed equator - - + + - Label partitions + Color of compass marks + + + + - + Galactic center and anticenter - - + + - Label partitions + A circle 90° from the Sun marking quadrature - + Quadrature circle - - + + - Show ecliptic line of J2000.0 (VSOP87A fundamental plane). + Color of supergalactic poles - Ecliptic (J2000) + - - + + - Color of ecliptic (J2000.0) + Show partitions - + - - + + - Show a vertical line (with optional altitude marks) in the screen center. + Color of supergalactic equator - Altitude + - - - - 0 - + + - + - This circle represents the size of Earth's central, deep shadow in the distance of the Moon. + Show rectangular marker of field of view (FOV) - Earth umbra + Rectangular FOV - - - Qt::Horizontal - - + + - 40 - 20 + 75 + 16777215 - - - - - Show center point of Earth's shadow in the distance of the Moon. + Width of rectangle, in degrees - - + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - Ecliptical coordinates for current date. Displayed on Earth only. - - - Ecliptic grid (of date) - - - - - - - - - Show circular marker of field of view (FOV) + + 0.100000000000000 - - Circular FOV + + 180.000000000000000 + + + 0.100000000000000 + + + 4.000000000000000 - + 75 @@ -3767,34 +3715,79 @@ - Field of view in degrees + Height of rectangle, in degrees Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - 2 - 0.100000000000000 - 28.000000000000000 + 180.000000000000000 0.100000000000000 - 1.000000000000000 + 3.000000000000000 + + + + + + + + 75 + 16777215 + + + + Rotation angle of rectangle, in degrees + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 1 + + + -90.000000000000000 + + + 90.000000000000000 - - + + + + Show partitions + - Antisolar point + + + + + + + + Show partitions + + + + + + + + + + Color of penumbra circle + + + @@ -3808,86 +3801,150 @@ - - + + - Label partitions + Show line - - + + - A circle 90° from the Sun marking quadrature + Color of Apex and Antapex points - Quadrature circle + - - + + + + Show partitions + + + + + + + + - Show Prime (East-West) Vertical. + Label partitions - Prime Vertical + - - + + - Opposition/conjunction longitude line - the line of ecliptic longitude which passes through both ecliptic poles, the Sun and opposition point. + Show ecliptic poles of current date. - O./C. longitude + Ecliptic poles (of date) - - + + - Label partitions + Show partitions - - + + - A plane perpendicular to the angular momentum vector of the Solar system. + Color of meridian - Invariable plane of the Solar system + - - + + - Color of the equinox points (J2000.0) + Show celestial equator of current planet and date. - + Equator (of date) - - - - Show line - + + + + + + + + Labels for the cardinal directions (4-wind compass rose). + + + Cardinal points + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Labels for the intercardinal (or ordinal) directions (8-wind compass rose). + + + 8 + + + + + + + Labels for the secondary intercardinal directions (16-wind compass rose). + + + 16 + + + + + + + Labels for the tertiary intercardinal directions (32-wind compass rose). + + + 32 + + + + + @@ -3898,28 +3955,34 @@ - - + + - Show line + Label partitions - - + + + + + 0 + 0 + + - Color of cardinal points + Show partitions - + - - + + Show line @@ -3928,179 +3991,234 @@ - - + + - Label partitions + Show marker of center for field of view (FOV) - + Center of FOV - - + + - Show partitions + Color of the supergalactic grid - + - - + + - Show celestial poles of J2000.0. + Color of the celestial poles (J2000.0) - Celestial poles (J2000) + - - + + - Color of compass marks + Show circles + + + - - + + - Color of penumbra circle + Color of precession circles - + - - + + - Equatorial coordinates of current date and planet. + Color of the quadrature circle + + + + - Equatorial grid (of date) + Galactic poles - - + + - Color of the equatorial grid (J2000.0) + Apex and Antapex indicate where the observer's planet is heading to or receding from, respectively. - + Apex points - - + + - Color of the ecliptical grid (J2000.0) + Color of marker of center of FOV + + + + + + + Label partitions - + - - + + - Color of celestial poles (of date) + These circles delimit stars which stay always above (respectively below) the mathematical horizon. - + Circumpolar circles - - + + - Show partitions + Label partitions - - + + - Show partitions + Color of equator (of date) - + - - + + + + + + Show circular marker of field of view (FOV) + + + Circular FOV + + + + + + + + 75 + 16777215 + + + + Field of view in degrees + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 2 + + + 0.100000000000000 + + + 28.000000000000000 + + + 0.100000000000000 + + + 1.000000000000000 + + + + + + + - Show partitions + Color of the equatorial grid (of date) - + - - + + - Show de Vaucouleurs' Supergalactic coordinates (1976), defined by the distribution of nearby galaxies. + Equatorial coordinates of J2000.0. - Supergalactic grid + Equatorial grid (J2000) - - + + - Color of the galactic grid + Color of the opposition/conjunction longitude line - - + + - Label partitions + This circle represents the outermost rim of Earth's shadow in the distance of the Moon. - + Earth penumbra - - + + - Show line + Color of the invariable plane of the Solar system - - + + - Color of galactic center and anticenter + Color of the solstice points (of date) - - - - - Solstices (of date) + - - + + Show partitions @@ -4109,296 +4227,168 @@ - - - - Show equator of de Vaucouleurs' Supergalactic coordinates (1976). - - - Supergalactic equator - - - - - + + - Color of umbra circle + Show line - - - - Solar equator projected into space. - - - Projected Solar Equator - - - - - + + - Color of galactic equator + Color of the ecliptic poles (J2000.0) - - + + - Color of Zenith and Nadir + Color of altitude line - - - - - - - - Color of rectangular marker of FOV + - - + + - Color of circumpolar circles + Color of the equinox points (J2000.0) - - - - Show fixed celestial equator (hour angles) of current planet. - + + - Fixed Equator + Compass marks - - + + - Color of supergalactic equator + Color of ecliptic poles (of date) - - - - Show mathematical horizon line. - - - Horizon - - - - - + + - Color of the opposition/conjunction longitude line + Color of cardinal points - - - - Show line - - - - - - - - - - Fixed equatorial coordinates (hour angle/declination) of current planet. - - - Fixed Equatorial grid + + + + + 0 + 0 + - - - - - Color of precession circles + Show circles - + - - - - - - The line thickness for grids and lines - - - Thickness: lines - - - - - - - - 50 - 16777215 - - - - Thickness of line in pixels - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - 1 - - - 5 - - - - - - - The line thickness for circle partitions - - - partitions - - - - - - - - 0 - 0 - - - - - 50 - 16777215 - - - - Thickness of partitions in pixels - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - 1 - - - 5 - - - - - - - + + - Color of the equinox points (of date) + Color of the solstice points (J2000.0) - + - - + + - Color of galactic poles - - - + Color of rectangular marker of FOV - - + + - Show celestial equator of J2000.0. + Color of Prime Vertical - Equator (J2000) + - - + + + + Color of umbra circle + - Compass marks + - - + + - Apex and Antapex indicate where the observer's planet is heading to or receding from, respectively. + Solar equator projected into space. - Apex points + Projected Solar Equator - - + + - Show partitions + Label partitions - - + + - Color of colures + Show colures (great circles through poles and solstices/equinoxes). - + Colures - - + + - Show partitions + Show fixed celestial equator (hour angles) of current planet. - + Fixed Equator - - + + Label partitions @@ -4407,88 +4397,88 @@ - - + + - Show celestial equator of current planet and date. + Show Prime (East-West) Vertical. - Equator (of date) + Prime Vertical - - + + - Show partitions + Color of horizon - + - - + + - Show line + Show partitions - - + + - Show partitions + Color of the galactic grid - + - - + + - Show ecliptic line of current date. + Show line - Ecliptic (of date) + - - + + - Color of the azimuthal grid + Show celestial poles of current planet and date. - + Celestial poles (of date) - - + + - Ecliptical coordinates for J2000.0. + A plane perpendicular to the angular momentum vector of the Solar system. - Ecliptic grid (J2000) + Invariable plane of the Solar system - - + + - Show line + Color of the ecliptical grid (of date) - + - - + + Label partitions @@ -4497,147 +4487,171 @@ - - + + - Show ecliptic poles of J2000.0 - - - Ecliptic poles (J2000) + Color of circular marker of FOV - - + + - Show circles + Color of galactic poles - + - - + + - Color of antisolar point + Show partitions - - + + - Show partitions + Show line - - - - Galactic Coordinates, System II (IAU 1958). - + + - Galactic grid + Antisolar point - - + + - Show line + Show celestial poles of J2000.0. - + Celestial poles (J2000) - - + + - This circle represents the outermost rim of Earth's shadow in the distance of the Moon. + Color of equator (J2000.0) - Earth penumbra + - - + + - Color of Apex and Antapex points + Show partitions - + - - + + + + Show celestial equator of J2000.0. + - Zenith and Nadir + Equator (J2000) - - - - Color of marker of center of FOV + + + + Supergalactic poles - - + + - Color of ecliptic (of date) + Show line - + - - + + - Color of the ecliptic poles (J2000.0) + Label partitions - + - - + + + + Show ecliptic line of J2000.0 (VSOP87A fundamental plane). + - Supergalactic poles + Ecliptic (J2000) - - + + - Show line + Label partitions - - + + - Color of the solstice points (of date) + Show ecliptic poles of J2000.0 - + Ecliptic poles (J2000) + + + + + + Show ecliptic line of current date. + + + Ecliptic (of date) + + + + + + + Mark Solar positions along the Ecliptic + + + with Solar Dates + + + + + diff --git a/src/tests/testDates.cpp b/src/tests/testDates.cpp index 6abcb2b827c32..1021cfd5c276c 100644 --- a/src/tests/testDates.cpp +++ b/src/tests/testDates.cpp @@ -28,6 +28,7 @@ #include #include +#include "VecMath.hpp" #include "StelUtils.hpp" #define IGREG 2299161 @@ -420,35 +421,35 @@ void TestDates::testNumberOfDaysInMonthInYear() { QVariantList data; - data << 2019 << 1 << 31; - data << 2019 << 2 << 28; - data << 2019 << 3 << 31; - data << 2019 << 4 << 30; - data << 2019 << 5 << 31; - data << 2019 << 6 << 30; - data << 2019 << 7 << 31; - data << 2019 << 8 << 31; - data << 2019 << 9 << 30; + data << 2019 << 1 << 31; + data << 2019 << 2 << 28; + data << 2019 << 3 << 31; + data << 2019 << 4 << 30; + data << 2019 << 5 << 31; + data << 2019 << 6 << 30; + data << 2019 << 7 << 31; + data << 2019 << 8 << 31; + data << 2019 << 9 << 30; data << 2019 << 10 << 31; data << 2019 << 11 << 30; data << 2019 << 12 << 31; - data << 2020 << 1 << 31; - data << 2020 << 2 << 29; - data << 2020 << 3 << 31; - data << 2020 << 4 << 30; - data << 2020 << 5 << 31; - data << 2020 << 6 << 30; - data << 2020 << 7 << 31; - data << 2020 << 8 << 31; - data << 2020 << 9 << 30; + data << 2020 << 1 << 31; + data << 2020 << 2 << 29; + data << 2020 << 3 << 31; + data << 2020 << 4 << 30; + data << 2020 << 5 << 31; + data << 2020 << 6 << 30; + data << 2020 << 7 << 31; + data << 2020 << 8 << 31; + data << 2020 << 9 << 30; data << 2020 << 10 << 31; data << 2020 << 11 << 30; data << 2020 << 12 << 31; - data << 2020 << 0 << 31; + data << 2020 << 0 << 31; data << 2020 << 13 << 31; - data << 1852 << 1 << 31; - data << 1852 << 2 << 29; - data << 1851 << 2 << 28; + data << 1852 << 1 << 31; + data << 1852 << 2 << 29; + data << 1851 << 2 << 28; while (data.count()>=3) { @@ -468,13 +469,13 @@ void TestDates::testNumberOfDaysInMonthInYear() void TestDates::testFixedFromGregorian() { QVariantList data; - // year month day days - data << 1 << 1 << 1 << 1; - data << 8 << 8 << 27 << 2796; - data << 632 << 6 << 19 << 230638; - data << 1792 << 9 << 22 << 654415; + // year month day days + data << 1 << 1 << 1 << 1; + data << 8 << 8 << 27 << 2796; + data << 632 << 6 << 19 << 230638; + data << 1792 << 9 << 22 << 654415; data << 1858 << 11 << 17 << 678576; - data << 1970 << 1 << 1 << 719163; + data << 1970 << 1 << 1 << 719163; data << 1945 << 11 << 12 << 710347; while (data.count()>=4) @@ -556,6 +557,18 @@ void TestDates::testDatesFromJD() } } +void TestDates::testDayInYear() +{ + QVERIFY2(StelUtils::dayInYear(1978, 11, 14)==318, qPrintable(QString("dayInYear(1978, 11, 14)=%1, not 318").arg(QString::number(StelUtils::dayInYear(1978, 11, 14))))); + QVERIFY2(StelUtils::dayInYear(1988, 4, 22)==113, qPrintable(QString("dayInYear(1988, 4, 22)=%1, not 113").arg(QString::number(StelUtils::dayInYear(1988, 4, 22))))); +} + +void TestDates::testDateFromDayYear() +{ + QVERIFY2(StelUtils::dateFromDayYear(318, 1978) == Vec3i(1978, 11, 14), qPrintable(QString("dateFromDayYear(318, 1978) =%1, not 1978, 11, 14").arg(StelUtils::dateFromDayYear(318, 1978).toString() ))); + QVERIFY2(StelUtils::dateFromDayYear(113, 1988) == Vec3i(1988, 4, 22), qPrintable(QString("dateFromDayYear(113, 1988) =%1, not 1988, 4, 22").arg(StelUtils::dateFromDayYear(113, 1988).toString() ))); +} + #define TJ1 (2450000) void TestDates::benchmarkOldGetDateFromJulianDay() diff --git a/src/tests/testDates.hpp b/src/tests/testDates.hpp index 79e81c75be71f..a1eaf9f374a4e 100644 --- a/src/tests/testDates.hpp +++ b/src/tests/testDates.hpp @@ -36,6 +36,8 @@ private slots: void testFixedFromGregorian(); void testWeekdays(); void testDatesFromJD(); + void testDayInYear(); + void testDateFromDayYear(); void benchmarkOldGetDateFromJulianDay(); void benchmarkGetDateFromJulianDayFloatingPoint(); void benchmarkGetDateFromJulianDay();