Commit 6f06cf26 authored by Samikshan Bairagya's avatar Samikshan Bairagya

Display short description for planets in details view.

parent 3bcc1ea5
......@@ -58,8 +58,8 @@ install( FILES kstars.png geomap.png
asteroids.dat comets.dat
wzstars.png wzgeo.png wzscope.png wzdownload.png chart.colors
classic.colors moonless-night.colors night.colors
tips TZrules.dat valaav.txt initWIList.dat Interesting.dat advinterface.dat satellites.dat
histogram.png noimage.png glossary.xml defaultflag.gif
tips TZrules.dat valaav.txt initWIList.dat Interesting.dat PlanetFacts.dat
advinterface.dat satellites.dat histogram.png noimage.png glossary.xml defaultflag.gif
DESTINATION ${DATA_INSTALL_DIR}/kstars
)
......
Mercury::Mercury is the innermost of the eight planets in the Solar System. It is also the smallest, and its orbit has the highest eccentricity of the eight. It orbits the Sun once in about 88 Earth days, completing three rotations about its axis for every two orbits. Mercury has the smallest axial tilt of the Solar System planets. The perihelion of Mercury's orbit precesses around the Sun at an excess of 43 arcseconds per century beyond what is predicted by Newtonian mechanics, a phenomenon that was explained in the 20th century by Albert Einstein's General Theory of Relativity. Mercury, being an inferior planet, appears as a morning star and an evening star, but is much more difficult to see than the other inferior planet, Venus. At its brightest, Mercury is technically a very bright object when viewed from Earth, but it is not easily seen in practice because of its proximity in the sky to the Sun.
Venus::Venus is the second planet from the Sun, orbiting it every 224.7 Earth days. The planet is named after Venus, the Roman goddess of love and beauty. After the Moon, it is the brightest natural object in the night sky, reaching an apparent magnitude of −4.6, bright enough to cast shadows. Because Venus is an inferior planet from Earth, it never appears to venture far from the Sun: its elongation reaches a maximum of 47.8°. Venus reaches its maximum brightness shortly before sunrise or shortly after sunset, for which reason it has been known as the Morning Star or Evening Star.
Mars::Mars is the fourth planet from the Sun in the Solar System. Named after the Roman god of war, Mars, it is often described as the "Red Planet" as the iron oxide prevalent on its surface gives it a reddish appearance. Mars is a terrestrial planet with a thin atmosphere, having surface features reminiscent both of the impact craters of the Moon and the volcanoes, valleys, deserts, and polar ice caps of Earth. The rotational period and seasonal cycles of Mars are likewise similar to those of Earth, as is the tilt that produces the seasons. Mars is the site of Olympus Mons, the highest known mountain within the Solar System, and of Valles Marineris, the largest canyon. The smooth Borealis basin in the northern hemisphere covers 40% of the planet and may be a giant impact feature. Mars can easily be seen from Earth with the naked eye. Its apparent magnitude reaches −3.0[7] a brightness surpassed only by Jupiter, Venus, the Moon, and the Sun.
Jupiter::Jupiter is the fifth planet from the Sun and the largest planet within the Solar System. It is a gas giant with mass one-thousandth that of the Sun but is two and a half times the mass of all the other planets in our Solar System combined. Jupiter is classified as a gas giant along with Saturn, Uranus and Neptune. Together, these four planets are sometimes referred to as the Jovian or outer planets. When viewed from Earth, Jupiter can reach an apparent magnitude of −2.94, making it on average the third-brightest object in the night sky after the Moon and Venus.
Saturn::Saturn is the sixth planet from the Sun and the second largest planet in the Solar System, after Jupiter. Named after the Roman god Saturn, its astronomical symbol (♄) represents the god's sickle. Saturn is a gas giant with an average radius about nine times that of Earth. While only one-eighth the average density of Earth, with its larger volume Saturn is just over 95 times as massive as Earth.
Uranus::Uranus is the seventh planet from the Sun. It has the third-largest planetary radius and fourth-largest planetary mass in the Solar System. It is named after the ancient Greek deity of the sky Uranus (Ancient Greek: Οὐρανός), the father of Cronus (Saturn) and grandfather of Zeus (Jupiter). Though it is visible to the naked eye like the five classical planets, it was never recognized as a planet by ancient observers because of its dimness and slow orbit. Sir William Herschel announced its discovery on March 13, 1781, expanding the known boundaries of the Solar System for the first time in modern history. Uranus was also the first planet discovered with a telescope.
Neptune::Neptune is the eighth and farthest planet from the Sun in the Solar System. It is the fourth-largest planet by diameter and the third largest by mass. Neptune is 17 times the mass of Earth and is somewhat more massive than its near-twin Uranus, which is 15 times the mass of Earth but not as dense. On average, Neptune orbits the Sun at a distance of 30.1 AU, approximately 30 times the Earth–Sun distance. Named for the Roman god of the sea, its astronomical symbol is ♆, a stylized version of the god Neptune's trident. Neptune was the first planet found by mathematical prediction rather than by empirical observation.
......@@ -157,14 +157,14 @@ Rectangle {
id: soname
objectName: "sonameObj"
x: 17
y: 24
width: 117
height: 51
y: 5
width: 273
height: 44
color: "#ffffff"
text: qsTr("text")
font.bold: true
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignBottom
font.pixelSize: 16
}
......@@ -172,16 +172,41 @@ Rectangle {
id: posText
objectName: "posTextObj"
x: 17
y: 111
y: 55
width: 273
height: 31
height: 26
color: "#ffffff"
text: qsTr("text")
horizontalAlignment: Text.AlignRight
font.underline: true
font.italic: true
font.bold: true
font.pixelSize: 12
}
Rectangle {
x: 0
y: 85
width: 305
height: 175
color: "#00000000"
Flickable {
id: flickable1
clip: true
flickableDirection: Flickable.VerticalFlick
anchors.fill: parent
Text {
id: descText
objectName: "descTextObj"
color: "#187988"
text: qsTr("text")
clip: true
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
anchors.fill: parent
font.pixelSize: 12
}
}
}
}
}
}
......@@ -140,7 +140,9 @@ void WIView::loadDetailsView(SkyObjItem* soitem)
{
QObject* sonameObj = detailsViewObj->findChild<QObject *>("sonameObj");
QObject* posTextObj = detailsViewObj->findChild<QObject *>("posTextObj");
QObject* descTextObj = detailsViewObj->findChild<QObject *>("descTextObj");
sonameObj->setProperty("text", soitem->getName());
posTextObj->setProperty("text", soitem->getPosition());
detailsViewObj->setProperty("visible", true);
descTextObj->setProperty("text", soitem->getDesc());
}
......@@ -15,6 +15,7 @@
* *
***************************************************************************/
#include "ksfilereader.h"
#include "kstarsdata.h"
#include "skyobjitem.h"
......@@ -67,3 +68,29 @@ void SkyObjItem::setPosition(SkyObject* so)
position = QString::number(rounded_altitude).append(" degrees above the ").append(cardinals[rounded_azimuth]).append(" horizon ");
kDebug()<<position;
}
QString SkyObjItem::getDesc()
{
if (type == "Planet"){
KSFileReader fileReader;
if ( !fileReader.open("PlanetFacts.dat") )
return QString("No Description found for selected sky-object");
while ( fileReader.hasMoreLines() )
{
QString line = fileReader.readLine();
if (line.split("::")[0] == name)
return line.split("::")[1];
}
}
else if (type == "Star")
{
return "Bright Star";
}
else if (type == "Constellation")
{
return "Constellation";
}
return QString("No Description found for selected sky-object");
}
......@@ -42,6 +42,7 @@ public:
void setPosition(SkyObject* so);
inline QString getPosition() { return position; }
inline SkyObject* getSkyObject() { return so; }
QString getDesc();
private:
QString name;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment