Index: trunk/MagicSoft/Cosy/gui/MGAccuracy.cc
===================================================================
--- trunk/MagicSoft/Cosy/gui/MGAccuracy.cc	(revision 1699)
+++ trunk/MagicSoft/Cosy/gui/MGAccuracy.cc	(revision 1701)
@@ -72,4 +72,5 @@
     axe = new TGaxis(  0, -60*4,  0, 60*4,  -4, 4,   304, "+-N");
     axe->SetTitle("Zd"); // \xb0
+    axe->SetLabelOffset(-0.02);
     axe->SetBit(kCanDelete);
     axe->Draw();
Index: trunk/MagicSoft/Cosy/gui/MGCosy.cc
===================================================================
--- trunk/MagicSoft/Cosy/gui/MGCosy.cc	(revision 1699)
+++ trunk/MagicSoft/Cosy/gui/MGCosy.cc	(revision 1701)
@@ -43,4 +43,5 @@
     kPB_TRACK,
     kPB_STOP,
+    kPB_HOME,
     kPB_CALCALTAZ,
     kPB_TPOINT,
@@ -98,5 +99,5 @@
 
     l = new TGLabel(f, "Mjd:");
-    l->Move(x-60, y+20);
+    l->Move(x-60, y+17);
     fList->Add(l);
 
@@ -104,18 +105,18 @@
     fMjd = new TGLabel(f, "00000.000000");
     fUtc->Move(x-25, y);
-    fMjd->Move(x-25, y+20);
+    fMjd->Move(x-25, y+17);
     fList->Add(fUtc);
     fList->Add(fMjd);
 
     l = new TGLabel(f, "SE-Az:");
-    l->Move(x-60, y+60);
+    l->Move(x-60, y+40);
     fList->Add(l);
 
     l = new TGLabel(f, "SE-Zd1:");
-    l->Move(x-60, y+80);
+    l->Move(x-60, y+57);
     fList->Add(l);
 
     l = new TGLabel(f, "SE-Zd2:");
-    l->Move(x-60, y+100);
+    l->Move(x-60, y+74);
     fList->Add(l);
 
@@ -127,7 +128,7 @@
     fLabel1[1]->SetTextJustify(kTextRight);
     fLabel1[2]->SetTextJustify(kTextRight);
-    fLabel1[0]->Move(x,    y+60);
-    fLabel1[1]->Move(x+43, y+60);
-    fLabel1[2]->Move(x+70, y+60);
+    fLabel1[0]->Move(x,    y+40);
+    fLabel1[1]->Move(x+43, y+40);
+    fLabel1[2]->Move(x+70, y+40);
     fList->Add(fLabel1[0]);
     fList->Add(fLabel1[1]);
@@ -144,7 +145,7 @@
     fLabel2[1]->SetTextJustify(kTextRight);
     fLabel2[2]->SetTextJustify(kTextRight);
-    fLabel2[0]->Move(x,    y+80);
-    fLabel2[1]->Move(x+43, y+80);
-    fLabel2[2]->Move(x+70, y+80);
+    fLabel2[0]->Move(x,    y+57);
+    fLabel2[1]->Move(x+43, y+57);
+    fLabel2[2]->Move(x+70, y+57);
     fList->Add(fLabel2[0]);
     fList->Add(fLabel2[1]);
@@ -161,7 +162,7 @@
     fLabel3[1]->SetTextJustify(kTextRight);
     fLabel3[2]->SetTextJustify(kTextRight);
-    fLabel3[0]->Move(x,    y+100);
-    fLabel3[1]->Move(x+43, y+100);
-    fLabel3[2]->Move(x+70, y+100);
+    fLabel3[0]->Move(x,    y+74);
+    fLabel3[1]->Move(x+43, y+74);
+    fLabel3[2]->Move(x+70, y+74);
     fList->Add(fLabel3[0]);
     fList->Add(fLabel3[1]);
@@ -172,9 +173,9 @@
 
     l = new TGLabel(f, "Offset-Zd:");
-    l->Move(x-60, y+140);
+    l->Move(x-60, y+102);
     fList->Add(l);
 
     l = new TGLabel(f, "Offset-Az:");
-    l->Move(x-60, y+160);
+    l->Move(x-60, y+119);
     fList->Add(l);
 
@@ -183,8 +184,57 @@
     fOffsetZd->SetTextJustify(kTextRight);
     fOffsetAz->SetTextJustify(kTextRight);
-    fOffsetZd->Move(x, y+140);
-    fOffsetAz->Move(x, y+160);
+    fOffsetZd->Move(x, y+102);
+    fOffsetAz->Move(x, y+119);
     fList->Add(fOffsetZd);
     fList->Add(fOffsetAz);
+
+    l = new TGLabel(f, "Ra (estimated):");
+    l->Move(x-60, y+142);
+    fList->Add(l);
+
+    l = new TGLabel(f, "Ra (soll):");
+    l->Move(x-60, y+159);
+    fList->Add(l);
+
+    l = new TGLabel(f, "Dec (estimated):");
+    l->Move(x-60, y+182);
+    fList->Add(l);
+
+    l = new TGLabel(f, "Dec (soll):");
+    l->Move(x-60, y+199);
+    fList->Add(l);
+
+    l = new TGLabel(f, "Zd (soll):");
+    l->Move(x-60, y+222);
+    fList->Add(l);
+
+    l = new TGLabel(f, "Az (soll):");
+    l->Move(x-60, y+239);
+    fList->Add(l);
+
+    fRaEst  = new TGLabel(f, "+000h 00.0m");
+    fDecEst = new TGLabel(f, "+000h 00.0m");
+    fRaSoll = new TGLabel(f, "+000h 00.0m");
+    fDecSoll = new TGLabel(f, "+000h 00.0m");
+    fZdSoll = new TGLabel(f, "+000h 00.0m");
+    fAzSoll = new TGLabel(f, "+000h 00.0m");
+    fRaEst->SetTextJustify(kTextRight);
+    fDecEst->SetTextJustify(kTextRight);
+    fRaSoll->SetTextJustify(kTextRight);
+    fDecSoll->SetTextJustify(kTextRight);
+    fZdSoll->SetTextJustify(kTextRight);
+    fAzSoll->SetTextJustify(kTextRight);
+    fRaEst->Move(x+30, y+142);
+    fRaSoll->Move(x+30, y+159);
+    fDecEst->Move(x+30, y+182);
+    fDecSoll->Move(x+30, y+199);
+    fZdSoll->Move(x+30, y+222);
+    fAzSoll->Move(x+30, y+239);
+    fList->Add(fRaEst);
+    fList->Add(fDecEst);
+    fList->Add(fRaSoll);
+    fList->Add(fDecSoll);
+    fList->Add(fZdSoll);
+    fList->Add(fAzSoll);
 
 
@@ -329,4 +379,11 @@
     fList->Add(but);
 
+    but = new TGTextButton(tf1, "Home", kPB_HOME);
+    but->Resize(80, 25);
+    but->Move(160, 197);
+    but->SetToolTipText("Initiate Home Drive.");
+    but->Associate(this);
+    fList->Add(but);
+
     but= new TGTextButton(tf2, "Calc Zd/Az",  kPB_CALCALTAZ);
     but->Resize(80, 25);
@@ -637,4 +694,62 @@
 }
 
+void MGCosy::UpdateRaDec(ZdAz &pos, double mjd, RaDec &radec)
+{
+    static Int_t rai=~0;
+    static Int_t deci=~0;
+    static Int_t ras=~0;
+    static Int_t decs=~0;
+
+    static SlaStars sla;
+    sla.SetMjd(mjd);
+
+    RaDec rd = sla.CalcRaDec(pos*2*TMath::Pi()/360);
+
+    char text[64];
+
+    rd.Ra(rd.Ra()  * 24/2/TMath::Pi());
+    rd.Dec(rd.Dec()*360/2/TMath::Pi());
+
+    radec.Ra(radec.Ra()  * 24/2/TMath::Pi());
+    radec.Dec(radec.Dec()*360/2/TMath::Pi());
+
+    RaDec test = rd*600;
+
+    if (rai!=(int)test.Ra())
+    {
+        rai = (int)test.Ra();
+        sprintf(text, "%c%dh %.1fm", rd.Ra()<0?'-':'+', abs((int)rd.Ra()), 0.1*(abs((int)test.Ra())%600));
+        fRaEst->SetText(new TGString(text));
+    }
+    if (deci!=(int)test.Dec())
+    {
+        deci = (int)test.Dec();
+        sprintf(text, "%c%dd %.1fm", rd.Dec()<0?'-':'+' , abs((int)rd.Dec()), 0.1*(abs((int)test.Dec())%600));
+        fDecEst->SetText(new TGString(text));
+    }
+
+    if (radec.Dec()>90|| radec.Dec()<-90)
+    {
+        radec.Ra(radec.Ra()+12);
+        radec.Dec(180-radec.Dec());
+    }
+    radec.Ra(fmod((radec.Ra()+48), 24));
+
+    test = radec*600;
+
+    if (ras!=(int)test.Ra())
+    {
+        ras = (int)test.Ra();
+        sprintf(text, "%c%dh %.1fm", radec.Ra()<0?'-':'+', abs((int)radec.Ra()), 0.1*(abs((int)test.Ra())%600));
+        fRaSoll->SetText(new TGString(text));
+    }
+    if (decs!=(int)test.Dec())
+    {
+        decs = (int)test.Dec();
+        sprintf(text, "%c%dd %.1fm", radec.Dec()<0?'-':'+' , abs((int)radec.Dec()), 0.1*(abs((int)test.Dec())%600));
+        fDecSoll->SetText(new TGString(text));
+    }
+}
+
 void MGCosy::UpdateOffset(ZdAz &off)
 {
@@ -647,5 +762,5 @@
     {
         zd = (Int_t)off.Zd();
-        sprintf(text, "%d", zd);
+        sprintf(text, "%dre", zd);
         fOffsetZd->SetText(new TGString(text));
     }
@@ -653,9 +768,34 @@
     {
         az = (Int_t)off.Az();
-        sprintf(text, "%d", az);
+        sprintf(text, "%dre", az);
         fOffsetAz->SetText(new TGString(text));
     }
 }
 
+void MGCosy::UpdateZdAz(ZdAz &soll)
+{
+    soll *= 360/2/TMath::Pi();
+
+    static Int_t zd=~0;
+    static Int_t az=~0;
+
+    char text[21];
+
+    ZdAz test = soll*600;
+
+    if (zd!=(int)test.Zd())
+    {
+        zd = (int)test.Zd();
+        sprintf(text, "%c%dh %.1fm", soll.Zd()<0?'-':'+', abs((int)soll.Zd()), 0.1*(abs((int)test.Zd())%600));
+        fZdSoll->SetText(new TGString(text));
+    }
+    if (az!=(int)test.Az())
+    {
+        az = (int)test.Az();
+        sprintf(text, "%c%dd %.1fm", soll.Az()<0?'-':'+' , abs((int)soll.Az()), 0.1*(abs((int)test.Az())%600));
+        fAzSoll->SetText(new TGString(text));
+    }
+}
+
 double MGCosy::UpdateTime()
 {
@@ -682,5 +822,6 @@
 }
 
-void MGCosy::Update(ZdAz pos, ZdAz acc, ZdAz vel, ZdAz off, UInt_t stat)
+void MGCosy::Update(ZdAz pos, ZdAz acc, ZdAz vel, ZdAz off, RaDec radec,
+                    ZdAz soll, UInt_t stat)
 {
     double mjd = UpdateTime();
@@ -689,4 +830,6 @@
     fVelocity->Update(vel);
     UpdateOffset(off);
+    UpdateRaDec(pos, mjd, radec);
+    UpdateZdAz(soll);
 
 #define kError     0x01
@@ -701,4 +844,8 @@
     EnableLabel(fStopping, stat&kStopping);
     EnableLabel(fStopped,  stat&kStopped);
+    EnableLabel(fRaSoll,   stat&kTracking);
+    EnableLabel(fDecSoll,  stat&kTracking);
+    EnableLabel(fZdSoll,   stat&kMoving);
+    EnableLabel(fAzSoll,   stat&kMoving);
 
     stat&kTracking ? fAccuracy->MapWindow() : fAccuracy->UnmapWindow();
@@ -706,10 +853,10 @@
     //    stat&kTracking ? fOffset->MapWindow()   : fOffset->UnmapWindow();
 
-    if (!fLog->TestBit(kHasChanged))
-        return;
-
-    fLog->MapSubwindows();
-    fLog->Layout();
-    fLog->ResetBit(kHasChanged);
+    if (fLog->TestBit(kHasChanged))
+    {
+        fLog->MapSubwindows();
+        fLog->Layout();
+        fLog->ResetBit(kHasChanged);
+    }
 }
 // ======================================================================
@@ -919,5 +1066,4 @@
                 StopDemo();
                 fQueue->PostMsg(WM_STOP, 0, 0);
-
                 cout << "PostMsg (WM_Stop) returned." << endl;
                 return kTRUE;
@@ -972,4 +1118,7 @@
                 fQueue->Proc(WM_RESETBENDING, NULL);
                 return kTRUE;
+            case kPB_HOME:
+                fQueue->PostMsg(WM_HOME, 0, 0);
+                return kTRUE;
 
             default:
Index: trunk/MagicSoft/Cosy/gui/MGCosy.h
===================================================================
--- trunk/MagicSoft/Cosy/gui/MGCosy.h	(revision 1699)
+++ trunk/MagicSoft/Cosy/gui/MGCosy.h	(revision 1701)
@@ -47,4 +47,13 @@
     TGLabel       *fOffsetAz;
 
+    TGLabel       *fRaEst;
+    TGLabel       *fDecEst;
+
+    TGLabel       *fRaSoll;
+    TGLabel       *fDecSoll;
+
+    TGLabel       *fZdSoll;
+    TGLabel       *fAzSoll;
+
     TGLabel       *fUtc;
     TGLabel       *fMjd;
@@ -83,4 +92,6 @@
     void EnableLabel(TGLabel *label, Bool_t stat);
     void UpdateOffset(ZdAz &off);
+    void UpdateZdAz(ZdAz &off);
+    void UpdateRaDec(ZdAz &pos, double mjd, RaDec &radec);
     double UpdateTime();
 
@@ -97,5 +108,5 @@
     TGListBox *GetLog() const { return fLog; }
 
-    void Update(ZdAz pos, ZdAz acc, ZdAz vel, ZdAz off, UInt_t stat);
+    void Update(ZdAz pos, ZdAz acc, ZdAz vel, ZdAz off, RaDec radec, ZdAz soll, UInt_t stat);
 
     Bool_t ProcessMessage(Long_t msg, Long_t mp1, Long_t mp2);
Index: trunk/MagicSoft/Cosy/gui/MGVelocity.cc
===================================================================
--- trunk/MagicSoft/Cosy/gui/MGVelocity.cc	(revision 1699)
+++ trunk/MagicSoft/Cosy/gui/MGVelocity.cc	(revision 1701)
@@ -123,4 +123,5 @@
     axe = new TGaxis(0, -60*2, 0, 60*2,  -2, 2,  304, "+-N");
     axe->SetTitle("Zd"); // \xb0
+    axe->SetLabelOffset(-0.02);
     axe->SetBit(kCanDelete);
     axe->Draw();
