fg_time.* becomes sg_time.*, FGTime becomes SGTime ...
This commit is contained in:
@@ -34,7 +34,7 @@
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* void CelestialBody::updatePosition(fgTIME *t, Star *ourSun)
|
||||
* void CelestialBody::updatePosition(SGTime *t, Star *ourSun)
|
||||
*
|
||||
* Basically, this member function provides a general interface for
|
||||
* calculating the right ascension and declinaion. This function is
|
||||
@@ -45,14 +45,14 @@
|
||||
* position is calculated an a slightly different manner.
|
||||
*
|
||||
* arguments:
|
||||
* fgTIME t: provides the current time.
|
||||
* SGTime t: provides the current time.
|
||||
* Star *ourSun: the sun's position is needed to convert heliocentric
|
||||
* coordinates into geocentric coordinates.
|
||||
*
|
||||
* return value: none
|
||||
*
|
||||
*************************************************************************/
|
||||
void CelestialBody::updatePosition(FGTime *t, Star *ourSun)
|
||||
void CelestialBody::updatePosition(SGTime *t, Star *ourSun)
|
||||
{
|
||||
double eccAnom, v, ecl, actTime,
|
||||
xv, yv, xh, yh, zh, xg, yg, zg, xe, ye, ze;
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
|
||||
#include <simgear/constants.h>
|
||||
#include <simgear/timing/fg_time.hxx>
|
||||
#include <simgear/timing/sg_time.hxx>
|
||||
|
||||
class Star;
|
||||
|
||||
@@ -61,8 +61,8 @@ protected: // make the data protected, in order to give the
|
||||
double lonEcl, latEcl;
|
||||
|
||||
double fgCalcEccAnom(double M, double e);
|
||||
double fgCalcActTime(FGTime *t);
|
||||
void updateOrbElements(FGTime *t);
|
||||
double fgCalcActTime(SGTime *t);
|
||||
void updateOrbElements(SGTime *t);
|
||||
|
||||
public:
|
||||
CelestialBody(double Nf, double Ns,
|
||||
@@ -70,7 +70,7 @@ public:
|
||||
double wf, double ws,
|
||||
double af, double as,
|
||||
double ef, double es,
|
||||
double Mf, double Ms, FGTime *t);
|
||||
double Mf, double Ms, SGTime *t);
|
||||
CelestialBody(double Nf, double Ns,
|
||||
double If, double Is,
|
||||
double wf, double ws,
|
||||
@@ -84,7 +84,7 @@ public:
|
||||
double getMagnitude();
|
||||
double getLon();
|
||||
double getLat();
|
||||
void updatePosition(FGTime *t, Star *ourSun);
|
||||
void updatePosition(SGTime *t, Star *ourSun);
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
@@ -112,7 +112,7 @@ inline CelestialBody::CelestialBody(double Nf, double Ns,
|
||||
double wf, double ws,
|
||||
double af, double as,
|
||||
double ef, double es,
|
||||
double Mf, double Ms, FGTime *t)
|
||||
double Mf, double Ms, SGTime *t)
|
||||
{
|
||||
NFirst = Nf; NSec = Ns;
|
||||
iFirst = If; iSec = Is;
|
||||
@@ -139,15 +139,15 @@ inline CelestialBody::CelestialBody(double Nf, double Ns,
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* inline void CelestialBody::updateOrbElements(FGTime *t)
|
||||
* inline void CelestialBody::updateOrbElements(SGTime *t)
|
||||
* given the current time, this private member calculates the actual
|
||||
* orbital elements
|
||||
*
|
||||
* Arguments: FGTime *t: the current time:
|
||||
* Arguments: SGTime *t: the current time:
|
||||
*
|
||||
* return value: none
|
||||
***************************************************************************/
|
||||
inline void CelestialBody::updateOrbElements(FGTime *t)
|
||||
inline void CelestialBody::updateOrbElements(SGTime *t)
|
||||
{
|
||||
double actTime = fgCalcActTime(t);
|
||||
M = DEG_TO_RAD * (MFirst + (MSec * actTime));
|
||||
@@ -158,7 +158,7 @@ inline void CelestialBody::updateOrbElements(FGTime *t)
|
||||
a = aFirst + (aSec * actTime);
|
||||
}
|
||||
/*****************************************************************************
|
||||
* inline double CelestialBody::fgCalcActTime(FGTime *t)
|
||||
* inline double CelestialBody::fgCalcActTime(SGTime *t)
|
||||
* this private member function returns the offset in days from the epoch for
|
||||
* wich the orbital elements are calculated (Jan, 1st, 2000).
|
||||
*
|
||||
@@ -166,7 +166,7 @@ inline void CelestialBody::updateOrbElements(FGTime *t)
|
||||
*
|
||||
* return value: the (fractional) number of days until Jan 1, 2000.
|
||||
****************************************************************************/
|
||||
inline double CelestialBody::fgCalcActTime(FGTime *t)
|
||||
inline double CelestialBody::fgCalcActTime(SGTime *t)
|
||||
{
|
||||
return (t->getMjd() - 36523.5);
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ FGEphemeris::~FGEphemeris( void ) {
|
||||
|
||||
// Update (recalculate) the positions of all objects for the specified
|
||||
// time
|
||||
void FGEphemeris::update( FGTime *t, double lat ) {
|
||||
void FGEphemeris::update( SGTime *t, double lat ) {
|
||||
// update object positions
|
||||
our_sun->updatePosition( t );
|
||||
moon->updatePosition( t, lat, our_sun );
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
#include <plib/sg.h>
|
||||
|
||||
#include <simgear/timing/fg_time.hxx>
|
||||
#include <simgear/timing/sg_time.hxx>
|
||||
|
||||
#include "star.hxx"
|
||||
#include "moon.hxx"
|
||||
@@ -77,7 +77,7 @@ public:
|
||||
|
||||
// Update (recalculate) the positions of all objects for the
|
||||
// specified time
|
||||
void update(FGTime *t, double lat);
|
||||
void update(SGTime *t, double lat);
|
||||
|
||||
// sun
|
||||
inline Star *get_sun() const { return our_sun; }
|
||||
|
||||
@@ -31,13 +31,13 @@
|
||||
#include "jupiter.hxx"
|
||||
|
||||
/*************************************************************************
|
||||
* Jupiter::Jupiter(FGTime *t)
|
||||
* Jupiter::Jupiter(SGTime *t)
|
||||
* Public constructor for class Jupiter
|
||||
* Argument: The current time.
|
||||
* the hard coded orbital elements for Jupiter are passed to
|
||||
* CelestialBody::CelestialBody();
|
||||
************************************************************************/
|
||||
Jupiter::Jupiter(FGTime *t) :
|
||||
Jupiter::Jupiter(SGTime *t) :
|
||||
CelestialBody(100.4542, 2.7685400E-5,
|
||||
1.3030, -1.557E-7,
|
||||
273.8777, 1.6450500E-5,
|
||||
@@ -58,13 +58,13 @@ Jupiter::Jupiter() :
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* void Jupiter::updatePosition(FGTime *t, Star *ourSun)
|
||||
* void Jupiter::updatePosition(SGTime *t, Star *ourSun)
|
||||
*
|
||||
* calculates the current position of Jupiter, by calling the base class,
|
||||
* CelestialBody::updatePosition(); The current magnitude is calculated using
|
||||
* a Jupiter specific equation
|
||||
*************************************************************************/
|
||||
void Jupiter::updatePosition(FGTime *t, Star *ourSun)
|
||||
void Jupiter::updatePosition(SGTime *t, Star *ourSun)
|
||||
{
|
||||
CelestialBody::updatePosition(t, ourSun);
|
||||
magnitude = -9.25 + 5*log10( r*R ) + 0.014 * FV;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#ifndef _JUPITER_HXX_
|
||||
#define _JUPITER_HXX_
|
||||
|
||||
#include <simgear/timing/fg_time.hxx>
|
||||
#include <simgear/timing/sg_time.hxx>
|
||||
|
||||
#include "celestialBody.hxx"
|
||||
#include "star.hxx"
|
||||
@@ -32,9 +32,9 @@
|
||||
class Jupiter : public CelestialBody
|
||||
{
|
||||
public:
|
||||
Jupiter (FGTime *t);
|
||||
Jupiter (SGTime *t);
|
||||
Jupiter ();
|
||||
void updatePosition(FGTime *t, Star *ourSun);
|
||||
void updatePosition(SGTime *t, Star *ourSun);
|
||||
};
|
||||
|
||||
#endif // _JUPITER_HXX_
|
||||
|
||||
@@ -30,13 +30,13 @@
|
||||
#include "mars.hxx"
|
||||
|
||||
/*************************************************************************
|
||||
* Mars::Mars(FGTime *t)
|
||||
* Mars::Mars(SGTime *t)
|
||||
* Public constructor for class Mars
|
||||
* Argument: The current time.
|
||||
* the hard coded orbital elements for Mars are passed to
|
||||
* CelestialBody::CelestialBody();
|
||||
************************************************************************/
|
||||
Mars::Mars(FGTime *t) :
|
||||
Mars::Mars(SGTime *t) :
|
||||
CelestialBody(49.55740, 2.1108100E-5,
|
||||
1.8497, -1.78E-8,
|
||||
286.5016, 2.9296100E-5,
|
||||
@@ -55,13 +55,13 @@ Mars::Mars() :
|
||||
{
|
||||
}
|
||||
/*************************************************************************
|
||||
* void Mars::updatePosition(FGTime *t, Star *ourSun)
|
||||
* void Mars::updatePosition(SGTime *t, Star *ourSun)
|
||||
*
|
||||
* calculates the current position of Mars, by calling the base class,
|
||||
* CelestialBody::updatePosition(); The current magnitude is calculated using
|
||||
* a Mars specific equation
|
||||
*************************************************************************/
|
||||
void Mars::updatePosition(FGTime *t, Star *ourSun)
|
||||
void Mars::updatePosition(SGTime *t, Star *ourSun)
|
||||
{
|
||||
CelestialBody::updatePosition(t, ourSun);
|
||||
magnitude = -1.51 + 5*log10( r*R ) + 0.016 * FV;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#ifndef _MARS_HXX_
|
||||
#define _MARS_HXX_
|
||||
|
||||
#include <simgear/timing/fg_time.hxx>
|
||||
#include <simgear/timing/sg_time.hxx>
|
||||
|
||||
#include "celestialBody.hxx"
|
||||
#include "star.hxx"
|
||||
@@ -32,9 +32,9 @@
|
||||
class Mars : public CelestialBody
|
||||
{
|
||||
public:
|
||||
Mars ( FGTime *t);
|
||||
Mars ( SGTime *t);
|
||||
Mars ();
|
||||
void updatePosition(FGTime *t, Star *ourSun);
|
||||
void updatePosition(SGTime *t, Star *ourSun);
|
||||
};
|
||||
|
||||
#endif // _MARS_HXX_
|
||||
|
||||
@@ -30,13 +30,13 @@
|
||||
#include "mercury.hxx"
|
||||
|
||||
/*************************************************************************
|
||||
* Mercury::Mercury(FGTime *t)
|
||||
* Mercury::Mercury(SGTime *t)
|
||||
* Public constructor for class Mercury
|
||||
* Argument: The current time.
|
||||
* the hard coded orbital elements for Mercury are passed to
|
||||
* CelestialBody::CelestialBody();
|
||||
************************************************************************/
|
||||
Mercury::Mercury(FGTime *t) :
|
||||
Mercury::Mercury(SGTime *t) :
|
||||
CelestialBody (48.33130, 3.2458700E-5,
|
||||
7.0047, 5.00E-8,
|
||||
29.12410, 1.0144400E-5,
|
||||
@@ -55,13 +55,13 @@ Mercury::Mercury() :
|
||||
{
|
||||
}
|
||||
/*************************************************************************
|
||||
* void Mercury::updatePosition(FGTime *t, Star *ourSun)
|
||||
* void Mercury::updatePosition(SGTime *t, Star *ourSun)
|
||||
*
|
||||
* calculates the current position of Mercury, by calling the base class,
|
||||
* CelestialBody::updatePosition(); The current magnitude is calculated using
|
||||
* a Mercury specific equation
|
||||
*************************************************************************/
|
||||
void Mercury::updatePosition(FGTime *t, Star *ourSun)
|
||||
void Mercury::updatePosition(SGTime *t, Star *ourSun)
|
||||
{
|
||||
CelestialBody::updatePosition(t, ourSun);
|
||||
magnitude = -0.36 + 5*log10( r*R ) + 0.027 * FV + 2.2E-13 * pow(FV, 6);
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#ifndef _MERCURY_HXX_
|
||||
#define _MERCURY_HXX_
|
||||
|
||||
#include <simgear/timing/fg_time.hxx>
|
||||
#include <simgear/timing/sg_time.hxx>
|
||||
|
||||
#include "celestialBody.hxx"
|
||||
#include "star.hxx"
|
||||
@@ -32,9 +32,9 @@
|
||||
class Mercury : public CelestialBody
|
||||
{
|
||||
public:
|
||||
Mercury ( FGTime *t);
|
||||
Mercury ( SGTime *t);
|
||||
Mercury ();
|
||||
void updatePosition(FGTime *t, Star* ourSun);
|
||||
void updatePosition(SGTime *t, Star* ourSun);
|
||||
};
|
||||
|
||||
#endif // _MERURY_HXX_
|
||||
|
||||
@@ -39,14 +39,14 @@
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* Moon::Moon(FGTime *t)
|
||||
* Moon::Moon(SGTime *t)
|
||||
* Public constructor for class Moon. Initializes the orbital elements and
|
||||
* sets up the moon texture.
|
||||
* Argument: The current time.
|
||||
* the hard coded orbital elements for Moon are passed to
|
||||
* CelestialBody::CelestialBody();
|
||||
************************************************************************/
|
||||
Moon::Moon(FGTime *t) :
|
||||
Moon::Moon(SGTime *t) :
|
||||
CelestialBody(125.1228, -0.0529538083,
|
||||
5.1454, 0.00000,
|
||||
318.0634, 0.1643573223,
|
||||
@@ -73,12 +73,12 @@ Moon::~Moon()
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* void Moon::updatePosition(FGTime *t, Star *ourSun)
|
||||
* void Moon::updatePosition(SGTime *t, Star *ourSun)
|
||||
* this member function calculates the actual topocentric position (i.e.)
|
||||
* the position of the moon as seen from the current position on the surface
|
||||
* of the moon.
|
||||
****************************************************************************/
|
||||
void Moon::updatePosition(FGTime *t, double lat, Star *ourSun)
|
||||
void Moon::updatePosition(SGTime *t, double lat, Star *ourSun)
|
||||
{
|
||||
double
|
||||
eccAnom, ecl, actTime,
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
|
||||
#include <simgear/constants.h>
|
||||
#include <simgear/timing/fg_time.hxx>
|
||||
#include <simgear/timing/sg_time.hxx>
|
||||
|
||||
#include "celestialBody.hxx"
|
||||
#include "star.hxx"
|
||||
@@ -49,10 +49,10 @@ private:
|
||||
|
||||
public:
|
||||
|
||||
Moon( FGTime *t);
|
||||
Moon( SGTime *t);
|
||||
Moon();
|
||||
~Moon();
|
||||
void updatePosition(FGTime *t, double lat, Star *ourSun);
|
||||
void updatePosition(SGTime *t, double lat, Star *ourSun);
|
||||
// void newImage();
|
||||
};
|
||||
|
||||
|
||||
@@ -30,13 +30,13 @@
|
||||
#include "neptune.hxx"
|
||||
|
||||
/*************************************************************************
|
||||
* Neptune::Neptune(FGTime *t)
|
||||
* Neptune::Neptune(SGTime *t)
|
||||
* Public constructor for class Neptune
|
||||
* Argument: The current time.
|
||||
* the hard coded orbital elements for Neptune are passed to
|
||||
* CelestialBody::CelestialBody();
|
||||
************************************************************************/
|
||||
Neptune::Neptune(FGTime *t) :
|
||||
Neptune::Neptune(SGTime *t) :
|
||||
CelestialBody(131.7806, 3.0173000E-5,
|
||||
1.7700, -2.550E-7,
|
||||
272.8461, -6.027000E-6,
|
||||
@@ -55,13 +55,13 @@ Neptune::Neptune() :
|
||||
{
|
||||
}
|
||||
/*************************************************************************
|
||||
* void Neptune::updatePosition(FGTime *t, Star *ourSun)
|
||||
* void Neptune::updatePosition(SGTime *t, Star *ourSun)
|
||||
*
|
||||
* calculates the current position of Neptune, by calling the base class,
|
||||
* CelestialBody::updatePosition(); The current magnitude is calculated using
|
||||
* a Neptune specific equation
|
||||
*************************************************************************/
|
||||
void Neptune::updatePosition(FGTime *t, Star *ourSun)
|
||||
void Neptune::updatePosition(SGTime *t, Star *ourSun)
|
||||
{
|
||||
CelestialBody::updatePosition(t, ourSun);
|
||||
magnitude = -6.90 + 5*log10 (r*R) + 0.001 *FV;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#ifndef _NEPTUNE_HXX_
|
||||
#define _NEPTUNE_HXX_
|
||||
|
||||
#include <simgear/timing/fg_time.hxx>
|
||||
#include <simgear/timing/sg_time.hxx>
|
||||
|
||||
#include "celestialBody.hxx"
|
||||
#include "star.hxx"
|
||||
@@ -32,9 +32,9 @@
|
||||
class Neptune : public CelestialBody
|
||||
{
|
||||
public:
|
||||
Neptune ( FGTime *t);
|
||||
Neptune ( SGTime *t);
|
||||
Neptune ();
|
||||
void updatePosition(FGTime *t, Star *ourSun);
|
||||
void updatePosition(SGTime *t, Star *ourSun);
|
||||
};
|
||||
|
||||
#endif // _NEPTUNE_HXX_
|
||||
|
||||
@@ -30,13 +30,13 @@
|
||||
#include "saturn.hxx"
|
||||
|
||||
/*************************************************************************
|
||||
* Saturn::Saturn(FGTime *t)
|
||||
* Saturn::Saturn(SGTime *t)
|
||||
* Public constructor for class Saturn
|
||||
* Argument: The current time.
|
||||
* the hard coded orbital elements for Saturn are passed to
|
||||
* CelestialBody::CelestialBody();
|
||||
************************************************************************/
|
||||
Saturn::Saturn(FGTime *t) :
|
||||
Saturn::Saturn(SGTime *t) :
|
||||
CelestialBody(113.6634, 2.3898000E-5,
|
||||
2.4886, -1.081E-7,
|
||||
339.3939, 2.9766100E-5,
|
||||
@@ -56,13 +56,13 @@ Saturn::Saturn() :
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* void Saturn::updatePosition(FGTime *t, Star *ourSun)
|
||||
* void Saturn::updatePosition(SGTime *t, Star *ourSun)
|
||||
*
|
||||
* calculates the current position of Saturn, by calling the base class,
|
||||
* CelestialBody::updatePosition(); The current magnitude is calculated using
|
||||
* a Saturn specific equation
|
||||
*************************************************************************/
|
||||
void Saturn::updatePosition(FGTime *t, Star *ourSun)
|
||||
void Saturn::updatePosition(SGTime *t, Star *ourSun)
|
||||
{
|
||||
CelestialBody::updatePosition(t, ourSun);
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#ifndef _SATURN_HXX_
|
||||
#define _SATURN_HXX_
|
||||
|
||||
#include <simgear/timing/fg_time.hxx>
|
||||
#include <simgear/timing/sg_time.hxx>
|
||||
|
||||
#include "celestialBody.hxx"
|
||||
#include "star.hxx"
|
||||
@@ -32,9 +32,9 @@
|
||||
class Saturn : public CelestialBody
|
||||
{
|
||||
public:
|
||||
Saturn ( FGTime *t);
|
||||
Saturn ( SGTime *t);
|
||||
Saturn ();
|
||||
void updatePosition(FGTime *t, Star *ourSun);
|
||||
void updatePosition(SGTime *t, Star *ourSun);
|
||||
};
|
||||
|
||||
#endif // _SATURN_HXX_
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* Star::Star(FGTime *t)
|
||||
* Star::Star(SGTime *t)
|
||||
* Public constructor for class Star
|
||||
* Argument: The current time.
|
||||
* the hard coded orbital elements our sun are passed to
|
||||
@@ -42,7 +42,7 @@
|
||||
* note that the word sun is avoided, in order to prevent some compilation
|
||||
* problems on sun systems
|
||||
************************************************************************/
|
||||
Star::Star(FGTime *t) :
|
||||
Star::Star(SGTime *t) :
|
||||
CelestialBody (0.000000, 0.0000000000,
|
||||
0.0000, 0.00000,
|
||||
282.9404, 4.7093500E-5,
|
||||
@@ -70,11 +70,11 @@ Star::~Star()
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* void Star::updatePosition(FGTime *t, Star *ourSun)
|
||||
* void Star::updatePosition(SGTime *t, Star *ourSun)
|
||||
*
|
||||
* calculates the current position of our sun.
|
||||
*************************************************************************/
|
||||
void Star::updatePosition(FGTime *t)
|
||||
void Star::updatePosition(SGTime *t)
|
||||
{
|
||||
double
|
||||
actTime, eccAnom,
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#define _STAR_HXX_
|
||||
|
||||
|
||||
// #include <Time/fg_time.hxx>
|
||||
#include "celestialBody.hxx"
|
||||
|
||||
|
||||
@@ -39,10 +38,10 @@ private:
|
||||
|
||||
public:
|
||||
|
||||
Star (FGTime *t);
|
||||
Star (SGTime *t);
|
||||
Star ();
|
||||
~Star();
|
||||
void updatePosition(FGTime *t);
|
||||
void updatePosition(SGTime *t);
|
||||
double getM();
|
||||
double getw();
|
||||
double getxs();
|
||||
|
||||
@@ -30,13 +30,13 @@
|
||||
#include "uranus.hxx"
|
||||
|
||||
/*************************************************************************
|
||||
* Uranus::Uranus(FGTime *t)
|
||||
* Uranus::Uranus(SGTime *t)
|
||||
* Public constructor for class Uranus
|
||||
* Argument: The current time.
|
||||
* the hard coded orbital elements for Uranus are passed to
|
||||
* CelestialBody::CelestialBody();
|
||||
************************************************************************/
|
||||
Uranus::Uranus(FGTime *t) :
|
||||
Uranus::Uranus(SGTime *t) :
|
||||
CelestialBody(74.00050, 1.3978000E-5,
|
||||
0.7733, 1.900E-8,
|
||||
96.66120, 3.0565000E-5,
|
||||
@@ -56,13 +56,13 @@ Uranus::Uranus() :
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* void Uranus::updatePosition(FGTime *t, Star *ourSun)
|
||||
* void Uranus::updatePosition(SGTime *t, Star *ourSun)
|
||||
*
|
||||
* calculates the current position of Uranus, by calling the base class,
|
||||
* CelestialBody::updatePosition(); The current magnitude is calculated using
|
||||
* a Uranus specific equation
|
||||
*************************************************************************/
|
||||
void Uranus::updatePosition(FGTime *t, Star *ourSun)
|
||||
void Uranus::updatePosition(SGTime *t, Star *ourSun)
|
||||
{
|
||||
CelestialBody::updatePosition(t, ourSun);
|
||||
magnitude = -7.15 + 5*log10( r*R) + 0.001 * FV;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#ifndef _URANUS_HXX_
|
||||
#define _URANUS_HXX_
|
||||
|
||||
#include <simgear/timing/fg_time.hxx>
|
||||
#include <simgear/timing/sg_time.hxx>
|
||||
|
||||
#include "celestialBody.hxx"
|
||||
#include "star.hxx"
|
||||
@@ -32,9 +32,9 @@
|
||||
class Uranus : public CelestialBody
|
||||
{
|
||||
public:
|
||||
Uranus ( FGTime *t);
|
||||
Uranus ( SGTime *t);
|
||||
Uranus ();
|
||||
void updatePosition(FGTime *t, Star *ourSun);
|
||||
void updatePosition(SGTime *t, Star *ourSun);
|
||||
};
|
||||
|
||||
#endif // _URANUS_HXX_
|
||||
|
||||
@@ -30,13 +30,13 @@
|
||||
#include "venus.hxx"
|
||||
|
||||
/*************************************************************************
|
||||
* Venus::Venus(FGTime *t)
|
||||
* Venus::Venus(SGTime *t)
|
||||
* Public constructor for class Venus
|
||||
* Argument: The current time.
|
||||
* the hard coded orbital elements for Venus are passed to
|
||||
* CelestialBody::CelestialBody();
|
||||
************************************************************************/
|
||||
Venus::Venus(FGTime *t) :
|
||||
Venus::Venus(SGTime *t) :
|
||||
CelestialBody(76.67990, 2.4659000E-5,
|
||||
3.3946, 2.75E-8,
|
||||
54.89100, 1.3837400E-5,
|
||||
@@ -56,13 +56,13 @@ Venus::Venus() :
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* void Venus::updatePosition(FGTime *t, Star *ourSun)
|
||||
* void Venus::updatePosition(SGTime *t, Star *ourSun)
|
||||
*
|
||||
* calculates the current position of Venus, by calling the base class,
|
||||
* CelestialBody::updatePosition(); The current magnitude is calculated using
|
||||
* a Venus specific equation
|
||||
*************************************************************************/
|
||||
void Venus::updatePosition(FGTime *t, Star *ourSun)
|
||||
void Venus::updatePosition(SGTime *t, Star *ourSun)
|
||||
{
|
||||
CelestialBody::updatePosition(t, ourSun);
|
||||
magnitude = -4.34 + 5*log10( r*R ) + 0.013 * FV + 4.2E-07 * pow(FV,3);
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#ifndef _VENUS_HXX_
|
||||
#define _VENUS_HXX_
|
||||
|
||||
#include <simgear/timing/fg_time.hxx>
|
||||
#include <simgear/timing/sg_time.hxx>
|
||||
|
||||
#include "celestialBody.hxx"
|
||||
#include "star.hxx"
|
||||
@@ -32,9 +32,9 @@
|
||||
class Venus : public CelestialBody
|
||||
{
|
||||
public:
|
||||
Venus ( FGTime *t);
|
||||
Venus ( SGTime *t);
|
||||
Venus ();
|
||||
void updatePosition(FGTime *t, Star *ourSun);
|
||||
void updatePosition(SGTime *t, Star *ourSun);
|
||||
};
|
||||
|
||||
#endif // _VENUS_HXX_
|
||||
|
||||
@@ -3,14 +3,14 @@ includedir = @includedir@/timing
|
||||
lib_LIBRARIES = libsgtiming.a
|
||||
|
||||
include_HEADERS = \
|
||||
fg_time.hxx \
|
||||
geocoord.h \
|
||||
sg_time.hxx \
|
||||
timezone.h
|
||||
|
||||
libsgtiming_a_SOURCES = \
|
||||
fg_time.cxx \
|
||||
geocoord.cxx \
|
||||
lowleveltime.cxx lowleveltime.h \
|
||||
sg_time.cxx \
|
||||
timezone.cxx \
|
||||
# event.cxx event.hxx \
|
||||
# fg_timer.cxx fg_timer.hxx \
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// fg_time.cxx -- data structures and routines for managing time related stuff.
|
||||
// sg_time.cxx -- data structures and routines for managing time related stuff.
|
||||
//
|
||||
// Written by Curtis Olson, started August 1997.
|
||||
//
|
||||
@@ -58,7 +58,7 @@
|
||||
// #include <Main/options.hxx>
|
||||
// #include <Time/light.hxx>
|
||||
|
||||
#include "fg_time.hxx"
|
||||
#include "sg_time.hxx"
|
||||
#include "timezone.h"
|
||||
#include "lowleveltime.h"
|
||||
// #include "moonpos.hxx"
|
||||
@@ -73,11 +73,11 @@
|
||||
// #define TIME_ZONE_OFFSET_WORK 0 // default value
|
||||
|
||||
|
||||
FGTime::FGTime( const string& root )
|
||||
SGTime::SGTime( const string& root )
|
||||
{
|
||||
if (cur_time_params) {
|
||||
FG_LOG( FG_GENERAL, FG_ALERT,
|
||||
"Error: only one instance of FGTime allowed" );
|
||||
"Error: only one instance of SGTime allowed" );
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
@@ -94,13 +94,13 @@ FGTime::FGTime( const string& root )
|
||||
}
|
||||
|
||||
|
||||
FGTime::~FGTime()
|
||||
SGTime::~SGTime()
|
||||
{
|
||||
delete tzContainer;
|
||||
delete zonename;
|
||||
}
|
||||
|
||||
void FGTime::updateLocal( double lon, double lat, const string& root )
|
||||
void SGTime::updateLocal( double lon, double lat, const string& root )
|
||||
{
|
||||
time_t currGMT;
|
||||
time_t aircraftLocalTime;
|
||||
@@ -122,7 +122,7 @@ void FGTime::updateLocal( double lon, double lat, const string& root )
|
||||
|
||||
// Initialize the time dependent variables (maybe I'll put this in the
|
||||
// constructor later)
|
||||
void FGTime::init( double lon, double lat, const string& root,
|
||||
void SGTime::init( double lon, double lat, const string& root,
|
||||
time_t timeOffset, sgTimingOffsetType offsetType )
|
||||
{
|
||||
FG_LOG( FG_EVENT, FG_INFO, "Initializing Time" );
|
||||
@@ -208,7 +208,7 @@ void FGTime::init( double lon, double lat, const string& root,
|
||||
// modified Julian date (number of days elapsed since 1900 jan 0.5),
|
||||
// mjd. Adapted from Xephem.
|
||||
|
||||
void FGTime::cal_mjd (int mn, double dy, int yr)
|
||||
void SGTime::cal_mjd (int mn, double dy, int yr)
|
||||
{
|
||||
//static double last_mjd, last_dy;
|
||||
//double mjd;
|
||||
@@ -256,7 +256,7 @@ void FGTime::cal_mjd (int mn, double dy, int yr)
|
||||
|
||||
|
||||
// given an mjd, calculate greenwich mean sidereal time, gst
|
||||
void FGTime::utc_gst ()
|
||||
void SGTime::utc_gst ()
|
||||
{
|
||||
double day = floor(mjd-0.5)+0.5;
|
||||
double hr = (mjd-day)*24.0;
|
||||
@@ -276,7 +276,7 @@ void FGTime::utc_gst ()
|
||||
//
|
||||
// Provided courtesy of ecdowney@noao.edu (Elwood Downey)
|
||||
|
||||
double FGTime::sidereal_precise (double lng)
|
||||
double SGTime::sidereal_precise (double lng)
|
||||
{
|
||||
double lstTmp;
|
||||
|
||||
@@ -298,7 +298,7 @@ double FGTime::sidereal_precise (double lng)
|
||||
|
||||
|
||||
// return a courser but cheaper estimate of sidereal time
|
||||
double FGTime::sidereal_course(double lng)
|
||||
double SGTime::sidereal_course(double lng)
|
||||
{
|
||||
//struct tm *gmt;
|
||||
//double lstTmp;
|
||||
@@ -338,7 +338,7 @@ double FGTime::sidereal_course(double lng)
|
||||
|
||||
|
||||
// Update time variables such as gmt, julian date, and sidereal time
|
||||
void FGTime::update( double lon, double lat, double alt_m ) {
|
||||
void SGTime::update( double lon, double lat, double alt_m ) {
|
||||
double gst_precise, gst_course;
|
||||
|
||||
FG_LOG( FG_EVENT, FG_DEBUG, "Updating time" );
|
||||
@@ -408,7 +408,7 @@ void FGTime::update( double lon, double lat, double alt_m ) {
|
||||
|
||||
|
||||
/******************************************************************
|
||||
* The following are some functions that were included as FGTime
|
||||
* The following are some functions that were included as SGTime
|
||||
* members, although they currently don't make use of any of the
|
||||
* class's variables. Maybe this'll change in the future
|
||||
*****************************************************************/
|
||||
@@ -438,7 +438,7 @@ void FGTime::update( double lon, double lat, double alt_m ) {
|
||||
// If you are having problems with incorrectly positioned astronomical
|
||||
// bodies, this is a really good place to start looking.
|
||||
|
||||
time_t FGTime::get_gmt(int year, int month, int day, int hour, int min, int sec)
|
||||
time_t SGTime::get_gmt(int year, int month, int day, int hour, int min, int sec)
|
||||
{
|
||||
struct tm mt;
|
||||
|
||||
@@ -490,7 +490,7 @@ time_t FGTime::get_gmt(int year, int month, int day, int hour, int min, int sec)
|
||||
daylight = 1;
|
||||
} else if ( daylight < 0 ) {
|
||||
FG_LOG( FG_EVENT, FG_WARN,
|
||||
"OOOPS, problem in fg_time.cxx, no daylight savings info." );
|
||||
"OOOPS, problem in sg_time.cxx, no daylight savings info." );
|
||||
}
|
||||
|
||||
long int offset = -(timezone / 3600 - daylight);
|
||||
@@ -509,7 +509,7 @@ time_t FGTime::get_gmt(int year, int month, int day, int hour, int min, int sec)
|
||||
}
|
||||
|
||||
// Fix up timezone if using ftime()
|
||||
long int FGTime::fix_up_timezone( long int timezone_orig )
|
||||
long int SGTime::fix_up_timezone( long int timezone_orig )
|
||||
{
|
||||
#if !defined( HAVE_GETTIMEOFDAY ) && defined( HAVE_FTIME )
|
||||
// ftime() needs a little extra help finding the current timezone
|
||||
@@ -522,7 +522,7 @@ long int FGTime::fix_up_timezone( long int timezone_orig )
|
||||
}
|
||||
|
||||
|
||||
char* FGTime::format_time( const struct tm* p, char* buf )
|
||||
char* SGTime::format_time( const struct tm* p, char* buf )
|
||||
{
|
||||
sprintf( buf, "%d/%d/%2d %d:%02d:%02d",
|
||||
p->tm_mon, p->tm_mday, p->tm_year,
|
||||
@@ -531,14 +531,4 @@ char* FGTime::format_time( const struct tm* p, char* buf )
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
// Force an update of the sky and lighting parameters
|
||||
void FGTime::local_update_sky_and_lighting_params( void ) {
|
||||
fgUpdateSunPos();
|
||||
fgUpdateMoonPos();
|
||||
cur_light_params.Update();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
FGTime* FGTime::cur_time_params = 0;
|
||||
SGTime* SGTime::cur_time_params = 0;
|
||||
@@ -1,8 +1,8 @@
|
||||
// fg_time.hxx -- data structures and routines for managing time related stuff.
|
||||
// sg_time.hxx -- data structures and routines for managing time related stuff.
|
||||
//
|
||||
// Written by Curtis Olson, started August 1997.
|
||||
//
|
||||
// Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
|
||||
// Copyright (C) 1997 Curtis L. Olson - curt@flightgear.org
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
@@ -21,8 +21,8 @@
|
||||
// $Id$
|
||||
|
||||
|
||||
#ifndef _FG_TIME_HXX
|
||||
#define _FG_TIME_HXX
|
||||
#ifndef _SG_TIME_HXX
|
||||
#define _SG_TIME_HXX
|
||||
|
||||
|
||||
#ifndef __cplusplus
|
||||
@@ -65,7 +65,7 @@ enum sgTimingOffsetType {
|
||||
|
||||
|
||||
// Define a structure containing time parameters
|
||||
class FGTime {
|
||||
class SGTime {
|
||||
|
||||
private:
|
||||
// tzContainer stores all the current Timezone control points/
|
||||
@@ -113,8 +113,8 @@ private:
|
||||
|
||||
public:
|
||||
|
||||
FGTime( const string& root );
|
||||
~FGTime();
|
||||
SGTime( const string& root );
|
||||
~SGTime();
|
||||
|
||||
inline double getJD() const { return jd; };
|
||||
inline double getMjd() const { return mjd; };
|
||||
@@ -138,9 +138,9 @@ public:
|
||||
void utc_gst();
|
||||
double sidereal_precise (double lng);
|
||||
double sidereal_course(double lng);
|
||||
static FGTime *cur_time_params;
|
||||
static SGTime *cur_time_params;
|
||||
|
||||
// Some other stuff which were changed to FGTime members on
|
||||
// Some other stuff which were changed to SGTime members on
|
||||
// questionable grounds -:)
|
||||
// time_t get_start_gmt(int year);
|
||||
time_t get_gmt(int year, int month, int day,
|
||||
@@ -154,7 +154,7 @@ public:
|
||||
};
|
||||
|
||||
|
||||
inline time_t FGTime::get_gmt(struct tm* the_time) // this is just a wrapper
|
||||
inline time_t SGTime::get_gmt(struct tm* the_time) // this is just a wrapper
|
||||
{
|
||||
//printf("Using: %24s as input\n", asctime(the_time));
|
||||
return get_gmt(the_time->tm_year,
|
||||
@@ -166,4 +166,4 @@ inline time_t FGTime::get_gmt(struct tm* the_time) // this is just a wrapper
|
||||
}
|
||||
|
||||
|
||||
#endif // _FG_TIME_HXX
|
||||
#endif // _SG_TIME_HXX
|
||||
Reference in New Issue
Block a user