Git commit 05ebd5b6cd04406e3764af4bf07442038ccaa54b by Jasem Mutlaq. Committed on 31/08/2015 at 21:57. Pushed by mutlaqja into branch 'gsoc2015-ekos'. Take UTC offset into consideration when converting from LT to UT and vice v= ersa M +16 -0 kstars/auxiliary/geolocation.cpp M +2 -3 kstars/auxiliary/geolocation.h http://commits.kde.org/kstars/05ebd5b6cd04406e3764af4bf07442038ccaa54b diff --git a/kstars/auxiliary/geolocation.cpp b/kstars/auxiliary/geolocatio= n.cpp index 5c8ea32..904bceb 100644 --- a/kstars/auxiliary/geolocation.cpp +++ b/kstars/auxiliary/geolocation.cpp @@ -183,4 +183,20 @@ void GeoLocation::setReadOnly(bool value) ReadOnly =3D value; } = +KStarsDateTime GeoLocation::UTtoLT( const KStarsDateTime &ut ) const +{ + KStarsDateTime lt =3D ut.addSecs( int( 3600.*TZ() ) ); + lt.setUtcOffset(int( 3600.*TZ())); + + return lt; +} + +KStarsDateTime GeoLocation::LTtoUT( const KStarsDateTime < ) const +{ + KStarsDateTime ut =3D lt.addSecs( int( -3600.*TZ() ) ); + ut.setUtcOffset(0); + + return ut; +} + = diff --git a/kstars/auxiliary/geolocation.h b/kstars/auxiliary/geolocation.h index c0b140a..5ffffe0 100644 --- a/kstars/auxiliary/geolocation.h +++ b/kstars/auxiliary/geolocation.h @@ -240,9 +240,8 @@ public: dms GSTtoLST( const dms &gst ) const { return dms( gst.Degrees() + Lon= gitude.Degrees() ); } dms LSTtoGST( const dms &lst ) const { return dms( lst.Degrees() - Lon= gitude.Degrees() ); } = - KStarsDateTime UTtoLT( const KStarsDateTime &ut ) const { return ut.ad= dSecs( int( 3600.*TZ() ) ); } - KStarsDateTime LTtoUT( const KStarsDateTime < ) const { return lt.ad= dSecs( int( -3600.*TZ() ) ); } - + KStarsDateTime UTtoLT( const KStarsDateTime &ut ) const; + KStarsDateTime LTtoUT( const KStarsDateTime < ) const; = /** Computes the velocity in km/s of an observer on the surface of the= Earth * referred to a system whose origin is the center of the Earth. The X= and