diff --git a/plugins/Satellites/src/Satellite.cpp b/plugins/Satellites/src/Satellite.cpp index a7d93385fdc1b..16cd2e663f619 100644 --- a/plugins/Satellites/src/Satellite.cpp +++ b/plugins/Satellites/src/Satellite.cpp @@ -224,7 +224,9 @@ Satellite::Satellite(const QString& identifier, const QVariantMap& map) { gSatWrapper::BELOW_HORIZON, N_("The satellite is below the horizon") } }; - update(0.); + StelCore *core = StelApp::getInstance().getCore(); + double JD=core->getJD(); + update(core, JD, 0.); } Satellite::~Satellite() @@ -810,12 +812,12 @@ void Satellite::recomputeSatData() calculateSatDataFromLine2(tleElements.second); } -void Satellite::update(double) +void Satellite::update(StelCore *core, double JD, double deltaTime) { + Q_UNUSED(deltaTime) if (pSatWrapper && orbitValid) { - StelCore* core = StelApp::getInstance().getCore(); - epochTime = core->getJD(); // + timeShift; // We have "true" JD (UTC) from core, satellites don't need JDE! + epochTime = JD; // + timeShift; // We have "true" JD (UTC) from core, satellites don't need JDE! pSatWrapper->setEpoch(epochTime); position = pSatWrapper->getTEMEPos(); diff --git a/plugins/Satellites/src/Satellite.hpp b/plugins/Satellites/src/Satellite.hpp index e848c4966cdf0..5f65990e61d43 100644 --- a/plugins/Satellites/src/Satellite.hpp +++ b/plugins/Satellites/src/Satellite.hpp @@ -226,8 +226,11 @@ class Satellite : public StelObject //! the tleElements values and configures internal orbit parameters. void setNewTleElements(const QString& tle1, const QString& tle2); - // calculate faders, new position - void update(double deltaTime); + //! calculate faders, new position + //! @param core current StelCore + //! @param JD Julian day, UTC. (Satellites don't use JDE!) + //! @param deltaTime (currently unused) + void update(StelCore *core, double JD, double deltaTime); double getDoppler(double freq) const; static bool showLabels; diff --git a/plugins/Satellites/src/Satellites.cpp b/plugins/Satellites/src/Satellites.cpp index 434ed9d223ba1..eea88a8628aba 100644 --- a/plugins/Satellites/src/Satellites.cpp +++ b/plugins/Satellites/src/Satellites.cpp @@ -2809,7 +2809,8 @@ void Satellites::update(double deltaTime) if (!hintFader && hintFader.getInterstate() <= 0.f) return; - StelCore *core = StelApp::getInstance().getCore(); + static StelCore *core = StelApp::getInstance().getCore(); + double JD=core->getJD(); if (qAbs(core->getTimeRate())>=Satellite::timeRateLimit) // Do not show satellites when time rate is over limit return; @@ -2822,7 +2823,7 @@ void Satellites::update(double deltaTime) for (const auto& sat : std::as_const(satellites)) { if (sat->initialized && sat->displayed) - sat->update(deltaTime); + sat->update(core, JD, deltaTime); } } diff --git a/src/gui/AstroCalcDialog.cpp b/src/gui/AstroCalcDialog.cpp index bac4be40ca344..0137d136d8fcf 100644 --- a/src/gui/AstroCalcDialog.cpp +++ b/src/gui/AstroCalcDialog.cpp @@ -752,7 +752,7 @@ void AstroCalcDialog::drawAziVsTimeDiagram() #ifdef USE_STATIC_PLUGIN_SATELLITES if (isSatellite) { - sat->update(0.0); + sat->update(core, JD, 0.0); } else #endif @@ -5030,7 +5030,7 @@ void AstroCalcDialog::drawAltVsTimeDiagram() if (isSatellite) { // update data for that single satellite only - sat->update(0.0); + sat->update(core, JD, 0.0); } #endif StelUtils::rectToSphe(&az, &alt, selectedObject->getAltAzPosAuto(core));