Index: trunk/Cosy/gui/MGCosy.cc
===================================================================
--- trunk/Cosy/gui/MGCosy.cc	(revision 9628)
+++ trunk/Cosy/gui/MGCosy.cc	(revision 12589)
@@ -75,4 +75,5 @@
     kCB_PredefPos,
     kCB_StarList,
+    kCB_CelestList,
     kPB_SavePreDef,
     kPB_SaveStar,
@@ -391,8 +392,35 @@
 }
 
+void MGCosy::CreateCelestList(TGCompositeFrame *tf1)
+{
+    TGComboBox *box = new TGComboBox(tf1, kCB_CelestList);
+    box->Resize(170, 20);
+    box->Associate(this);
+
+    TGLayoutHints *lay = new TGLayoutHints(kLHintsLeft|kLHintsTop,
+                                           27, 0, 70, 0);
+    tf1->AddFrame(box, lay);
+
+    fList->Add(box);
+    fList->Add(lay);
+
+    box->AddEntry("Moon",    3);
+    box->AddEntry("Mercury", 1);
+    box->AddEntry("Venus",   2);
+    box->AddEntry("Mars",    4);
+    box->AddEntry("Jupiter", 5);
+    box->AddEntry("Saturn",  6);
+    box->AddEntry("Uranus",  7);
+    box->AddEntry("Neptune", 8);
+    box->AddEntry("Pluto",   9);
+
+    box->Select(3);
+}
+
 void MGCosy::CreateTabs(const char *prepos)
 {
     TGCompositeFrame *tf1 = fTab->AddTab("Position");
     TGCompositeFrame *tf2 = fTab->AddTab("Track");
+    TGCompositeFrame *tf7 = fTab->AddTab("Celest");
     TGCompositeFrame *tf4 = fTab->AddTab("Calib");
 #ifdef EXPERT
@@ -410,4 +438,5 @@
     CreatePredefinedPos(tf1, prepos);
     CreateStarList(tf4);
+    CreateCelestList(tf7);
 
     fCRaDec = new MGCoordinates(tf2, kETypeRaDec);
@@ -462,4 +491,15 @@
     fList->Add(l3);
     //fList->Add(l4);
+
+    l1 = new TGLabel(tf7, "Track a celestial object by object name.");
+//    l2 = new TGLabel(tf7, "Right Ascension and declination must be given");
+//    l3 = new TGLabel(tf7, "in the FK5, J2000 coordinate system.");
+    l1->Move(x, y);
+//    l2->Move(x, y+h);
+//    l3->Move(x, y+2*h);
+    fList->Add(l1);
+//    fList->Add(l2);
+//    fList->Add(l3);
+
 
 #ifdef EXPERT
@@ -729,5 +769,5 @@
 
 MGCosy::MGCosy(MObservatory::LocationName_t key, const char *prepos, MsgQueue *q)
-    : TGMainFrame(gClient->GetRoot(), 1, 1), fObservatory(key), fQueue(q)
+    : TGMainFrame(gClient->GetRoot(), 1, 1), fObservatory(key), fQueue(q), fCelestObj(3)
 {
     // This means that all objects added with AddFrame are deleted
@@ -1072,6 +1112,6 @@
     EnableLabel(fRaSoll,   stat&MDriveCom::kTracking);
     EnableLabel(fDecSoll,  stat&MDriveCom::kTracking);
-    EnableLabel(fZdSoll,   stat&MDriveCom::kMoving);
-    EnableLabel(fAzSoll,   stat&MDriveCom::kMoving);
+    EnableLabel(fZdSoll,   stat&MDriveCom::kMoving || stat&MDriveCom::kTracking);
+    EnableLabel(fAzSoll,   stat&MDriveCom::kMoving || stat&MDriveCom::kTracking);
 
     SetLabelColor(fAvailTcp, stat2);
@@ -1080,4 +1120,27 @@
         pdo3 = 0;
 
+    //   1 X Ab
+    //   2 1
+    //   4 Emergency
+    //   8 OverVolt
+    //  10 Move (Drehen-soll)
+    //  20 X Af
+    //  40 1
+    //  80 Power on Az
+    // ------------------
+    // 100 NOT UPS Alarm
+    // 200 UPS on Battery
+    // 400 UPS charging
+
+#ifdef FACT
+    SetLabelColor(fDkcReady1,     pdo3&0x00000001);
+    SetLabelColor(fDkcReady2,     pdo3&0x00010000);
+    SetLabelColor(fDkcEmergency, (pdo3&0x00040004)==0x00040004);
+    SetLabelColor(fDkcPcMode,    (pdo3&0x00100010)!=0x00100010);
+    SetLabelColor(fDkcRF1,        pdo3&0x00000020);
+    SetLabelColor(fDkcRF2,        pdo3&0x00200000);
+    SetLabelColor(fDkcBrake,     (pdo3&0x00400040)==0x00400040);
+    SetLabelColor(fDkcPower,     (pdo3&0x00800080)==0x00800080);
+#else
     SetLabelColor(fDkcReady1,       pdo3&0x0001);
     SetLabelColor(fDkcReady2,       pdo3&0x0100);
@@ -1088,4 +1151,5 @@
     SetLabelColor(fDkcBrake,       (pdo3&0x4040)==0x4040);
     SetLabelColor(fDkcPower,       (pdo3&0x8080)==0x8080);
+#endif
 
     EnableLabel(fArmed, armed);
@@ -1192,4 +1256,15 @@
 
     cout << "PostMsg (WM_Track) returned." << endl;
+}
+
+void MGCosy::StartCelest()
+{
+    cout << "Start celest." << endl;
+
+    Double_t tx[3] = { fCelestObj, 0, 0 };
+
+    fQueue->PostMsg(WM_CELEST, tx, sizeof(Double_t)*3);
+
+    cout << "PostMsg (WM_CELEST) returned." << endl;
 }
 
@@ -1380,4 +1455,9 @@
                     return kTRUE;
                 }
+            case kCB_CelestList:
+                {
+                    fCelestObj = mp2;
+                    return kTRUE;
+                }
             }
             return kTRUE;
@@ -1410,15 +1490,18 @@
                     return kTRUE;
                 case 2:
+                    StartCelest();
+                    return kTRUE;
+                case 3:
                     fCRaDec->SetCoordinates(fCCalib->GetCoordinates());
                     StartTrack(false);
                     return kTRUE;
-                case 3:
+                case 4:
                     fQueue->Proc(WM_TESTSE, (void*)1);
                     return kTRUE;
-                case 4:
+                case 5:
                     fQueue->Proc(WM_GEAR, (void*)1);
                     return kTRUE;
 #ifdef HAS_DEMO
-                case 5:
+                case 6:
                     StartDemo();
                     return kTRUE;
@@ -1433,7 +1516,7 @@
 #endif
                 fQueue->PostMsg(WM_STOP);
-                if (fTab->GetCurrent()==3)
+                if (fTab->GetCurrent()==4)
                     fQueue->Proc(WM_TESTSE);
-                if (fTab->GetCurrent()==4)
+                if (fTab->GetCurrent()==5)
                     fQueue->Proc(WM_GEAR);
                 cout << "PostMsg (WM_Stop) returned." << endl;
