From 4f49c85bb91eda2c84b021409d62b5f420820681 Mon Sep 17 00:00:00 2001 From: Daniel Warner Date: Wed, 30 Mar 2011 22:32:44 +0100 Subject: [PATCH] Rearranged variables to remove g++ warnings Fixed bug in date generation --- Eci.h | 2 +- Julian.cpp | 2 +- Makefile | 6 ++++-- Observer.cpp | 5 +++-- Observer.h | 9 ++++----- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Eci.h b/Eci.h index 6b5cd85..12b8215 100644 --- a/Eci.h +++ b/Eci.h @@ -27,9 +27,9 @@ public: } private: + Julian date_; Vector position_; Vector velocity_; - Julian date_; }; #endif diff --git a/Julian.cpp b/Julian.cpp index 3985fcf..652a73f 100644 --- a/Julian.cpp +++ b/Julian.cpp @@ -28,7 +28,7 @@ Julian::Julian() { struct tm gmt; gmtime_r(&tv.tv_sec, &gmt); Initialize(gmt.tm_year + 1900, - gmt.tm_mon, + gmt.tm_mon + 1, gmt.tm_mday, gmt.tm_hour, gmt.tm_min, diff --git a/Makefile b/Makefile index 15208f4..8b9bf87 100644 --- a/Makefile +++ b/Makefile @@ -2,12 +2,14 @@ CC=g++ CFLAGS=-c -Wall -g LDFLAGS= SOURCES=Coord.cpp \ + Eci.cpp \ Globals.cpp \ Julian.cpp \ - main.cpp \ + Observer.cpp \ SGDP4.cpp \ Tle.cpp \ - Vector.cpp + Vector.cpp \ + main.cpp OBJECTS=$(SOURCES:.cpp=.o) EXECUTABLE=sat diff --git a/Observer.cpp b/Observer.cpp index 9a4d3a1..6afcb2e 100644 --- a/Observer.cpp +++ b/Observer.cpp @@ -5,11 +5,12 @@ /* * in degrees! */ -Observer::Observer(const double latitude, const double longitude, const double altitude) -: observers_eci_(Julian(), CoordGeodetic()) { +Observer::Observer(const double latitude, const double longitude, const double altitude) { geo_.SetLatitude(Globals::Deg2Rad(latitude)); geo_.SetLongitude(Globals::Deg2Rad(longitude)); geo_.SetAltitude(altitude); + + observers_eci_ = Eci(Julian(), geo_); } Observer::Observer(const CoordGeodetic &geo) diff --git a/Observer.h b/Observer.h index e6acc27..ad1ffbd 100644 --- a/Observer.h +++ b/Observer.h @@ -29,15 +29,14 @@ public: private: void UpdateObserversEci(const Julian &date); - /* - * the observers eci for a particular time - */ - Eci observers_eci_; - /* * the observers position */ CoordGeodetic geo_; + /* + * the observers eci for a particular time + */ + Eci observers_eci_; }; #endif