Skip to content

Commit

Permalink
AstroCalc: add new category of celestial objects
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-w committed Oct 30, 2023
1 parent 21b42c6 commit b4acc7c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/gui/AstroCalcDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1010,6 +1010,7 @@ void AstroCalcDialog::populateCelestialCategoryList()
category->addItem(q_("Solar system objects: comets"), "201");
category->addItem(q_("Solar system objects: minor bodies"), "202");
category->addItem(q_("Solar system objects: planets"), "203");
category->addItem(q_("Almanac: Sun, Moon and naked-eye planets"), "204");

index = category->findData(selectedCategoryId, Qt::UserRole, Qt::MatchCaseSensitive);
if (index < 0) // read config data
Expand Down Expand Up @@ -1190,7 +1191,7 @@ void AstroCalcDialog::currentCelestialPositions()
}
}
}
else if (celTypeId >= 200 && celTypeId <= 203)
else if (celTypeId >= 200 && celTypeId <= 204)
{
QString distanceInfo = q_("Planetocentric distance");
if (core->getUseTopocentricCoordinates())
Expand All @@ -1212,6 +1213,12 @@ void AstroCalcDialog::currentCelestialPositions()
case 202:
planets = solarSystem->getAllMinorBodies();
break;
case 204:
const QStringList NEP = { "Moon", "Mercury", "Venus", "Mars", "Jupiter", "Saturn" };
planets.append(sun);
for (auto &planet: NEP)
planets.append(solarSystem->searchByEnglishName(planet));
break;
}

for (const auto& planet : qAsConst(planets))
Expand Down Expand Up @@ -1239,6 +1246,9 @@ void AstroCalcDialog::currentCelestialPositions()
if (planet->getPlanetType() == Planet::isPlanet)
passByType = true;
break;
case 204:
passByType = true;
break;
}

if (!planet->hasValidPositionalData(JD, Planet::PositionQuality::OrbitPlotting))
Expand Down

0 comments on commit b4acc7c

Please sign in to comment.