Index: trunk/FACT++/src/drivectrl.cc
===================================================================
--- trunk/FACT++/src/drivectrl.cc	(revision 19565)
+++ trunk/FACT++/src/drivectrl.cc	(revision 19572)
@@ -130,4 +130,16 @@
     double offset;
     array<double, 2> angles;
+
+    bool operator!=(const Source &cmp)
+    {
+        return
+            name      != cmp.name      ||
+            ra        != cmp.ra        ||
+            dec       != cmp.dec       ||
+            mag       != cmp.mag       ||
+            offset    != cmp.offset    ||
+            angles[0] != cmp.angles[0] ||
+            angles[1] != cmp.angles[1];
+    }
 };
 
@@ -2093,12 +2105,18 @@
         const string name(ptr);
 
-        const sources::const_iterator it = fSources.find(name);
-        if (it==fSources.end())
-        {
-            T::Error("Source '"+name+"' not found in list.");
-            throw uint32_t(T::GetCurrentState());
-        }
-
-        return it;
+        sources::const_iterator it = fSources.find(name);
+        if (it!=fSources.end())
+            return it;
+
+        T::Warn("Source '"+name+"' not found in list... reloading database.");
+
+        ReloadSources();
+
+        it = fSources.find(name);
+        if (it!=fSources.end())
+            return it;
+
+        T::Error("Source '"+name+"' still not found in list.");
+        throw uint32_t(T::GetCurrentState());
     }
 
@@ -2237,5 +2255,5 @@
     }
 
-    int StopMovement()
+    int StopMovement(bool reload=false)
     {
         fDrive.SetAcceleration(fAccMax);
@@ -2245,4 +2263,7 @@
 
         fDrive.UpdateSource(Time(), "", false);
+
+        if (reload)
+            ReloadSources();
 
         return State::kStopping;
@@ -2905,6 +2926,10 @@
 
         T::AddEvent("STOP")(State::kUnavailable)(State::kAvailable)(State::kArmed)(State::kInitialized)(State::kStopping)(State::kParking)(State::kMoving)(State::kApproaching)(State::kTracking)(State::kOnTrack)
-            (bind(&StateMachineDrive::StopMovement, this))
+            (bind(&StateMachineDrive::StopMovement, this, false))
             ("Stop any kind of movement.");
+
+        T::AddEvent("PREPARE_GRB")(State::kUnavailable)(State::kAvailable)(State::kArmed)(State::kInitialized)(State::kStopping)(State::kParking)(State::kMoving)(State::kApproaching)(State::kTracking)(State::kOnTrack)
+            (bind(&StateMachineDrive::StopMovement, this, true))
+            ("Combines STOP and RELOAD_SOURCES");
 
         T::AddEvent("RESET", State::kPositioningFailed, State::kAllowedRangeExceeded, State::kInvalidCoordinates, State::kHardwareWarning)
@@ -2995,4 +3020,6 @@
         const mysqlpp::StoreQueryResult res =
             db.query("SELECT fSourceName, fRightAscension, fDeclination, fWobbleOffset, fWobbleAngle0, fWobbleAngle1, fMagnitude FROM Source").store();
+
+        auto old = fSources;
 
         fSources.clear();
@@ -3011,11 +3038,29 @@
             AddSource(name, src);
 
-            if (!print)
-                continue;
-
             ostringstream msg;
             msg << " " << name << setprecision(8) << ":   Ra=" << src.ra << "h Dec=" << src.dec << "deg";
             msg << " Wobble=[" << src.offset << "," << src.angles[0] << "," << src.angles[1] << "] Mag=" << src.mag;
-            T::Message(msg);
+
+            const auto it = old.find(name);
+            if (it==old.end())
+               T::Message(" +"+msg.str());
+            else
+            {
+                if (print || it->second!=src)
+                {
+                   T::Message(" c"+msg.str());
+                   old.erase(it);
+                }
+            }
+        }
+
+        for (auto it=old.begin(); it!=old.end(); it++)
+        {
+            const auto &src = it->second;
+
+            ostringstream msg;
+            msg << " - " << it->first << setprecision(8) << ":   Ra=" << src.ra << "h Dec=" << src.dec << "deg";
+            msg << " Wobble=[" << src.offset << "," << src.angles[0] << "," << src.angles[1] << "] Mag=" << src.mag;
+            T::Message(msg.str());
         }
 #else
