Index: /trunk/FACT++/src/drivectrl.cc
===================================================================
--- /trunk/FACT++/src/drivectrl.cc	(revision 15205)
+++ /trunk/FACT++/src/drivectrl.cc	(revision 15206)
@@ -1125,44 +1125,9 @@
     Time fSunRise;
 
-    Time GetSunRise(const Time &time=Time())
-    {
-#ifdef HAVE_LIBNOVA
-        const double lon = -(17.+53./60+26.525/3600);
-        const double lat =   28.+45./60+42.462/3600;
-
-        ln_lnlat_posn observer;
-        observer.lng = lon;
-        observer.lat = lat;
-
-        // This caluclates the sun-rise of the next day after 12:00 noon
-        ln_rst_time sun_day;
-        if (ln_get_solar_rst(time.JD(), &observer, &sun_day)==1)
-        {
-            T::Fatal("GetSunRise reported the sun to be circumpolar!");
-            return Time(Time::none);
-        }
-
-        if (Time(sun_day.rise)>=time)
-            return Time(sun_day.rise);
-
-        if (ln_get_solar_rst(time.JD()+0.5, &observer, &sun_day)==1)
-        {
-            T::Fatal("GetSunRise reported the sun to be circumpolar!");
-            return Time(Time::none);
-        }
-
-        return Time(sun_day.rise);
-#else
-        return Time(boost::date_time::pos_infin);
-#endif
-    }
-
     int ShiftSunRise()
     {
         const Time sunrise = fSunRise;
 
-        fSunRise = GetSunRise(Time());
-        if (!fSunRise)
-            return T::kSM_FatalError;
+        fSunRise = Time().GetNextSunRise();
 
         if (sunrise==fSunRise)
@@ -1219,5 +1184,5 @@
     StateMachineDrive(ostream &out=cout) :
         T(out, "DRIVE_CONTROL"), ba::io_service::work(static_cast<ba::io_service&>(*this)),
-        fDrive(*this, *this), fAutoResume(false), fSunRise(GetSunRise())
+        fDrive(*this, *this), fAutoResume(false), fSunRise(Time().GetNextSunRise())
     {
         // State names
