EquationOfTime.cpp   EquationOfTime.cpp 
skipping to change at line 130 skipping to change at line 130
sPainter.setFont(font); sPainter.setFont(font);
QString timeText; QString timeText;
double time = getSolutionEquationOfTime(core->getJDay()); double time = getSolutionEquationOfTime(core->getJDay());
if (getFlagInvertedValue()) if (getFlagInvertedValue())
time *= -1; time *= -1;
if (getFlagMsFormat()) if (getFlagMsFormat())
{ {
double seconds = std::abs(round((time - (int)time)*60)); int seconds = qRound((time - (int)time)*60);
QString messageSecondsValue; QString messageSecondsValue = QString("%1").arg(qAbs(seconds
if (seconds<10.) ), 2, 10, QLatin1Char('0'));
messageSecondsValue = QString("0%1").arg(QString::nu
mber(seconds, 'f', 0));
else
messageSecondsValue = QString("%1").arg(QString::num
ber(seconds, 'f', 0));
timeText = QString("%1: %2%3%4%5").arg(messageEquation, QStr ing::number((int)time), messageEquationMinutes, messageSecondsValue, messag eEquationSeconds); timeText = QString("%1: %2%3%4%5%6").arg(messageEquation, (t ime<0? QString(QLatin1Char('-')):QString()), QString::number((int)qAbs(time )), messageEquationMinutes, messageSecondsValue, messageEquationSeconds);
} }
else else
timeText = QString("%1: %2%3").arg(messageEquation, QString: :number(time, 'f', 2), messageEquationMinutes); timeText = QString("%1: %2%3").arg(messageEquation, QString: :number(time, 'f', 2), messageEquationMinutes);
QFontMetrics fm(font); QFontMetrics fm(font);
QSize fs = fm.size(Qt::TextSingleLine, timeText); QSize fs = fm.size(Qt::TextSingleLine, timeText);
if (core->getCurrentPlanet().data()->getEnglishName()=="Earth") if (core->getCurrentPlanet().data()->getEnglishName()=="Earth")
sPainter.drawText(gui->getSkyGui()->getSkyGuiWidth()/2 - fs. width()/2, gui->getSkyGui()->getSkyGuiHeight() - fs.height()*1.5, timeText) ; sPainter.drawText(gui->getSkyGui()->getSkyGuiWidth()/2 - fs. width()/2, gui->getSkyGui()->getSkyGuiHeight() - fs.height()*1.5, timeText) ;
//qDebug() << timeText; //qDebug() << timeText;
skipping to change at line 241 skipping to change at line 237
double ra, dec; double ra, dec;
StelUtils::rectToSphe(&ra, &dec, pos); StelUtils::rectToSphe(&ra, &dec, pos);
// covert radians to degrees and reduce the angle // covert radians to degrees and reduce the angle
double alpha = std::fmod(ra*180./M_PI, 360.); double alpha = std::fmod(ra*180./M_PI, 360.);
// force it to be the positive remainder, so that 0 <= angle < 360 // force it to be the positive remainder, so that 0 <= angle < 360
alpha = std::fmod(alpha + 360., 360.); alpha = std::fmod(alpha + 360., 360.);
double equation = 4*(sunMeanLongitude - 0.0057183 - alpha + get_nuta tion_longitude(JDay)*cos(get_mean_ecliptical_obliquity(JDay))); double equation = 4*(sunMeanLongitude - 0.0057183 - alpha + get_nuta tion_longitude(JDay)*cos(get_mean_ecliptical_obliquity(JDay)));
// The equation of time is always smaller 20 minutes in absolute val ue // The equation of time is always smaller 20 minutes in absolute val ue
if (std::abs(equation)>20) if (qAbs(equation)>20)
{ {
// If absolute value of the equation of time appears to be t oo large, add 24 hours (1440 minutes) to or subtract it from our result // If absolute value of the equation of time appears to be t oo large, add 24 hours (1440 minutes) to or subtract it from our result
if (equation>0.) if (equation>0.)
equation -= 1440.; equation -= 1440.;
else else
equation += 1440.; equation += 1440.;
} }
return equation; return equation;
} }
 End of changes. 3 change blocks. 
10 lines changed or deleted 5 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/