Index: /trunk/Cosy/main/MCosy.cc
===================================================================
--- /trunk/Cosy/main/MCosy.cc	(revision 12590)
+++ /trunk/Cosy/main/MCosy.cc	(revision 12591)
@@ -118,5 +118,5 @@
 ZdAz MCosy::GetSePos() const
 {
-    const Double_t pa = fMac1 ? (Double_t)fMac1->GetPdoPos2()/fMac1->GetPosRes()  : 0;
+    const Double_t pa = fMac1 ? (Double_t)fMac1->GetPdoPos2()/fMac1->GetPosRes() : 0;
     const Double_t p1 = fMac2 ? (Double_t)fMac2->GetPdoPos2()/fMac2->GetPosRes() : 0;
 
@@ -261,11 +261,8 @@
         pointing.Zd(-pointing.Zd());
         pointing.Az(pointing.Az()+180);
-        //gLog << "ZD=-ZD Az+=180" << endl;
     }
 
     const ZdAz se = GetSePos()*TMath::TwoPi();   // [rad]
     const ZdAz unbendedse = fBending.CorrectBack(se)*TMath::RadToDeg(); // ist pointing
-
-    //gLog << "Unbended: " << unbendedse.Zd() << " " << unbendedse.Az() << endl;
 
     do
@@ -275,7 +272,6 @@
             break;
 
-        //gLog << "AZ += " << TMath::Sign(360., d) << endl;
-
         pointing.Az(pointing.Az()+TMath::Sign(360., d));
+
     } while (1);
 
@@ -484,4 +480,5 @@
 Int_t MCosy::Proc(int msg, void *mp)
 {
+    cout << "*** Received " << hex << msg << endl;
     switch (msg)
     {
@@ -498,4 +495,7 @@
 
     case WM_TPOINT:
+#ifdef FACT
+        fStarguider->fTPoint->SetDown(kTRUE);
+#else
         {
             //cout << "WM_TPoint: start." << endl;
@@ -545,6 +545,6 @@
             //cout << "WM_TPoint: done. (return 0xaffe)" << endl;
         }
-        break;
-
+#endif
+        break;
     case WM_STARGTPOINT:
         if (fStarguider)
@@ -574,4 +574,16 @@
         }
         //cout << "WM_TrackPosition: done. (return 0xabcd)" << endl;
+        break;
+
+    case WM_LEDS:
+        {
+            if (!CheckNetwork())
+                return 0xebb0;
+
+            const Long_t *u = (Long_t*)mp;
+
+            fMac1->SetLedVoltage(u[0]);
+            fMac2->SetLedVoltage(u[1]);
+        }
         break;
 
@@ -898,11 +910,11 @@
     {
         tout.Start(999);
-        fCom->SendReport(fStatus, fRaDec, fHourAngle, fZdAzSoll, bendist, fTrackingError, armed,
-                         fStarguider ? fStarguider->GetStarguiderMode() : 0);
+        fCom->SendReport(fStatus, fMJD, fRaDec, fHourAngle, fZdAzSoll, bendist, fTrackingError, armed,
+                         fStarguider ? fStarguider->GetStarguiderMode() : 0, ((stat1&0xffff)<<16)|(stat2&0xffff));
     }
 
     fWin->UpdateWeather(*fCom);
     fWin->Update(bendist, fTrackingError, /*fVelocity, fOffset,*/
-                 fRaDec, fZdAzSoll, fStatus, ((stat1&0xff)<<8)|(stat2&0xff), HasConnection(), armed, statzd, stataz);
+                 fRaDec, fZdAzSoll, fStatus, ((stat1&0xffff)<<16)|(stat2&0xffff), HasConnection(), armed, statzd, stataz);
 
     gLog.UpdateGui();
@@ -993,5 +1005,5 @@
 MCosy::MCosy(MEnv &env, MDriveCom *com)
 : Network(), fObservatory(MObservatory::kMagic1), fStarguider(NULL),
-fMac1(0), fMac2(0), fStatus(MDriveCom::kStopped), fOutTp(0), fOutRep(0)
+fMac1(0), fMac2(0), fMJD(0), fStatus(MDriveCom::kStopped), fOutTp(0), fOutRep(0)
 {
     const Int_t id1 = env.GetValue("Az_Id", 1);
