Telescope Control Library

Dependents:   PushToGo-F429

Committer:
caoyu@caoyuan9642-desktop.MIT.EDU
Date:
Mon Sep 10 02:41:05 2018 -0400
Revision:
9:d0413a9b1386
Parent:
0:6cb2eaf8b133
Child:
10:e356188d208e
Start to use LocationProvider
PEC implementing

Who changed what in which revision?

UserRevisionLine numberNew contents of line
caoyu@caoyuan9642-desktop.MIT.EDU 9:d0413a9b1386 1 #ifndef LOCATION_PROVIDER_H
caoyu@caoyuan9642-desktop.MIT.EDU 9:d0413a9b1386 2 #define LOCATION_PROVIDER_H
caoyuan9642 0:6cb2eaf8b133 3
caoyu@caoyuan9642-desktop.MIT.EDU 9:d0413a9b1386 4 #include "CelestialMath.h"
caoyuan9642 0:6cb2eaf8b133 5 /**
caoyu@caoyuan9642-desktop.MIT.EDU 9:d0413a9b1386 6 * Provides location information. Can be overriden if a GPS is installed for example.
caoyu@caoyuan9642-desktop.MIT.EDU 9:d0413a9b1386 7 */
caoyu@caoyuan9642-desktop.MIT.EDU 9:d0413a9b1386 8 class LocationProvider {
caoyuan9642 0:6cb2eaf8b133 9 public:
caoyu@caoyuan9642-desktop.MIT.EDU 9:d0413a9b1386 10 LocationProvider() {
caoyu@caoyuan9642-desktop.MIT.EDU 9:d0413a9b1386 11 }
caoyu@caoyuan9642-desktop.MIT.EDU 9:d0413a9b1386 12 virtual ~LocationProvider() {
caoyu@caoyuan9642-desktop.MIT.EDU 9:d0413a9b1386 13 }
caoyu@caoyuan9642-desktop.MIT.EDU 9:d0413a9b1386 14
caoyu@caoyuan9642-desktop.MIT.EDU 9:d0413a9b1386 15 virtual double getLongtitude() const {
caoyu@caoyuan9642-desktop.MIT.EDU 9:d0413a9b1386 16 return TelescopeConfiguration::getDouble("longtitude");
caoyu@caoyuan9642-desktop.MIT.EDU 9:d0413a9b1386 17 }
caoyuan9642 0:6cb2eaf8b133 18
caoyu@caoyuan9642-desktop.MIT.EDU 9:d0413a9b1386 19 virtual double getLatitude() const {
caoyu@caoyuan9642-desktop.MIT.EDU 9:d0413a9b1386 20 return TelescopeConfiguration::getDouble("latitude");
caoyu@caoyuan9642-desktop.MIT.EDU 9:d0413a9b1386 21 }
caoyuan9642 0:6cb2eaf8b133 22
caoyu@caoyuan9642-desktop.MIT.EDU 9:d0413a9b1386 23 LocationCoordinates getLocation() const {
caoyu@caoyuan9642-desktop.MIT.EDU 9:d0413a9b1386 24 return LocationCoordinates(getLatitude(), getLongtitude());
caoyu@caoyuan9642-desktop.MIT.EDU 9:d0413a9b1386 25 }
caoyuan9642 0:6cb2eaf8b133 26 };
caoyu@caoyuan9642-desktop.MIT.EDU 9:d0413a9b1386 27
caoyu@caoyuan9642-desktop.MIT.EDU 9:d0413a9b1386 28 #endif