Index: trunk/MagicSoft/Cosy/gui/MGCosy.cc
===================================================================
--- trunk/MagicSoft/Cosy/gui/MGCosy.cc	(revision 1727)
+++ trunk/MagicSoft/Cosy/gui/MGCosy.cc	(revision 1758)
@@ -311,5 +311,6 @@
     TGCompositeFrame *tf2 = fTab->AddTab("Track");
     TGCompositeFrame *tf4 = fTab->AddTab("Calibration");
-    TGCompositeFrame *tf3 = fTab->AddTab("Demo");
+    TGCompositeFrame *tf5 = fTab->AddTab("Test SE");
+    /*TGCompositeFrame *tf3 =*/ fTab->AddTab("Demo");
 
     fCZdAz = new MGCoordinates(tf1, kETypeZdAz);
@@ -359,4 +360,17 @@
     l3 = new TGLabel(tf4, "the TPoint button. To set the Shaftencoder offset");
     l4 = new TGLabel(tf4, "use the Calib SE button.");
+    l1->Move(x, y);
+    l2->Move(x, y+h);
+    l3->Move(x, y+2*h);
+    l4->Move(x, y+3*h);
+    fList->Add(l1);
+    fList->Add(l2);
+    fList->Add(l3);
+    fList->Add(l4);
+
+    l1 = new TGLabel(tf5, "START starts histograming the differences of");
+    l2 = new TGLabel(tf5, "the two shaftencoders at the elevation axis.");
+    l3 = new TGLabel(tf5, "Use STOP to stop histograming and display the");
+    l4 = new TGLabel(tf5, "results on the screen.");
     l1->Move(x, y);
     l2->Move(x, y+h);
@@ -569,6 +583,6 @@
 }
 
-MGCosy::MGCosy(MsgQueue *q, const TGWindow *p, UInt_t w, UInt_t h)
-    : TGMainFrame(p, w, h), fQueue(q)
+MGCosy::MGCosy(MObservatory::LocationName_t key, MsgQueue *q, const TGWindow *p, UInt_t w, UInt_t h)
+    : TGMainFrame(p, w, h), fObservatory(key), fQueue(q)
 {
     fList = new MGList;
@@ -596,5 +610,5 @@
     cout << "MGCosy: Creating MGSkyPosition" << endl;
 #endif
-    fSkyPosition = new MGSkyPosition(f1, 300);
+    fSkyPosition = new MGSkyPosition(fObservatory, f1, 300);
 #ifdef DEBUG
     cout << "MGCosy: Creating MGAccuracy" << endl;
@@ -750,5 +764,5 @@
     static Int_t decs=~0;
 
-    static SlaStars sla;
+    static SlaStars sla(fObservatory);
     sla.SetMjd(mjd);
 
@@ -863,5 +877,5 @@
     fUtc->SetText(new TGString(text));
 
-    double mjd = time.CalcMjd();
+    double mjd = time.GetMjd();
 
     sprintf(text, "%12.6f", mjd);
@@ -1114,4 +1128,7 @@
                     return kTRUE;
                 case 3:
+                    fQueue->Proc(WM_TESTSE, (void*)1);
+                    return kTRUE;
+                case 4:
                     StartDemo();
                     return kTRUE;
@@ -1123,4 +1140,6 @@
                 StopDemo();
                 fQueue->PostMsg(WM_STOP, 0, 0);
+                if (fTab->GetCurrent()==3)
+                    fQueue->Proc(WM_TESTSE, NULL);
                 cout << "PostMsg (WM_Stop) returned." << endl;
                 return kTRUE;
Index: trunk/MagicSoft/Cosy/gui/MGCosy.h
===================================================================
--- trunk/MagicSoft/Cosy/gui/MGCosy.h	(revision 1727)
+++ trunk/MagicSoft/Cosy/gui/MGCosy.h	(revision 1758)
@@ -4,4 +4,8 @@
 #ifndef ROOT_TGFrame
 #include <TGFrame.h>
+#endif
+
+#ifndef MARS_MObservatory
+#include <MObservatory.h>
 #endif
 
@@ -31,4 +35,5 @@
 {
 private:
+    const MObservatory::LocationName_t fObservatory;
 
     //
@@ -104,5 +109,5 @@
 
 public:
-    MGCosy(MsgQueue *q, const TGWindow *p, UInt_t w, UInt_t h);
+    MGCosy(MObservatory::LocationName_t key, MsgQueue *q, const TGWindow *p, UInt_t w, UInt_t h);
     ~MGCosy();
 
Index: trunk/MagicSoft/Cosy/gui/MGSkyPosition.cc
===================================================================
--- trunk/MagicSoft/Cosy/gui/MGSkyPosition.cc	(revision 1727)
+++ trunk/MagicSoft/Cosy/gui/MGSkyPosition.cc	(revision 1758)
@@ -43,6 +43,6 @@
     //   Neptun     7.8
     //
-    fSlaPlanet = new SlaPlanets;
-    fSlaStar   = new SlaStars;
+    fSlaPlanet = new SlaPlanets(fObservatory);
+    fSlaStar   = new SlaStars(fObservatory);
 
     //
@@ -177,6 +177,6 @@
 }
 
-MGSkyPosition::MGSkyPosition(const TGWindow* p, const UInt_t w)
-    : MGEmbeddedCanvas("SkyPosition", p, w, 110)
+MGSkyPosition::MGSkyPosition(MObservatory::LocationName_t key, const TGWindow* p, const UInt_t w)
+    : MGEmbeddedCanvas("SkyPosition", p, w, 110), fObservatory(key)
 {
     DrawCoordinateSystem();
Index: trunk/MagicSoft/Cosy/gui/MGSkyPosition.h
===================================================================
--- trunk/MagicSoft/Cosy/gui/MGSkyPosition.h	(revision 1727)
+++ trunk/MagicSoft/Cosy/gui/MGSkyPosition.h	(revision 1758)
@@ -11,4 +11,8 @@
 #ifndef MGEMBEDDEDCANVAS_H
 #include "MGEmbeddedCanvas.h"
+#endif
+
+#ifndef MARS_MObservatory
+#include "MObservatory.h"
 #endif
 
@@ -46,4 +50,6 @@
     SlaPlanets *fSlaPlanet;
 
+    const MObservatory::LocationName_t fObservatory;
+
     Int_t fX[9];
     Int_t fY[9];
@@ -66,5 +72,5 @@
 
 public:
-    MGSkyPosition(const TGWindow* p, const UInt_t w);
+    MGSkyPosition(MObservatory::LocationName_t key, const TGWindow* p, const UInt_t w);
     ~MGSkyPosition();
 
Index: trunk/MagicSoft/Cosy/gui/MGStarguider.cc
===================================================================
--- trunk/MagicSoft/Cosy/gui/MGStarguider.cc	(revision 1727)
+++ trunk/MagicSoft/Cosy/gui/MGStarguider.cc	(revision 1758)
@@ -72,6 +72,6 @@
 #define kZOOM 96
 
-MGStarguider::MGStarguider()
-: Camera(), TGMainFrame(gClient->GetRoot(), 768, 700), fDx((768-kZOOM)/2), fDy((512-kZOOM)/2)
+MGStarguider::MGStarguider(MObservatory::LocationName_t key)
+: Camera(), TGMainFrame(gClient->GetRoot(), 768, 700), fObservatory(key), fDx((768-kZOOM)/2), fDy((512-kZOOM)/2)
 {
     gVirtualX->GrabButton(fId, kButton2, /*kButtonPressMask|kButtonReleaseMask|*/kNone, kNone, kNone, kNone);
@@ -80,5 +80,5 @@
     fList = new MGList;
 
-    fSao = new StarCatalog;
+    fSao = new StarCatalog(fObservatory);
     fRaDec = new RaDec(180, 40);
 
@@ -612,5 +612,5 @@
 
         MStarList stars;
-        fSao->GetStars(stars, time.CalcMjd(), *fRaDec);
+        fSao->GetStars(stars, time.GetMjd(), *fRaDec);
         fSao->GetImg(c, cimg, stars);
         //fSao->GetImg(c, cimg, time.CalcMjd(), *fRaDec);
Index: trunk/MagicSoft/Cosy/gui/MGStarguider.h
===================================================================
--- trunk/MagicSoft/Cosy/gui/MGStarguider.h	(revision 1727)
+++ trunk/MagicSoft/Cosy/gui/MGStarguider.h	(revision 1758)
@@ -11,4 +11,8 @@
 #include "MGList.h"
 #include "MGImage.h"
+
+#ifndef MARS_MObservatory
+#include "MObservatory.h"
+#endif
 
 class AltAz;
@@ -56,4 +60,6 @@
     TTimer *fTimer;
 
+    const MObservatory::LocationName_t fObservatory;
+
     Int_t fDx;
     Int_t fDy;
@@ -70,5 +76,5 @@
 
 public:
-    MGStarguider();
+    MGStarguider(MObservatory::LocationName_t key);
     virtual ~MGStarguider();
 
