Rearranged variables to remove g++ warnings

Fixed bug in date generation
feature/19
Daniel Warner 2011-03-30 22:32:44 +01:00
parent d497544ca2
commit 4f49c85bb9
5 changed files with 13 additions and 11 deletions

2
Eci.h
View File

@ -27,9 +27,9 @@ public:
} }
private: private:
Julian date_;
Vector position_; Vector position_;
Vector velocity_; Vector velocity_;
Julian date_;
}; };
#endif #endif

View File

@ -28,7 +28,7 @@ Julian::Julian() {
struct tm gmt; struct tm gmt;
gmtime_r(&tv.tv_sec, &gmt); gmtime_r(&tv.tv_sec, &gmt);
Initialize(gmt.tm_year + 1900, Initialize(gmt.tm_year + 1900,
gmt.tm_mon, gmt.tm_mon + 1,
gmt.tm_mday, gmt.tm_mday,
gmt.tm_hour, gmt.tm_hour,
gmt.tm_min, gmt.tm_min,

View File

@ -2,12 +2,14 @@ CC=g++
CFLAGS=-c -Wall -g CFLAGS=-c -Wall -g
LDFLAGS= LDFLAGS=
SOURCES=Coord.cpp \ SOURCES=Coord.cpp \
Eci.cpp \
Globals.cpp \ Globals.cpp \
Julian.cpp \ Julian.cpp \
main.cpp \ Observer.cpp \
SGDP4.cpp \ SGDP4.cpp \
Tle.cpp \ Tle.cpp \
Vector.cpp Vector.cpp \
main.cpp
OBJECTS=$(SOURCES:.cpp=.o) OBJECTS=$(SOURCES:.cpp=.o)
EXECUTABLE=sat EXECUTABLE=sat

View File

@ -5,11 +5,12 @@
/* /*
* in degrees! * in degrees!
*/ */
Observer::Observer(const double latitude, const double longitude, const double altitude) Observer::Observer(const double latitude, const double longitude, const double altitude) {
: observers_eci_(Julian(), CoordGeodetic()) {
geo_.SetLatitude(Globals::Deg2Rad(latitude)); geo_.SetLatitude(Globals::Deg2Rad(latitude));
geo_.SetLongitude(Globals::Deg2Rad(longitude)); geo_.SetLongitude(Globals::Deg2Rad(longitude));
geo_.SetAltitude(altitude); geo_.SetAltitude(altitude);
observers_eci_ = Eci(Julian(), geo_);
} }
Observer::Observer(const CoordGeodetic &geo) Observer::Observer(const CoordGeodetic &geo)

View File

@ -29,15 +29,14 @@ public:
private: private:
void UpdateObserversEci(const Julian &date); void UpdateObserversEci(const Julian &date);
/*
* the observers eci for a particular time
*/
Eci observers_eci_;
/* /*
* the observers position * the observers position
*/ */
CoordGeodetic geo_; CoordGeodetic geo_;
/*
* the observers eci for a particular time
*/
Eci observers_eci_;
}; };
#endif #endif