Index: trunk/MagicSoft/Cosy/gui/MGCosy.cc
===================================================================
--- trunk/MagicSoft/Cosy/gui/MGCosy.cc	(revision 2278)
+++ trunk/MagicSoft/Cosy/gui/MGCosy.cc	(revision 2280)
@@ -1,8 +1,10 @@
 #include "MGCosy.h"
 
+#include <iomanip.h>
 #include <iostream.h>
 
 #include "msgqueue.h"
 #include "coord.h"
+#include "slalib.h"
 
 #include <TROOT.h>
@@ -64,4 +66,6 @@
     kCB_PredefPos,
     kCB_StarList,
+    kPB_SavePreDef,
+    kPB_SaveStar,
 
     // kLog
@@ -323,12 +327,14 @@
     while (1)
     {
+        Double_t zd, az;
+        fin >> zd >> az;
+
         TString str;
-        Double_t zd, az;
-        fin >> str >> zd >> az;
+        str.ReadLine(fin);
         if (!fin)
             break;
+
         box->AddEntry(str, i++);
-
-        fStarList.Add(zd, az);
+        fPreDefList.Add(zd, az);
     }
 }
@@ -336,11 +342,10 @@
 void MGCosy::CreateStarList(TGCompositeFrame *tf1)
 {
-    /*
     TGComboBox *box = new TGComboBox(tf1, kCB_StarList);
-    box->Resize(120, 20);
+    box->Resize(170, 20);
     box->Associate(this);
 
     TGLayoutHints *lay = new TGLayoutHints(kLHintsLeft|kLHintsTop,
-                                           27, 0, 200, 0);
+                                           27, 0, 70, 0);
     tf1->AddFrame(box, lay);
 
@@ -358,7 +363,9 @@
     while (1)
     {
-        TString str;
         Int_t h, m, s, d, am, as;
         fin >> h >> m >> s >> d >> am >> as;
+
+        TString str;
+        str.ReadLine(fin);
         if (!fin)
             break;
@@ -366,7 +373,6 @@
         box->AddEntry(str, i++);
 
-        fStarList.Add(zd, az);
-        }
-        */
+        fStarList.Add(Slalib::Hms2Hor(h, m, s), Slalib::Dms2Deg(d, am, as));
+    }
 }
 
@@ -513,5 +519,26 @@
     fList->Add(but);
 
+    but = new TGTextButton(tf4, "TPoint", kPB_TPOINT);
+    but->Resize(50, 25);
+    but->Move(176/*231*/, 213);
+    but->SetToolTipText("Trigger writing a tpoint coordinate pair.");
+    but->Associate(this);
+    fList->Add(but);
+
 #ifdef EXPERT
+    but= new TGTextButton(tf1, "New Position",  kPB_SavePreDef);
+    but->Resize(80, 25);
+    but->Move(165, 197);
+    but->SetToolTipText("Save new predefined position.");
+    but->Associate(this);
+    fList->Add(but);
+
+    but= new TGTextButton(tf4, "New", kPB_SaveStar);
+    but->Resize(60, 23);
+    but->Move(211, 69);
+    but->SetToolTipText("Save new Source position.");
+    but->Associate(this);
+    fList->Add(but);
+
     but = new TGTextButton(tf5, "Display", kPB_DISPLAY1);
     but->Resize(80, 25);
@@ -528,13 +555,4 @@
     fList->Add(but);
 
-    /*
-    but = new TGTextButton(tf4, "Calib SE", kPB_CALIBSE);
-    but->Resize(80, 25);
-    but->Move(160, 197);
-    but->SetToolTipText("Set SE to given coordinates.");
-    but->Associate(this);
-    fList->Add(but);
-    */
-#ifdef EXPERT
     but = new TGTextButton(tf4, "Load", kPB_LoadBending);
     but->Resize(50, 25);
@@ -548,12 +566,4 @@
     but->Move(206, 185);
     but->SetToolTipText("Reset bending correction (coefficients=0)");
-    but->Associate(this);
-    fList->Add(but);
-#endif EXPERT
-
-    but = new TGTextButton(tf4, "TPoint", kPB_TPOINT);
-    but->Resize(50, 25);
-    but->Move(176/*231*/, 213);
-    but->SetToolTipText("Trigger writing a tpoint coordinate pair.");
     but->Associate(this);
     fList->Add(but);
@@ -893,16 +903,21 @@
     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());
+    UShort_t h, d;
+    Double_t hm, dm;
+    Char_t   sh, sd;
+
+    // Calculate Display values
+    Slalib::Rad2Hm(rd.Ra(),  sh, h, hm);
+    Slalib::Rad2Dm(rd.Dec(), sd, d, dm);
+
+    rd.Ra(rd.Ra()  * 12/TMath::Pi());
+    rd.Dec(rd.Dec()*180/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));
+        //sprintf(text, "%c%dh %.1fm", rd.Ra()<0?'-':'+', abs((int)rd.Ra()), 0.1*(abs((int)test.Ra())%600));
+        sprintf(text, "%c%dh %.1fm", sh, h, hm);
         fRaEst->SetText(new TGString(text));
     }
@@ -910,8 +925,12 @@
     {
         deci = (int)test.Dec();
-        sprintf(text, "%c%dd %.1fm", rd.Dec()<0?'-':'+' , abs((int)rd.Dec()), 0.1*(abs((int)test.Dec())%600));
+        //sprintf(text, "%c%dd %.1fm", rd.Dec()<0?'-':'+' , abs((int)rd.Dec()), 0.1*(abs((int)test.Dec())%600));
+        sprintf(text, "%c%dh %.1fm", sd, d, dm);
         fDecEst->SetText(new TGString(text));
     }
 
+    // Align RaDec
+    radec.Ra(radec.Ra()  * 12/TMath::Pi());
+    radec.Dec(radec.Dec()*180/TMath::Pi());
     if (radec.Dec()>90|| radec.Dec()<-90)
     {
@@ -921,10 +940,14 @@
     radec.Ra(fmod((radec.Ra()+48), 24));
 
+    // Calculate display values
+    Slalib::Hor2Hm(radec.Ra(),  sh, h, hm);
+    Slalib::Deg2Dm(radec.Dec(), sd, d, dm);
+
     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));
+        //sprintf(text, "%c%dh %.1fm", radec.Ra()<0?'-':'+', abs((int)radec.Ra()), 0.1*(abs((int)test.Ra())%600));
+        sprintf(text, "%c%dh %.1fm", sh, h, hm);
         fRaSoll->SetText(new TGString(text));
     }
@@ -932,5 +955,6 @@
     {
         decs = (int)test.Dec();
-        sprintf(text, "%c%dd %.1fm", radec.Dec()<0?'-':'+' , abs((int)radec.Dec()), 0.1*(abs((int)test.Dec())%600));
+        //sprintf(text, "%c%dd %.1fm", radec.Dec()<0?'-':'+' , abs((int)radec.Dec()), 0.1*(abs((int)test.Dec())%600));
+        sprintf(text, "%c%dh %.1fm", sd, d, dm);
         fDecSoll->SetText(new TGString(text));
     }
@@ -1265,10 +1289,20 @@
         {
         case kCM_COMBOBOX:
-            if (mp1==kCB_PredefPos)
+            switch (mp1)
             {
-                MStar *pos = fStarList[mp2];
-                if (!pos)
+            case kCB_PredefPos:
+                {
+                    MStar *pos = fPreDefList[mp2];
+                    if (pos)
+                        fCZdAz->SetCoordinates(ZdAz(pos->GetX(), pos->GetY()));
                     return kTRUE;
-                fCZdAz->SetCoordinates(ZdAz(pos->GetX(), pos->GetY()));
+                }
+            case kCB_StarList:
+                {
+                    MStar *pos = fStarList[mp2];
+                    if (pos)
+                        fCCalib->SetCoordinates(RaDec(pos->GetX(), pos->GetY()));
+                    return kTRUE;
+                }
             }
             return kTRUE;
@@ -1333,4 +1367,29 @@
                     XY xy = fCRaDec->GetCoordinates();
                     fQueue->Proc(WM_CALCALTAZ, &xy);
+                }
+                return kTRUE;
+
+            case kPB_SavePreDef:
+                {
+                    ofstream fout("prepos.txt", ios::app);
+                    XY za = fCZdAz->GetCoordinates();
+                    fout << setprecision(7) << za.X() << " \t" << za.Y();
+                    fout << " New Position" << endl;
+                }
+                return kTRUE;
+            case kPB_SaveStar:
+                {
+                    ofstream fout("stars.txt", ios::app);
+                    XY za = fCCalib->GetCoordinates();
+
+                    UShort_t d, m, s;
+                    Char_t sgn;
+                    Slalib::Deg2Dms(za.X(), sgn, d, m, s);
+                    if (sgn=='-') fout << sgn;
+                    fout << d << " " << m << " " << s << " \t";
+                    Slalib::Deg2Dms(za.Y(), sgn, d, m, s);
+                    if (sgn=='-') fout << sgn;
+                    fout << d << " " << m << " " << s << " \t";
+                    fout << " New Star/Source" << endl;
                 }
                 return kTRUE;
Index: trunk/MagicSoft/Cosy/gui/MGCosy.h
===================================================================
--- trunk/MagicSoft/Cosy/gui/MGCosy.h	(revision 2278)
+++ trunk/MagicSoft/Cosy/gui/MGCosy.h	(revision 2280)
@@ -65,4 +65,5 @@
     TGLabel       *fMjd;
 
+    MStarList     fPreDefList;
     MStarList     fStarList;
 
Index: trunk/MagicSoft/Cosy/gui/MGSkyPosition.cc
===================================================================
--- trunk/MagicSoft/Cosy/gui/MGSkyPosition.cc	(revision 2278)
+++ trunk/MagicSoft/Cosy/gui/MGSkyPosition.cc	(revision 2280)
@@ -318,11 +318,8 @@
     SetLin2(x+dy, y-dx, x-dy, y+dx);
 
-    //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);
-    //}
+    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();
@@ -334,11 +331,12 @@
     static int Y = ~0;
 
-    int xd = (int)/*floor*/(x);
-    int yd = (int)/*floor*/(y);
-    x *= 60.;
-    y *= 60.;
-
-    int fx = (int)/*floor*/(x*10.);
-    int fy = (int)/*floor*/(y*10.);
+    UShort_t xd, yd;
+    Char_t   sx, sy;
+    Double_t xm, ym;
+    Slalib::Deg2Dm(x, sx, xd, xm);
+    Slalib::Deg2Dm(y, sy, yd, ym);
+
+    const int fx = (int)(x*600);
+    const int fy = (int)(y*600);
 
     if (X==fx && Y==fy)
@@ -348,12 +346,9 @@
     Y = fy;
 
-    float xm = fmod(fabs(x), 60.);
-    float ym = fmod(fabs(y), 60.);
-
     char txt[100];
-    sprintf(txt, "Zd=%s%d\xb0%02.1f'", x<0?"-":"", abs(xd), xm);
+    sprintf(txt, "Zd=%s%d\xb0%02.1f'", sx=='-'?"-":"", xd, xm);
     fText1->SetText(fText1->GetX(), fText1->GetY(), txt);
 
-    sprintf(txt, "Az=%s%d\xb0%02.1f'", y<0?"-":"", abs(yd), ym);
+    sprintf(txt, "Az=%s%d\xb0%02.1f'", sy=='-'?"-":"", yd, ym);
     fText2->SetText(fText2->GetX(), fText2->GetY(), txt);
 
