Index: trunk/MagicSoft/Cosy/Changelog
===================================================================
--- trunk/MagicSoft/Cosy/Changelog	(revision 4254)
+++ trunk/MagicSoft/Cosy/Changelog	(revision 4255)
@@ -1,3 +1,36 @@
                                                                   -*-*- END -*-*-
+
+ 2004/06/01 - Thomas Bretz
+ 
+   * Makefile.conf.linux:
+     - removed obsolete -Wtraditional and -Wnested-externs
+
+   * caos/Leds.h:
+     - added empty Add(TObject*) function for correct overload
+
+   * main/MBending.cc:
+     - added MAGIC1 as a hysteresis
+
+   * main/MCosy.cc:
+     - added header to drive report
+
+   * main/MCosy.h:
+     - added getter-function to GetOutRep (used in FindStar)
+
+   * main/MStarguider.cc:
+     - added Output to report file
+     - added output of Star-Offset in pixels
+
+   * main/MTracking.cc:
+     - removed some 'unused variable'
+
+   * tcpip/MTcpIpIO.cc:
+     - removed nonsense setting of eGui when writing to the report file
+
+   * tpoint/gui.C:
+     - enhanced display
+
+
+
  2004/05/15 - Thomas Bretz (La Palma)
 
Index: trunk/MagicSoft/Cosy/Makefile.conf.linux
===================================================================
--- trunk/MagicSoft/Cosy/Makefile.conf.linux	(revision 4254)
+++ trunk/MagicSoft/Cosy/Makefile.conf.linux	(revision 4255)
@@ -21,5 +21,5 @@
 
 #-O2
-OPTIM = -O5 -Wall -fno-exceptions -fPIC -Wtraditional -Wpointer-arith -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Woverloaded-virtual -D_REENTRANT 
+OPTIM = -O5 -Wall -fno-exceptions -fPIC -Wpointer-arith -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Woverloaded-virtual -D_REENTRANT 
 DEBUG = -g
 
Index: trunk/MagicSoft/Cosy/caos/Leds.h
===================================================================
--- trunk/MagicSoft/Cosy/caos/Leds.h	(revision 4254)
+++ trunk/MagicSoft/Cosy/caos/Leds.h	(revision 4255)
@@ -21,4 +21,5 @@
     void Set(Int_t i, Double_t x, Double_t y, Double_t dx=0, Double_t dy=0, Double_t mag=0);
     void Add(Double_t x, Double_t y, Double_t dx=0, Double_t dy=0, Double_t mag=0);
+    void Add(TObject *o) { }
 
     //nst Led &GetLed(int i) const { return *(Led*)( (*this)[i] ); }
Index: trunk/MagicSoft/Cosy/main/MBending.cc
===================================================================
--- trunk/MagicSoft/Cosy/main/MBending.cc	(revision 4254)
+++ trunk/MagicSoft/Cosy/main/MBending.cc	(revision 4255)
@@ -118,5 +118,5 @@
     fDescr[15] =  "Alt/Az Coude Displacement (N-S)";
     fDescr[16] =  "Alt/Az Coude Displacement (E-W)";
-    fDescr[17] =  "n/a";
+    fDescr[17] =  "n/a <ZA Hysteresis>";
     fDescr[18] =  "n/a";
 }
@@ -204,37 +204,19 @@
         val *= kDeg2Rad;
 
-        Double_t *dest=NULL;
-
-        if (str=="IA")   dest = &fIa;
-        if (str=="IE")   dest = &fIe;
-        if (str=="FLOP") dest = &fFlop;
-        if (str=="NPAE") dest = &fNpae;
-        if (str=="CA")   dest = &fCa;
-        if (str=="AN")   dest = &fAn;
-        if (str=="AW")   dest = &fAw;
-        if (str=="TF")   dest = &fTf;
-        if (str=="TX")   dest = &fTx;
-        if (str=="NRX")  dest = &fNrx;
-        if (str=="NRY")  dest = &fNry;
-        if (str=="CRX")  dest = &fCrx;
-        if (str=="CRY")  dest = &fCry;
-        if (str=="ECES") dest = &fEces;
-        if (str=="ACES") dest = &fAces;
-        if (str=="ECEC") dest = &fEcec;
-        if (str=="ACEC") dest = &fAcec;
-
-        if (dest)
-            *dest = val;
+        // Find parameter
+        Int_t n = -1;
+        for (int i=0; i<fNumPar; i++)
+            if (str==fName[i])
+            {
+                n = i;
+                *fCoeff[i] = val;
+                break;
+            }
 
         fin >> val;
         cout << setw(9) << val << "°" << endl;
 
-        // Find corresponding error
-        for (int i=0; i<MBending::GetNumPar(); i++)
-            if (dest==fCoeff[i])
-            {
-                fError[i] = val*kDeg2Rad;
-                break;
-            }
+        // corresponding error
+        fError[n] = val*kDeg2Rad;
     }
     cout << endl;
@@ -490,6 +472,6 @@
     p += FLOP;
 
-    //const AltAz MAGIC1(fMagic1*sin(p.Az()), 0);
-    //p += MAGIC1;
+    const AltAz MAGIC1(fMagic1*TMath::Sign(1., sin(p.Az())), 0);
+    p += MAGIC1;
 
     const AltAz I(fIe, fIa);
@@ -512,4 +494,7 @@
     const AltAz I(fIe, fIa);
     p -= I;
+
+    const AltAz MAGIC1(fMagic1*TMath::Sign(1., sin(p.Az())), 0);
+    p -= MAGIC1;
 
     //const AltAz MAGIC1(fMagic1*sin(p.Az()), 0);
@@ -622,5 +607,5 @@
 }
 
-void MBending::SetMinuitParameters(TMinuit &m, Int_t n=-1) const
+void MBending::SetMinuitParameters(TMinuit &m, Int_t n) const
 {
     if (n<0)
@@ -633,5 +618,5 @@
 }
 
-void MBending::GetMinuitParameters(TMinuit &m, Int_t n=-1)
+void MBending::GetMinuitParameters(TMinuit &m, Int_t n)
 {
     if (n<0 || n>m.GetNumPars())
@@ -665,5 +650,5 @@
 }
 */
-void MBending::PrintMinuitParameters(TMinuit &m, Int_t n=-1) const
+void MBending::PrintMinuitParameters(TMinuit &m, Int_t n) const
 {
     if (n<0)
Index: trunk/MagicSoft/Cosy/main/MCosy.cc
===================================================================
--- trunk/MagicSoft/Cosy/main/MCosy.cc	(revision 4254)
+++ trunk/MagicSoft/Cosy/main/MCosy.cc	(revision 4255)
@@ -1447,4 +1447,8 @@
     cout << "Open Repfile: " << name << endl;
     fOutRep = new MLog(name, kTRUE);
+    *fOutRep << "[Drive Report File]" << endl;
+    *fOutRep << "Version <cvs>" << endl;
+    *fOutRep << "Date " << MTime(-1) << endl;
+    *fOutRep << "[Reports]" << endl;
 
 /*
Index: trunk/MagicSoft/Cosy/main/MCosy.h
===================================================================
--- trunk/MagicSoft/Cosy/main/MCosy.h	(revision 4254)
+++ trunk/MagicSoft/Cosy/main/MCosy.h	(revision 4255)
@@ -201,4 +201,6 @@
     }
 
+    MLog *GetOutRep() { return fOutRep; }
+
     // static ZdAz CorrectTarget(const ZdAz &src, const ZdAz &dst);
     //    static ZdAz RaDec2ZdAz(const double mjd, const RaDec &pos, const RaDec &pm=RaDec(0,0));
Index: trunk/MagicSoft/Cosy/main/MStarguider.cc
===================================================================
--- trunk/MagicSoft/Cosy/main/MStarguider.cc	(revision 4254)
+++ trunk/MagicSoft/Cosy/main/MStarguider.cc	(revision 4255)
@@ -922,11 +922,13 @@
     // Get tracking coordinates
     const XY    xy = fCRaDec->GetCoordinates();
-    const RaDec rd(xy.X()*TMath::DegToRad()*360/24, xy.Y()*TMath::DegToRad());
+    const RaDec rd(xy.X()*TMath::DegToRad()*15, xy.Y()*TMath::DegToRad());
 
     ac.SetRaDec(rd.Ra(), rd.Dec());
 
-    // Adapt coordinate system (GUI and humans are counting Y in different directions)
+    // Adapt coordinate system (GUIs and humans are counting Y in different directions)
     Double_t x = star->GetX()-center.GetX();
     Double_t y = center.GetY()-star->GetY();
+
+    cout << "STAR-Offset: " << MTime(-1) << " dx=" << x << "pix  dy=" << dy << "pix" << endl;
 
     // Convert from Pixel to millimeter (1pix=2.9mm)
@@ -993,4 +995,19 @@
     *fOutTp << " " << setprecision(11) << t.GetMjd();
     *fOutTp << endl;
+
+    MLog &outrep = *fCosy->GetOutRep();
+    if (outrep.Lock("MStarguider::FindStar"))
+    {
+        outrep << "FINDSTAR-REPORT " << MTime(-1) << " " << setprecision(7);
+        outrep << 90-za0.Alt() << " " << za0.Az() << " ";
+        outrep << za1.Zd() << " " << za1.Az() << " ";
+        outrep << xy.X() << " " << xy.Y() << " ";
+        outrep << -dzd << " " << -daz << " ";
+        outrep << star->GetX() << " " << star->GetY() << " ";
+        outrep << center.GetX() << " " << center.GetY() << " ";
+        outrep << x*1.0713/2.58427 << " " << y*1.0713/2.58427 << " " << star->GetMag();
+        outrep << setprecision(11) << t.GetMjd() << endl;
+        outrep.UnLock("MStarguider::FindStar")
+    }
 }
 
