diff --git a/.hgignore b/.hgignore index cd3cbf1..84161eb 100644 --- a/.hgignore +++ b/.hgignore @@ -3,6 +3,7 @@ Release\* Debug\* *.o RunTest +SatTrack *.txt *.orig *.a diff --git a/Makefile b/Makefile index 8ec7cd0..ae85ef2 100644 --- a/Makefile +++ b/Makefile @@ -17,16 +17,23 @@ OBJECTS=$(SOURCES:.cpp=.o) SGP4LIB=libsgp4.a TESTPROG=RunTest -TESTSOURCES=RunTest.cpp -TESTOBJECTS=$(TESTSOURCES:.cpp=.o) +TESTPROGSOURCES=RunTest.cpp +TESTPROGOBJECTS=$(TESTPROGSOURCES:.cpp=.o) -all: $(SGP4LIB) ${TESTPROG} +SATTRACK=SatTrack +SATTRACKSOURCES=SatTrack.cpp +SATTRACKOBJECTS=$(SATTRACKSOURCES:.cpp=.o) + +all: $(SGP4LIB) ${TESTPROG} ${SATTRACK} ${SGP4LIB}: ${OBJECTS} ${AR} -rcs -o $@ ${OBJECTS} -${TESTPROG}: ${SGP4LIB} ${TESTOBJECTS} - $(CC) ${TESTOBJECTS} $(LDFLAGS) -static -L. -lsgp4 -o $@ +${TESTPROG}: ${SGP4LIB} ${TESTPROGOBJECTS} + $(CC) ${TESTPROGOBJECTS} $(LDFLAGS) -static -L. -lsgp4 -o $@ + +${SATTRACK}: ${SGP4LIB} ${SATTRACKOBJECTS} + ${CC} ${SATTRACKOBJECTS} ${LDFLAGS} -static -L. -lsgp4 -o $@ .cpp.o: $(CC) $(CFLAGS) $< -o $@ diff --git a/SatTrack.cpp b/SatTrack.cpp new file mode 100644 index 0000000..342fa76 --- /dev/null +++ b/SatTrack.cpp @@ -0,0 +1,26 @@ +#include "Observer.h" +#include "SGP4.h" + +#include + +int main() { + + Observer obs(51.37322,0.089607,0.05); + Tle tle = Tle("ISS (ZARYA) ", + "1 25544U 98067A 11146.36888985 .00025753 00000-0 16912-3 0 4201", + "2 25544 51.6504 272.6534 0003891 329.5510 71.2188 15.75539412717473"); + SGP4 sgp4; + sgp4.SetTle(tle); + Eci eci; + + while(1) { + Julian now; + sgp4.FindPosition(&eci, now); + CoordTopographic topo = obs.GetLookAngle(eci); + CoordGeodetic geo = eci.ToGeodetic(); + std::cout << topo << " "; + std::cout << geo << std::endl; + }; + + return 0; +}