Index: trunk/MagicSoft/Cosy/Changelog
===================================================================
--- trunk/MagicSoft/Cosy/Changelog	(revision 9444)
+++ trunk/MagicSoft/Cosy/Changelog	(revision 9445)
@@ -1,3 +1,18 @@
                                                                   -*-*- END -*-*-
+
+ 2009/05/12 Thomas Bretz (La Palma)
+
+   * main/MStarguider.cc:
+     - a few sanity fixes
+     - star-pointer doesn't exist in Starguider procedure anymore
+     - replaced fDisplay by fMode
+     - addes tar magnitude and name to output in tpoints
+     - don't switch to tpoint mode in tpoint procedure if already
+       switched on
+
+   * tcpip/MDriveCom.cc:
+     - don't post the tpoint messages but just execute
+
+
 
  2009/05/11 Thomas Bretz (La Palma)
Index: trunk/MagicSoft/Cosy/main/MStarguider.cc
===================================================================
--- trunk/MagicSoft/Cosy/main/MStarguider.cc	(revision 9444)
+++ trunk/MagicSoft/Cosy/main/MStarguider.cc	(revision 9445)
@@ -1360,5 +1360,5 @@
     Int_t cnt=0;
 
-    MStar *star;
+    MStar *star=0;
     MStarListIter NextStar(&stars);
     while ((star=NextStar()) && cnt<num+5)
@@ -1379,6 +1379,7 @@
             x.AddAt(dpos.X(), idx);
             y.AddAt(dpos.Y(), idx);
-            mag.AddAt(log(spot->GetMag())/star->GetMag(), idx);
-
+            mag.AddAt(1, idx);
+//            mag.AddAt(log(spot->GetMag())/star->GetMag(), idx);
+/*
 #ifdef EXPERT
             if (fout)
@@ -1393,4 +1394,5 @@
             }
 #endif
+*/
         }
         cnt++;
@@ -1416,5 +1418,5 @@
 
     // Check StargTPoint data set request
-    if (!fDisplay->IsEntryChecked(IDM_kStarguiderMode) || !fTPoint->IsDown())
+    if (!fMode->IsEntryChecked(IDM_kStarguiderMode) || !fTPoint->IsDown())
         return numcor;
     fTPoint->SetDown(kFALSE);
@@ -1465,9 +1467,10 @@
     *fOutStargTp << " " << setprecision(11) << t.GetMjd();
     *fOutStargTp << " " << setprecision(4) << center.GetMag();
-    *fOutStargTp << " " << star->GetMag();
+    *fOutStargTp << " 0";// << star->GetMag();
     *fOutStargTp << " " << center.GetX() << " " << center.GetY();
     *fOutStargTp << " 0 0";
     *fOutStargTp << " " << numleds << " " << numrings;
     *fOutStargTp << " " << num << " " << numcor << " " << bright;
+    *fOutStargTp << " " << fTPointStarMag << " " << fTPointStarName;
     *fOutStargTp << endl;
 
@@ -1545,5 +1548,5 @@
 
     // Check TPoint data set request
-    if (!fDisplay->IsEntryChecked(IDM_kTpointMode) || !fTPoint->IsDown())
+    if (!fMode->IsEntryChecked(IDM_kTpointMode) || !fTPoint->IsDown())
         return;
 
@@ -1600,4 +1603,5 @@
     *fOutTp << " " << numleds << " " << numrings;
     *fOutTp << " 0 0 0";
+    *fOutTp << " " << fTPointStarMag << " " << fTPointStarName;
     *fOutTp << endl;
 
@@ -1744,9 +1748,13 @@
         fNumStarsDetected = 0;
 
-        cout << " * Switching to TPoint mode" << endl;
-        // Switch to tpoint mode
-        fMode->UnCheckEntry(IDM_kTpointMode);
-        ProcessMessage(MK_MSG(kC_COMMAND, kCM_MENU), IDM_kTpointMode, 0);
-        return kFALSE;
+        if (!fMode->IsEntryChecked(IDM_kTpointMode))
+        {
+            cout << " * Switching to TPoint mode" << endl;
+            // Switch to tpoint mode
+            fMode->UnCheckEntry(IDM_kTpointMode);
+            ProcessMessage(MK_MSG(kC_COMMAND, kCM_MENU), IDM_kTpointMode, 0);
+            return kFALSE;
+        }
+        fTPointFromCC++;
 
     case 2:
@@ -1791,9 +1799,9 @@
         fMode->UnCheckEntry(IDM_kTpointMode);
         ProcessMessage(MK_MSG(kC_COMMAND, kCM_MENU), IDM_kTpointMode, 0);
-        break;
+        fTPointFromCC = -1;
+        return kFALSE;
     }
 
     // Send report
-    fTPointFromCC = -1;
 /*
     if (!fCosy)
Index: trunk/MagicSoft/Cosy/tcpip/MDriveCom.cc
===================================================================
--- trunk/MagicSoft/Cosy/tcpip/MDriveCom.cc	(revision 9444)
+++ trunk/MagicSoft/Cosy/tcpip/MDriveCom.cc	(revision 9445)
@@ -165,5 +165,5 @@
 
     if (fQueue)
-        fQueue->PostMsg(WM_STARGTPOINT, (void*)str.Data(), str.Length()+1);//, (void*)str.Data(), str.Length()+1);
+        fQueue->Proc(WM_STARGTPOINT, (void*)str.Data());
 
     return true;
@@ -177,5 +177,5 @@
 
     if (fQueue)
-        fQueue->PostMsg(WM_STARGMODE, &on, sizeof(bool));//, (void*)str.Data(), str.Length()+1);
+        fQueue->Proc(WM_STARGMODE, &on);
 
     return true;
