Telescope Control Library
Diff: LocationProvider.h
- Revision:
- 9:d0413a9b1386
- Parent:
- 0:6cb2eaf8b133
- Child:
- 10:e356188d208e
diff -r 21a33760bf10 -r d0413a9b1386 LocationProvider.h --- a/LocationProvider.h Sun Sep 09 17:31:20 2018 -0400 +++ b/LocationProvider.h Mon Sep 10 02:41:05 2018 -0400 @@ -1,25 +1,28 @@ +#ifndef LOCATION_PROVIDER_H +#define LOCATION_PROVIDER_H +#include "CelestialMath.h" /** -* Provides location information. Can be overriden if a GPS is installed for example. -*/ -class LocationProvider -{ -protected: - double longtitude; - double latitude; + * Provides location information. Can be overriden if a GPS is installed for example. + */ +class LocationProvider { public: - LocationProvider() : longtitude(0), latitude(0) { - } - LocationProvider(double x, double y): longtitude(x), latitude(y) { - } - ~LocationProvider() { - } + LocationProvider() { + } + virtual ~LocationProvider() { + } + + virtual double getLongtitude() const { + return TelescopeConfiguration::getDouble("longtitude"); + } - virtual double getLongtitude() { - return longtitude; - } + virtual double getLatitude() const { + return TelescopeConfiguration::getDouble("latitude"); + } - virtual double getLatitude() { - return latitude; - } + LocationCoordinates getLocation() const { + return LocationCoordinates(getLatitude(), getLongtitude()); + } }; + +#endif