Index: trunk/MagicSoft/Cosy/gui/MGCosy.cc
===================================================================
--- trunk/MagicSoft/Cosy/gui/MGCosy.cc	(revision 1784)
+++ trunk/MagicSoft/Cosy/gui/MGCosy.cc	(revision 1793)
@@ -48,4 +48,6 @@
     kPB_TPOINT,
     kPB_START,
+    kPB_DISPLAY1,
+    kPB_DISPLAY2,
     kPB_RAp,
     kPB_RAm,
@@ -345,6 +347,7 @@
     TGCompositeFrame *tf1 = fTab->AddTab("Position");
     TGCompositeFrame *tf2 = fTab->AddTab("Track");
-    TGCompositeFrame *tf4 = fTab->AddTab("Calibration");
+    TGCompositeFrame *tf4 = fTab->AddTab("Calib");
     TGCompositeFrame *tf5 = fTab->AddTab("Test SE");
+    TGCompositeFrame *tf6 = fTab->AddTab("Gear");
     /*TGCompositeFrame *tf3 =*/ fTab->AddTab("Demo");
 
@@ -418,4 +421,8 @@
     fList->Add(l3);
     fList->Add(l4);
+
+    l1 = new TGLabel(tf6, "FIXME Text missing / Only one axis?");
+    l1->Move(x, y);
+    fList->Add(l1);
 
     //
@@ -465,4 +472,18 @@
     fList->Add(but);
 
+    but = new TGTextButton(tf5, "Display", kPB_DISPLAY1);
+    but->Resize(80, 25);
+    but->Move(160, 197);
+    but->SetToolTipText("Display Histogram.");
+    but->Associate(this);
+    fList->Add(but);
+
+    but = new TGTextButton(tf6, "Display", kPB_DISPLAY2);
+    but->Resize(80, 25);
+    but->Move(160, 197);
+    but->SetToolTipText("Display Histogram.");
+    but->Associate(this);
+    fList->Add(but);
+
     but= new TGTextButton(tf2, "Calc Zd/Az",  kPB_CALCALTAZ);
     but->Resize(80, 25);
@@ -1190,4 +1211,7 @@
                     return kTRUE;
                 case 4:
+                    fQueue->Proc(WM_GEAR, (void*)1);
+                    return kTRUE;
+                case 5:
                     StartDemo();
                     return kTRUE;
@@ -1201,4 +1225,6 @@
                 if (fTab->GetCurrent()==3)
                     fQueue->Proc(WM_TESTSE, NULL);
+                if (fTab->GetCurrent()==4)
+                    fQueue->Proc(WM_GEAR, NULL);
                 cout << "PostMsg (WM_Stop) returned." << endl;
                 return kTRUE;
@@ -1256,4 +1282,8 @@
                 fQueue->PostMsg(WM_HOME, 0, 0);
                 return kTRUE;
+            case kPB_DISPLAY1:
+            case kPB_DISPLAY2:
+                fQueue->PostMsg(WM_DISPLAY, 0, 0);
+                return kTRUE;
 
             default:
Index: trunk/MagicSoft/Cosy/gui/MGSkyPosition.cc
===================================================================
--- trunk/MagicSoft/Cosy/gui/MGSkyPosition.cc	(revision 1784)
+++ trunk/MagicSoft/Cosy/gui/MGSkyPosition.cc	(revision 1793)
@@ -97,9 +97,15 @@
     // Reset 'static' positions of planets
     //
+    /*
     for (int i=0; i<9; i++)
     {
-        fX[i] = ~0;
-        fY[i] = ~0;
-    }
+        fPlanetX[i] = ~0;
+        fPlanetY[i] = ~0;
+    }
+    for (int i=0; i<13; i++)
+    {
+        fStarX[i] = ~0;
+        fStarY[i] = ~0;
+    }*/
 }
 
@@ -253,11 +259,29 @@
     const float c = cos(zdaz.Az());
 
-    const float x = s*zdaz.Zd()*kRad2Deg;             // [deg]
-    const float y = c*zdaz.Zd()*kRad2Deg;             // [deg]
+    float x = s*zdaz.Zd()*kRad2Deg;             // [deg]
+    float y = c*zdaz.Zd()*kRad2Deg;             // [deg]
+
+    if (x>95 || x<-95 || y>95 || y<-95)
+    {
+        if (arc->GetX1()==10 && arc->GetY1()==100)
+            return;
+
+        x=-100;
+        y= 100;
+    }
+
+    const int pixx = (int)(x/fPix);
+    const int pixy = (int)(y/fPix);
+
+    const int oldx = (int)(arc->GetX1()/fPix);
+    const int oldy = (int)(arc->GetY1()/fPix);
+
+    if (pixx==oldx && pixy==oldy)
+        return;
 
     arc->SetX1(x);
     arc->SetY1(y);
 
-    //SetModified(); ***MEMORY LEAK!!!***
+    SetModified(); //***MEMORY LEAK!!!***
 }
 
@@ -302,11 +326,11 @@
     SetLin2(x+dy, y-dx, x-dy, y+dx);
 
-    if (zd<80)
-    {
+    //if (zd<80)
+    //{
         for(int i=0; i<3; i++)
             SetDot(fDot[i], radec, i-3);
         for(int i=3; i<6; i++)
             SetDot(fDot[i], radec, i-2);
-    }
+    //}
 
     SetModified();
@@ -363,5 +387,4 @@
 
     RaDec radec = fSlaStar->CalcRaDecFast(pos*kDeg2Rad);
-
     UpdatePosition(radec, pos.Zd(), pos.Az());
     UpdateText(pos.Zd(), pos.Az());
@@ -387,15 +410,24 @@
     const float deg = zdaz.Zd()*kRad2Deg;
 
-    const float x = s*deg;
-    const float y = c*deg;
+    float x = s*deg;
+    float y = c*deg;
+
+    if (x>95 || x<-95 || y>95 || y<-95)
+    {
+        if (arc->GetX1()==10 && arc->GetY1()==100)
+            return;
+
+        x=-100;
+        y= 100;
+    }
 
     const int pixx = (int)(x/fPix);
     const int pixy = (int)(y/fPix);
 
-    if (fX[planet]==pixx && fY[planet]==pixy)
+    const int oldx = (int)(arc->GetX1()/fPix);
+    const int oldy = (int)(arc->GetY1()/fPix);
+
+    if (oldx==pixx && oldy==pixy)
         return;
-
-    fX[planet] = pixx;
-    fY[planet] = pixy;
 
     //
Index: trunk/MagicSoft/Cosy/gui/MGSkyPosition.h
===================================================================
--- trunk/MagicSoft/Cosy/gui/MGSkyPosition.h	(revision 1784)
+++ trunk/MagicSoft/Cosy/gui/MGSkyPosition.h	(revision 1793)
@@ -54,6 +54,9 @@
     const MObservatory::LocationName_t fObservatory;
 
-    Int_t fX[9];
-    Int_t fY[9];
+//    Int_t fStarX[13];
+//    Int_t fStarY[13];
+
+//    Int_t fPlanetX[9];
+//    Int_t fPlanetY[9];
 
     void InitArc(TArc *arc, Int_t fillstyle, Int_t fillcolor, Int_t linecolor);
