Satellite.cpp   Satellite.cpp 
skipping to change at line 53 skipping to change at line 53
#include "gsatellite/gTime.hpp" #include "gsatellite/gTime.hpp"
#include "gsatellite/stdsat.h" #include "gsatellite/stdsat.h"
#include <cmath> #include <cmath>
#define sqr(a) ((a)*(a)) #define sqr(a) ((a)*(a))
// static data members - will be initialised in the Satallites class (the S telObjectMgr) // static data members - will be initialised in the Satallites class (the S telObjectMgr)
StelTextureSP Satellite::hintTexture; StelTextureSP Satellite::hintTexture;
float Satellite::showLabels = true; float Satellite::showLabels = true;
float Satellite::hintBrightness = 0.0; float Satellite::hintBrightness = 0.f;
float Satellite::hintScale = 1.f; float Satellite::hintScale = 1.f;
SphericalCap Satellite::viewportHalfspace = SphericalCap(); SphericalCap Satellite::viewportHalfspace = SphericalCap();
int Satellite::orbitLineSegments = 90; int Satellite::orbitLineSegments = 90;
int Satellite::orbitLineFadeSegments = 4; int Satellite::orbitLineFadeSegments = 4;
int Satellite::orbitLineSegmentDuration = 20; int Satellite::orbitLineSegmentDuration = 20;
bool Satellite::orbitLinesFlag = true; bool Satellite::orbitLinesFlag = true;
bool Satellite::realisticModeFlag = false; bool Satellite::realisticModeFlag = false;
Vec3f Satellite::invisibleSatelliteColor = Vec3f(0.2,0.2,0.2); Vec3f Satellite::invisibleSatelliteColor = Vec3f(0.2f,0.2f,0.2f);
#ifdef IRIDIUM_SAT_TEXT_DEBUG #ifdef IRIDIUM_SAT_TEXT_DEBUG
QString Satellite::myText = ""; QString Satellite::myText = "";
#endif #endif
double Satellite::sunReflAngle = 180.; double Satellite::sunReflAngle = 180.;
double Satellite::timeShift = 0.; double Satellite::timeShift = 0.;
Satellite::Satellite(const QString& identifier, const QVariantMap& map) Satellite::Satellite(const QString& identifier, const QVariantMap& map)
: initialized(false) : initialized(false)
, displayed(true) , displayed(true)
, orbitDisplayed(false) , orbitDisplayed(false)
, userDefined(false) , userDefined(false)
, newlyAdded(false) , newlyAdded(false)
, orbitValid(false) , orbitValid(false)
, jdLaunchYearJan1(0) , jdLaunchYearJan1(0)
, stdMag(99.) , stdMag(99.)
, status(StatusUnknown)
, height(0.) , height(0.)
, range(0.) , range(0.)
, rangeRate(0.) , rangeRate(0.)
, hintColor(0.0,0.0,0.0) , hintColor(0.0,0.0,0.0)
, lastUpdated() , lastUpdated()
, pSatWrapper(NULL) , pSatWrapper(NULL)
, visibility(0) , visibility(0)
, phaseAngle(0.) , phaseAngle(0.)
, lastEpochCompForOrbit(0.) , lastEpochCompForOrbit(0.)
, epochTime(0.) , epochTime(0.)
skipping to change at line 110 skipping to change at line 111
if (name.isEmpty()) if (name.isEmpty())
return; return;
// If there are no such keys, these will be initialized with the def ault // If there are no such keys, these will be initialized with the def ault
// values given them above. // values given them above.
description = map.value("description", description).toString().trimm ed(); description = map.value("description", description).toString().trimm ed();
displayed = map.value("visible", displayed).toBool(); displayed = map.value("visible", displayed).toBool();
orbitDisplayed = map.value("orbitVisible", orbitDisplayed).toBool(); orbitDisplayed = map.value("orbitVisible", orbitDisplayed).toBool();
userDefined = map.value("userDefined", userDefined).toBool(); userDefined = map.value("userDefined", userDefined).toBool();
stdMag = map.value("stdMag", 99.f).toDouble(); stdMag = map.value("stdMag", 99.f).toDouble();
status = map.value("status", StatusUnknown).toInt();
// Satellite hint color // Satellite hint color
QVariantList list = map.value("hintColor", QVariantList()).toList(); QVariantList list = map.value("hintColor", QVariantList()).toList();
if (list.count() == 3) if (list.count() == 3)
{ {
hintColor[0] = list.at(0).toDouble(); hintColor[0] = list.at(0).toDouble();
hintColor[1] = list.at(1).toDouble(); hintColor[1] = list.at(1).toDouble();
hintColor[2] = list.at(2).toDouble(); hintColor[2] = list.at(2).toDouble();
} }
// Satellite orbit section color // Satellite orbit section color
skipping to change at line 184 skipping to change at line 186
pSatWrapper = NULL; pSatWrapper = NULL;
} }
} }
double Satellite::roundToDp(float n, int dp) double Satellite::roundToDp(float n, int dp)
{ {
// round n to dp decimal places // round n to dp decimal places
return floor(n * pow(10., dp) + .5) / pow(10., dp); return floor(n * pow(10., dp) + .5) / pow(10., dp);
} }
QString Satellite::getNameI18n() const
{
return q_(name);
}
QVariantMap Satellite::getMap(void) QVariantMap Satellite::getMap(void)
{ {
QVariantMap map; QVariantMap map;
map["name"] = name; map["name"] = name;
map["stdMag"] = stdMag; map["stdMag"] = stdMag;
map["status"] = status;
map["tle1"] = tleElements.first.data(); map["tle1"] = tleElements.first.data();
map["tle2"] = tleElements.second.data(); map["tle2"] = tleElements.second.data();
if (!description.isEmpty()) if (!description.isEmpty())
map["description"] = description; map["description"] = description;
map["visible"] = displayed; map["visible"] = displayed;
map["orbitVisible"] = orbitDisplayed; map["orbitVisible"] = orbitDisplayed;
if (userDefined) if (userDefined)
map.insert("userDefined", userDefined); map.insert("userDefined", userDefined);
skipping to change at line 242 skipping to change at line 250
return -10.; return -10.;
} }
QString Satellite::getInfoString(const StelCore *core, const InfoStringGrou p& flags) const QString Satellite::getInfoString(const StelCore *core, const InfoStringGrou p& flags) const
{ {
QString str; QString str;
QTextStream oss(&str); QTextStream oss(&str);
if (flags & Name) if (flags & Name)
{ {
oss << "<h2>" << name << "</h2>"; oss << "<h2>" << getNameI18n() << "</h2>";
if (!description.isEmpty()) if (!description.isEmpty())
{ {
// Let's convert possibile \n chars into <br/> in de scription of satellite // Let's convert possibile \n chars into <br/> in de scription of satellite
oss << q_(description).replace("\n", "<br/>") << "<b r/>"; oss << q_(description).replace("\n", "<br/>") << "<b r/>";
} }
} }
if (flags & CatalogNumber) if (flags & CatalogNumber)
{ {
QString catalogNumbers; QString catalogNumbers;
skipping to change at line 328 skipping to change at line 336
oss << "<br/>"; oss << "<br/>";
if (sunReflAngle>0) if (sunReflAngle>0)
{ // Iridium { // Iridium
oss << QString(q_("Sun reflection angle: %1%2")) oss << QString(q_("Sun reflection angle: %1%2"))
.arg(sunReflAngle,0,'f',1) .arg(sunReflAngle,0,'f',1)
.arg(QChar(0x00B0)); // Degree sign .arg(QChar(0x00B0)); // Degree sign
oss << "<br/>"; oss << "<br/>";
} }
if (status!=StatusUnknown)
oss << QString(q_("Operational status: %1")).arg(get
OperationalStatus()) << "<br/>";
//Visibility: Full text //Visibility: Full text
//TODO: Move to a more prominent place. //TODO: Move to a more prominent place.
switch (visibility) switch (visibility)
{ {
case RADAR_SUN: case RADAR_SUN:
oss << q_("The satellite and the observer ar e in sunlight.") << "<br/>"; oss << q_("The satellite and the observer ar e in sunlight.") << "<br/>";
break; break;
case VISIBLE: case VISIBLE:
oss << q_("The satellite is visible.") << "< br/>"; oss << q_("The satellite is visible.") << "< br/>";
break; break;
skipping to change at line 580 skipping to change at line 591
} }
return vmag; return vmag;
} }
// Calculate illumination fraction of artifical satellite // Calculate illumination fraction of artifical satellite
float Satellite::calculateIlluminatedFraction() const float Satellite::calculateIlluminatedFraction() const
{ {
return (1 + cos(phaseAngle))/2; return (1 + cos(phaseAngle))/2;
} }
QString Satellite::getOperationalStatus() const
{
QString statusStr = qc_("unknown", "operational status");
switch (status)
{
case StatusOperational:
statusStr = qc_("operational", "operational status")
;
break;
case StatusNonoperational:
statusStr = qc_("nonoperational", "operational statu
s");
break;
case StatusPartiallyOperational:
statusStr = qc_("partially operational", "operationa
l status");
break;
case StatusStandby:
statusStr = qc_("standby", "operational status");
break;
case StatusSpare:
statusStr = qc_("spare", "operational status");
break;
case StatusExtendedMission:
statusStr = qc_("extended mission", "operational sta
tus");
break;
case StatusDecayed:
statusStr = qc_("decayed", "operational status");
break;
default:
statusStr = qc_("unknown", "operational status");
break;
}
return statusStr;
}
double Satellite::getAngularSize(const StelCore*) const double Satellite::getAngularSize(const StelCore*) const
{ {
return 0.00001; return 0.00001;
} }
void Satellite::setNewTleElements(const QString& tle1, const QString& tle2) void Satellite::setNewTleElements(const QString& tle1, const QString& tle2)
{ {
if (pSatWrapper) if (pSatWrapper)
{ {
gSatWrapper *old = pSatWrapper; gSatWrapper *old = pSatWrapper;
 End of changes. 9 change blocks. 
3 lines changed or deleted 53 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/