MinorPlanet.cpp   MinorPlanet.cpp 
skipping to change at line 186 skipping to change at line 186
} }
QString MinorPlanet::getInfoString(const StelCore *core, const InfoStringGr oup &flags) const QString MinorPlanet::getInfoString(const StelCore *core, const InfoStringGr oup &flags) const
{ {
//Mostly copied from Planet::getInfoString(): //Mostly copied from Planet::getInfoString():
QString str; QString str;
QTextStream oss(&str); QTextStream oss(&str);
double az_app, alt_app; double az_app, alt_app;
StelUtils::rectToSphe(&az_app,&alt_app,getAltAzPosApparent(core)); StelUtils::rectToSphe(&az_app,&alt_app,getAltAzPosApparent(core));
bool withDecimalDegree = StelApp::getInstance().getFlagShowDecimalDe
grees();
double distanceAu = getJ2000EquatorialPos(core).length();
Q_UNUSED(az_app); Q_UNUSED(az_app);
if (flags&Name) if (flags&Name)
{ {
oss << "<h2>"; oss << "<h2>";
if (minorPlanetNumber) if (minorPlanetNumber)
oss << QString("(%1) ").arg(minorPlanetNumber); oss << QString("(%1) ").arg(minorPlanetNumber);
if (nameIsProvisionalDesignation) if (nameIsProvisionalDesignation)
oss << provisionalDesignationHtml; oss << provisionalDesignationHtml;
else else
skipping to change at line 217 skipping to change at line 219
} }
if (flags&ObjectType && getPlanetType()!=isUNDEFINED) if (flags&ObjectType && getPlanetType()!=isUNDEFINED)
{ {
oss << q_("Type: <b>%1</b>").arg(q_(getPlanetTypeString())) << "<br />"; oss << q_("Type: <b>%1</b>").arg(q_(getPlanetTypeString())) << "<br />";
} }
if (flags&Magnitude) if (flags&Magnitude)
{ {
if (core->getSkyDrawer()->getFlagHasAtmosphere() && (alt_app>-3. 0*M_PI/180.0)) // Don't show extincted magnitude much below horizon where m odel is meaningless. if (core->getSkyDrawer()->getFlagHasAtmosphere() && (alt_app>-3. 0*M_PI/180.0)) // Don't show extincted magnitude much below horizon where m odel is meaningless.
oss << q_("Magnitude: <b>%1</b> (extincted to: <b>%2</b>)"). arg(QString::number(getVMagnitude(core), 'f', 2), oss << q_("Magnitude: <b>%1</b> (after extinction: <b>%2</b> )").arg(QString::number(getVMagnitude(core), 'f', 2),
QString::number(getVMagnitudeWithExtinction(core), 'f', 2)) << "<br>"; QString::number(getVMagnitudeWithExtinction(core), 'f', 2)) << "<br>";
else else
oss << q_("Magnitude: <b>%1</b>").arg(getVMagnitude(core), 0 , 'f', 2) << "<br>"; oss << q_("Magnitude: <b>%1</b>").arg(getVMagnitude(core), 0 , 'f', 2) << "<br>";
} }
if (flags&AbsoluteMagnitude) if (flags&AbsoluteMagnitude)
{ {
//TODO: Make sure absolute magnitude is a sane value //TODO: Make sure absolute magnitude is a sane value
//If the H-G system is not used, use the default radius/albe do mechanism //If the H-G system is not used, use the default radius/albe do mechanism
if (slopeParameter < 0) if (slopeParameter < 0)
{ {
oss << q_("Absolute Magnitude: %1").arg(getVMagnitud e(core) - 5. * (std::log10(getJ2000EquatorialPos(core).length()*AU/PARSEC)- 1.), 0, 'f', 2) << "<br>"; oss << q_("Absolute Magnitude: %1").arg(getVMagnitud e(core) - 5. * (std::log10(distanceAu*AU/PARSEC)-1.), 0, 'f', 2) << "<br>";
} }
else else
{ {
oss << q_("Absolute Magnitude: %1").arg(absoluteMagn itude, 0, 'f', 2) << "<br>"; oss << q_("Absolute Magnitude: %1").arg(absoluteMagn itude, 0, 'f', 2) << "<br>";
} }
} }
oss << getPositionInfoString(core, flags); oss << getPositionInfoString(core, flags);
if (flags&Distance) if (flags&Distance)
{ {
double distanceAu = getJ2000EquatorialPos(core).length(); double hdistanceAu = getHeliocentricEclipticPos().length();
double hdistanceKm = AU * hdistanceAu;
if (englishName!="Sun")
{
if (hdistanceAu < 0.1)
{
// xgettext:no-c-format
oss << QString(q_("Distance from Sun: %1AU (
%2 km)"))
.arg(hdistanceAu, 0, 'f', 6)
.arg(hdistanceKm, 0, 'f', 3);
}
else
{
// xgettext:no-c-format
oss << QString(q_("Distance from Sun: %1AU (
%2 Mio km)"))
.arg(hdistanceAu, 0, 'f', 3)
.arg(hdistanceKm / 1.0e6, 0, 'f', 3);
}
oss << "<br>";
}
double distanceKm = AU * distanceAu; double distanceKm = AU * distanceAu;
if (distanceAu < 0.1) if (distanceAu < 0.1)
{ {
// xgettext:no-c-format // xgettext:no-c-format
oss << QString(q_("Distance: %1AU (%2 km)")) oss << QString(q_("Distance: %1AU (%2 km)"))
.arg(distanceAu, 0, 'f', 6) .arg(distanceAu, 0, 'f', 6)
.arg(distanceKm, 0, 'f', 3); .arg(distanceKm, 0, 'f', 3);
} }
else else
{ {
// xgettext:no-c-format // xgettext:no-c-format
oss << QString(q_("Distance: %1AU (%2 Mio km)")) oss << QString(q_("Distance: %1AU (%2 Mio km)"))
.arg(distanceAu, 0, 'f', 3) .arg(distanceAu, 0, 'f', 3)
.arg(distanceKm / 1.0e6, 0, 'f', 3); .arg(distanceKm / 1.0e6, 0, 'f', 3);
} }
oss << "<br>"; oss << "<br>";
} }
float aSize = 2.*getAngularSize(core)*M_PI/180.; float aSize = 2.*getAngularSize(core)*M_PI/180.;
if (flags&Size && aSize>1e-6) if (flags&Size && aSize>1e-6)
oss << q_("Apparent diameter: %1").arg(StelUtils::radToDmsSt {
r(aSize, true)) << "<br>"; if (withDecimalDegree)
oss << q_("Apparent diameter: %1").arg(StelUtils::ra
dToDecDegStr(aSize,5,false,true)) << "<br>";
else
oss << q_("Apparent diameter: %1").arg(StelUtils::ra
dToDmsStr(aSize, true)) << "<br>";
}
// If semi-major axis not zero then calculate and display orbital pe riod for asteroid in days // If semi-major axis not zero then calculate and display orbital pe riod for asteroid in days
double siderealPeriod = getSiderealPeriod(); double siderealPeriod = getSiderealPeriod();
if ((flags&Extra) && (siderealPeriod>0)) if ((flags&Extra) && (siderealPeriod>0))
{ {
// TRANSLATORS: Sidereal (orbital) period for solar system b odies in days and in Julian years (symbol: a) // TRANSLATORS: Sidereal (orbital) period for solar system b odies in days and in Julian years (symbol: a)
oss << q_("Sidereal period: %1 days (%2 a)").arg(QString::nu mber(siderealPeriod, 'f', 2)).arg(QString::number(siderealPeriod/365.25, 'f ', 3)) << "<br>"; oss << q_("Sidereal period: %1 days (%2 a)").arg(QString::nu mber(siderealPeriod, 'f', 2)).arg(QString::number(siderealPeriod/365.25, 'f ', 3)) << "<br>";
} }
postProcessInfoString(str, flags); postProcessInfoString(str, flags);
 End of changes. 5 change blocks. 
5 lines changed or deleted 35 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/