Index: /trunk/MagicSoft/Cosy/Changelog
===================================================================
--- /trunk/MagicSoft/Cosy/Changelog	(revision 1110)
+++ /trunk/MagicSoft/Cosy/Changelog	(revision 1111)
@@ -1,3 +1,131 @@
                                                                   -*-*- END -*-*-
+
+ 2001/12/12 - Thomas Bretz:
+ 
+   * base/coord.h:
+     - added constants for unit transformations
+  
+   * base/msgqueue.h:
+     - replaced pthread.h by thread.h
+
+   * base/timer.h:
+     - removed unistd.h
+     - added forward declaration for timeval
+
+   * candrv/CandrvLinkDef.h:
+     - added VmodIcan
+     - added CanOpen
+     - added Network
+     - added NodeDrv
+     - added PendingSDO
+     - added PendingSDOList
+  
+   * candrv/nodedrv.h, candrv/sdolist.h, candrv/vmodican.h,
+     videodev/Camera.h, videodev/Writer.h:
+     - added ClassDef
+     - added some declarations for __CINT__ case
+
+   * base/MThread.h:
+     - added some declarations for __CINT__ case
+
+   * base/threads.h:
+     - added
+
+   * catalog/CatalogLinkDef.h:
+     - added Slalib+
+     - added SlaStars+
+     - added SlaPlanets+
+     - added SaoFile+
+     - added StarCatalog+
+
+   * catalog/SlaStars.h:
+     - added ClassDef
+     - included coord.h for coordation tranformations
+
+   * catalog/SlaStars.cc, catalog/Slalib.cc, gui/MGSkyPosition.cc:
+     - added ClassImp
+     - changed slalib macros to coord.h constants
+  
+   * catalog/StarCatalog.h:
+     - added ClassDef
+     - changed slalib macros to coord.h constants
+
+   * devdrv/DevdrvLinkDef.h:
+     - added Macs+;
+     - added ShaftEncoder+;
+
+   * gui/GuiIncl.h:
+     - added coord.h
+  
+   * gui/GuiLinkDef.h:
+     - added MGAccuracy+;
+     - added MGCoordinate+;
+     - added MGCoordinates+;
+     - added MGEmbeddedCanvas+;
+     - added MGImage+;
+     - added MGSkyPosition+;
+     - added MGVelocity+;
+     - added MGCosy+;
+     - added MGStarguider+;
+
+   * gui/MGCoordinate.[h,cc]:
+     - changed Flist to pointer type
+
+   * gui/MGCosy.cc:
+     - added ClassImp
+     - fixed a bug which causes 'Exit' not to work
+     - changed slalib macros to coord.h constants
+
+   * gui/MGCosy.h:
+     - added ClassDef
+  
+   * gui/MGEmbeddedCanvas.h:
+     - added ClassImp
+     - removed consts
+  
+   * gui/MGStarguider.[h,cc]:
+     - added ClassImp/Def
+     - change fList to pointer type
+     - change fRaDec to pinter type
+     - changed fSao to pointer type
+
+   * main/MCosy.[h,cc]:
+     - added ClassImp
+     - changed order
+     - added comments
+     - changed slalib macros to coord.h constants
+     - changed defines to enums
+  
+   * main/MainCint.h:
+     - removed
+  
+   * main/MainLinkDef.h:
+     - added MCosy
+
+   * devdrv/Makefile, candrv/Makefile, catalog/Makefile, gui/Makefile,
+     main/Makefile, videodev/Makefile:
+     - added CINTHEADERS
+
+   * candrv/canopen.cc, candrv/network.cc,candrv/nodedrv.cc, candrv/sdolist.cc
+     candrv/vmodican.cc, catalog/SaoFile.cc, catalog/SlaPlanets.cc,
+     catalog/StarCatalog.cc, devdrv/macs.cc, devdrv/shaftencoder.cc,
+     gui/MGAccuracy.cc, gui/MGCoordinate.cc, gui/MGCoordinates.cc,
+     gui/MGEmbeddedCanvas.cc, gui/MGImage.cc, gui/MGVelocity.cc,
+     videodev/Camera.cc, videodev/Filter.cc, videodev/Writer.cc:
+     - added ClassImp
+
+   * candrv/network.h, catalog/SaoFile.h, catalog/SlaPlanets.h,
+     catalog/Slalib.h, devdrv/macs.h, devdrv/shaftencoder.h,
+     gui/MGAccuracy.h, gui/MGCoordinate.h, gui/MGCoordinates.h,
+     gui/MGImage.h, gui/MGSkyPosition.h, gui/MGVelocity.h,
+     videodev/Filter.h:
+     - added ClassDef
+
+   * videodev/VideodevLinkDef.h:
+     - added Writer+;
+     - added Filter+;
+     - added Camera+;
+
+
 
  2001/09/10 - Thomas Bretz:
@@ -28,5 +156,5 @@
 
 
-     
+
  2001/09/07 - Thomas Bretz:
  
Index: /trunk/MagicSoft/Cosy/base/MThread.h
===================================================================
--- /trunk/MagicSoft/Cosy/base/MThread.h	(revision 1110)
+++ /trunk/MagicSoft/Cosy/base/MThread.h	(revision 1111)
@@ -2,7 +2,11 @@
 #define MTHREAD_H
 
+#ifdef __CINT__
+typedef unsigned long int pthread_t;
+#else
 #include <pthread.h>
+#endif
 
-class MThread 
+class MThread
 {
 private:
Index: /trunk/MagicSoft/Cosy/base/threads.h
===================================================================
--- /trunk/MagicSoft/Cosy/base/threads.h	(revision 1111)
+++ /trunk/MagicSoft/Cosy/base/threads.h	(revision 1111)
@@ -0,0 +1,12 @@
+#ifndef THREADS_H
+#define THREADS_H
+
+#ifndef __CINT__
+#include <pthread.h>
+#else
+typedef unsigned long int pthread_t;
+struct pthread_mutex_t;
+struct pthread_cond_t;
+#endif
+
+#endif
Index: /trunk/MagicSoft/Cosy/catalog/StarCatalog.h
===================================================================
--- /trunk/MagicSoft/Cosy/catalog/StarCatalog.h	(revision 1110)
+++ /trunk/MagicSoft/Cosy/catalog/StarCatalog.h	(revision 1111)
@@ -73,10 +73,12 @@
                   const AltAz &altaz);
 
-    const AltAz GetAltAz() const { return fAltAz*360/D2PI; }
-    const ZdAz  GetZdAz() const  { return ZdAz(DPI/2-fAltAz.Alt(), fAltAz.Az())*360/D2PI; }
-    const RaDec GetRaDec() const { return fRaDec*360/D2PI; }
+    const AltAz GetAltAz() const { return fAltAz*kRad2Deg; }
+    const ZdAz  GetZdAz() const  { return ZdAz(kPiDiv2-fAltAz.Alt(), fAltAz.Az())*kRad2Deg; }
+    const RaDec GetRaDec() const { return fRaDec*kRad2Deg; }
 
     void  SetPixSize(const double pixsize);
     void  SetLimitMag(const float mag) { fLimitMag = mag; };
+
+    ClassDef(StarCatalog, 0)
 };
 
Index: /trunk/MagicSoft/Cosy/gui/MGAccuracy.cc
===================================================================
--- /trunk/MagicSoft/Cosy/gui/MGAccuracy.cc	(revision 1110)
+++ /trunk/MagicSoft/Cosy/gui/MGAccuracy.cc	(revision 1111)
@@ -18,4 +18,6 @@
 
 #include "coord.h"
+
+ClassImp(MGAccuracy);
 
 void MGAccuracy::DrawCoordinateSystem()
Index: /trunk/MagicSoft/Cosy/gui/MGAccuracy.h
===================================================================
--- /trunk/MagicSoft/Cosy/gui/MGAccuracy.h	(revision 1110)
+++ /trunk/MagicSoft/Cosy/gui/MGAccuracy.h	(revision 1111)
@@ -12,11 +12,8 @@
 #endif
 
-class TList;
 class TLine;
 class TText;
-class TCanvas;
 
 class ZdAz;
-class SlaPlanets;
 
 class MGAccuracy : public MGEmbeddedCanvas
@@ -40,4 +37,6 @@
 
     void Update(ZdAz &pos, ZdAz &acc);
+
+    ClassDef(MGAccuracy, 0)
 };
 
Index: /trunk/MagicSoft/Cosy/gui/MGCoordinate.cc
===================================================================
--- /trunk/MagicSoft/Cosy/gui/MGCoordinate.cc	(revision 1110)
+++ /trunk/MagicSoft/Cosy/gui/MGCoordinate.cc	(revision 1111)
@@ -17,4 +17,6 @@
 #include "slamac.h"
 
+ClassImp(MGCoordinate);
+
 enum {
     IDM_kDeg,
@@ -28,4 +30,6 @@
 : TGFrame(p, 119, flag?76:46, kSunkenFrame|kFixedSize), fDeg(deg), fMin(min), fSec(sec)
 {
+    fList = new MGList;
+
     // p = pointer to MainFrame (not owner)
     if (flag)
@@ -43,7 +47,7 @@
         fTextEntryMin->MapWindow();
         fTextEntrySec->MapWindow();
-        fList.Add(fTextEntrySec);
-        fList.Add(fTextEntryMin);
-        fList.Add(fTextEntryDeg);
+        fList->Add(fTextEntrySec);
+        fList->Add(fTextEntryMin);
+        fList->Add(fTextEntryDeg);
 
         Set(fTextEntryDeg, fDeg);
@@ -66,7 +70,7 @@
     fLabelMin->MapWindow();
     fLabelSec->MapWindow();
-    fList.Add(fLabelSec);
-    fList.Add(fLabelDeg);
-    fList.Add(fLabelMin);
+    fList->Add(fLabelSec);
+    fList->Add(fLabelDeg);
+    fList->Add(fLabelMin);
 
     Set(fLabelDeg, fDeg);
@@ -78,5 +82,5 @@
     fLabel->Move(4, 4);
     fLabel->MapWindow();
-    fList.Add(fLabel);
+    fList->Add(fLabel);
 
     TGLabel *label;
@@ -92,5 +96,5 @@
         label->Move(39, 26);
         label->MapWindow();
-        fList.Add(label);
+        fList->Add(label);
 
         label = new TGLabel(this, min);
@@ -98,5 +102,5 @@
         label->Move(73, 26);
         label->MapWindow();
-        fList.Add(label);
+        fList->Add(label);
 
         label = new TGLabel(this, sec);
@@ -104,5 +108,5 @@
         label->Move(107, 26);
         label->MapWindow();
-        fList.Add(label);
+        fList->Add(label);
     }
 
@@ -111,5 +115,5 @@
     label->Move(39, ypos);
     label->MapWindow();
-    fList.Add(label);
+    fList->Add(label);
 
     label = new TGLabel(this, min);
@@ -117,5 +121,5 @@
     label->Move(73, ypos);
     label->MapWindow();
-    fList.Add(label);
+    fList->Add(label);
  
     label = new TGLabel(this, sec);
@@ -123,5 +127,5 @@
     label->Move(107, ypos);
     label->MapWindow();
-    fList.Add(label);
+    fList->Add(label);
 
     MapWindow();
@@ -130,5 +134,5 @@
 MGCoordinate::~MGCoordinate()
 {
-    //    cout << "MGCoordinate destroyed." << endl;
+    delete fList;
 }
 
Index: /trunk/MagicSoft/Cosy/gui/MGCoordinate.h
===================================================================
--- /trunk/MagicSoft/Cosy/gui/MGCoordinate.h	(revision 1110)
+++ /trunk/MagicSoft/Cosy/gui/MGCoordinate.h	(revision 1111)
@@ -29,5 +29,5 @@
     Int_t fSec;
 
-    MGList fList;
+    MGList *fList;
 
     TGTextEntry *fTextEntryDeg;
@@ -57,4 +57,6 @@
 
     void Print();
+
+    ClassDef(MGCoordinate, 0)
 };
 
Index: /trunk/MagicSoft/Cosy/gui/MGCoordinates.cc
===================================================================
--- /trunk/MagicSoft/Cosy/gui/MGCoordinates.cc	(revision 1110)
+++ /trunk/MagicSoft/Cosy/gui/MGCoordinates.cc	(revision 1111)
@@ -10,4 +10,7 @@
 
 #include "MGCoordinate.h"
+#include "coord.h"
+
+ClassImp(MGCoordinates);
 
 MGCoordinates::MGCoordinates(const TGWindow* p,
Index: /trunk/MagicSoft/Cosy/gui/MGCoordinates.h
===================================================================
--- /trunk/MagicSoft/Cosy/gui/MGCoordinates.h	(revision 1110)
+++ /trunk/MagicSoft/Cosy/gui/MGCoordinates.h	(revision 1111)
@@ -11,7 +11,6 @@
 #include <TGFrame.h>
 #endif
-#ifndef COORD_H
-#include "coord.h"
-#endif
+
+class XY;
 
 enum {
@@ -38,4 +37,6 @@
 
     void Print();
+
+    ClassDef(MGCoordinates, 0)
 };
 
Index: /trunk/MagicSoft/Cosy/gui/MGCosy.cc
===================================================================
--- /trunk/MagicSoft/Cosy/gui/MGCosy.cc	(revision 1110)
+++ /trunk/MagicSoft/Cosy/gui/MGCosy.cc	(revision 1111)
@@ -4,4 +4,5 @@
 
 #include "msgqueue.h"
+#include "coord.h"
 
 #include <TROOT.h>
@@ -28,4 +29,6 @@
 #include "SlaStars.h"
 
+ClassImp(MGCosy);
+
 #define IDM_EXIT 1
 #define IDM_TEXT 2
@@ -50,6 +53,6 @@
     //
     TGPopupMenu *fFileMenu = new TGPopupMenu(gClient->GetRoot());
-    fFileMenu->AddEntry ("Exit", IDM_EXIT) ;
-    //fFileMenu->Associate(this);
+    fFileMenu->AddEntry("Exit", IDM_EXIT);
+    fFileMenu->Associate(this);
     fList->Add(fFileMenu);
 
@@ -516,5 +519,5 @@
 
                     cout << "Ra/Dec: " << rd.Ra() << kDEG << " " << rd.Dec() << kDEG << endl;
-                    ZdAz aa=sla.CalcZdAz(rd*D2PI/360.0)*360.0/D2PI;
+                    ZdAz aa=sla.CalcZdAz(rd*kDeg2Rad)*kRad2Deg;
                     cout << "Zd/Az: " << aa.Zd() << kDEG << " " << aa.Az() << kDEG << endl;
                 }
Index: /trunk/MagicSoft/Cosy/gui/MGCosy.h
===================================================================
--- /trunk/MagicSoft/Cosy/gui/MGCosy.h	(revision 1110)
+++ /trunk/MagicSoft/Cosy/gui/MGCosy.h	(revision 1111)
@@ -6,15 +6,5 @@
 #endif
 
-//#ifndef ROOT_TOrdCollection
-//#include <TOrdCollection.h>
-//#endif
-
-#ifndef ROOT_TGWidget
-#include <TGWidget.h>
-#endif
-
-#include <iostream.h>
-
-#include "coord.h"
+class TIterator;
 
 class TGLabel;
@@ -23,6 +13,12 @@
 class TGHorizontal3DLine;
 class TGLayoutHints;
+class TGCompositeFrame;
+class TGTab;
+class TGListBox;
+
+class ZdAz;
+class RaDec;
 class MsgQueue;
-class TIterator;
+
 class MGImage;
 class MGList;
@@ -31,7 +27,4 @@
 class MGAccuracy;
 class MGVelocity;
-class TGCompositeFrame;
-class TGTab;
-class TGListBox;
 
 class MGCosy : public TGMainFrame
@@ -99,4 +92,6 @@
 
     Bool_t ProcessMessage(Long_t msg, Long_t mp1, Long_t mp2);
+
+    ClassDef(MGCosy, 0)
 };
 
Index: /trunk/MagicSoft/Cosy/gui/MGEmbeddedCanvas.cc
===================================================================
--- /trunk/MagicSoft/Cosy/gui/MGEmbeddedCanvas.cc	(revision 1110)
+++ /trunk/MagicSoft/Cosy/gui/MGEmbeddedCanvas.cc	(revision 1111)
@@ -9,4 +9,6 @@
 #include <TList.h>
 #include <TCanvas.h>
+
+ClassImp(MGEmbeddedCanvas);
 
 MGEmbeddedCanvas::MGEmbeddedCanvas(const char *name, const TGWindow* p,
Index: /trunk/MagicSoft/Cosy/gui/MGEmbeddedCanvas.h
===================================================================
--- /trunk/MagicSoft/Cosy/gui/MGEmbeddedCanvas.h	(revision 1110)
+++ /trunk/MagicSoft/Cosy/gui/MGEmbeddedCanvas.h	(revision 1111)
@@ -26,7 +26,7 @@
     TList      *fList;
 
-    const UInt_t  fWidth;
-    const Float_t fRange;
-    const Float_t fPix;
+    UInt_t  fWidth; // const: rootcint/TMemberInspector
+    Float_t fRange; // const: rootcint/TMemberInspector
+    Float_t fPix;   // const: rootcint/TMemberInspector
 
     void InitCanvas();
@@ -40,4 +40,6 @@
 
     void SetModified() { fModified = kTRUE; }
+
+    ClassDef(MGEmbeddedCanvas, 0)
 };
 
Index: /trunk/MagicSoft/Cosy/gui/MGImage.cc
===================================================================
--- /trunk/MagicSoft/Cosy/gui/MGImage.cc	(revision 1110)
+++ /trunk/MagicSoft/Cosy/gui/MGImage.cc	(revision 1111)
@@ -11,4 +11,6 @@
 #include <iostream.h>
 #include <pthread.h>
+
+ClassImp(MGImage);
 
 MGImage::MGImage(const TGWindow* p, UInt_t w, UInt_t h, UInt_t options, ULong_t back)
Index: /trunk/MagicSoft/Cosy/gui/MGImage.h
===================================================================
--- /trunk/MagicSoft/Cosy/gui/MGImage.h	(revision 1110)
+++ /trunk/MagicSoft/Cosy/gui/MGImage.h	(revision 1111)
@@ -42,4 +42,6 @@
     void DrawImg(const byte *buffer);
     void DrawColImg(const byte *gbuf, const byte *cbuf);
+
+    ClassDef(MGImage, 0)
 };
 
Index: /trunk/MagicSoft/Cosy/gui/MGSkyPosition.cc
===================================================================
--- /trunk/MagicSoft/Cosy/gui/MGSkyPosition.cc	(revision 1110)
+++ /trunk/MagicSoft/Cosy/gui/MGSkyPosition.cc	(revision 1111)
@@ -17,4 +17,6 @@
 #include "coord.h"
 #include "SlaPlanets.h"
+
+ClassImp(MGSkyPosition);
 
 void MGSkyPosition::InitPlanets()
@@ -208,5 +210,5 @@
     static int Ry=~0;
 
-    const float rad = D2PI*az/360.0;
+    const float rad = az*kDeg2Rad;
 
     const float s = sin(rad);
@@ -306,5 +308,5 @@
     const float c = cos(zdaz.Az());
 
-    const float deg = 360.0/D2PI*zdaz.Zd();
+    const float deg = zdaz.Zd()*kRad2Deg;
 
     const float x = s*deg;
Index: /trunk/MagicSoft/Cosy/gui/MGSkyPosition.h
===================================================================
--- /trunk/MagicSoft/Cosy/gui/MGSkyPosition.h	(revision 1110)
+++ /trunk/MagicSoft/Cosy/gui/MGSkyPosition.h	(revision 1111)
@@ -58,4 +58,6 @@
 
     void Update(ZdAz &pos);
+
+    ClassDef(MGSkyPosition, 0)
 };
 
Index: /trunk/MagicSoft/Cosy/gui/MGStarguider.cc
===================================================================
--- /trunk/MagicSoft/Cosy/gui/MGStarguider.cc	(revision 1110)
+++ /trunk/MagicSoft/Cosy/gui/MGStarguider.cc	(revision 1111)
@@ -10,7 +10,13 @@
 #include "MGCoordinates.h"
 
+#include "coord.h"
+
+#include "StarCatalog.h"
+
 #include "Filter.h"
 #include "Writer.h"
 #include "base/timer.h"
+
+ClassImp(MGStarguider);
 
 enum {
@@ -42,6 +48,11 @@
 
 MGStarguider::MGStarguider()
-: Camera(), TGMainFrame(gClient->GetRoot(), 768, 700), fRaDec(180, 40)
-{
+: Camera(), TGMainFrame(gClient->GetRoot(), 768, 700)
+{
+    fList = new MGList;
+
+    fSao = new StarCatalog;
+    fRaDec = new RaDec(180, 40);
+
     // p = pointer to MainFrame (not owner)
 
@@ -55,5 +66,5 @@
     fDisplay->AddEntry("Sao &Catalog", IDM_kCatalog);
     fDisplay->Associate(this);
-    fList.Add(fDisplay);
+    fList->Add(fDisplay);
 
     fFileType = new TGPopupMenu(p);
@@ -62,5 +73,5 @@
     fFileType->CheckEntry(IDM_kPNG);
     fFileType->Associate(this);
-    fList.Add(fFileType);
+    fList->Add(fFileType);
 
     fWriteType = new TGPopupMenu(p);
@@ -69,5 +80,5 @@
     fWriteType->CheckEntry(IDM_kOnce);
     fWriteType->Associate(this);
-    fList.Add(fWriteType);
+    fList->Add(fWriteType);
 
     fWriteRate = new TGPopupMenu(p);
@@ -81,5 +92,5 @@
     fWriteRate->CheckEntry(IDM_kRate1m);
     fWriteRate->Associate(this);
-    fList.Add(fWriteRate);
+    fList->Add(fWriteRate);
 
     fWrtRate = 25*60;
@@ -94,5 +105,5 @@
     fWrite->DisableEntry(IDM_kStop);
     fWrite->Associate(this);
-    fList.Add(fWrite);
+    fList->Add(fWrite);
 
     fLimMag = new TGPopupMenu(p);
@@ -106,12 +117,12 @@
     fLimMag->CheckEntry(IDM_kLimMag8);
     fLimMag->Associate(this);
-    fList.Add(fLimMag);
-
-    fSao.SetLimitMag(8.0);
+    fList->Add(fLimMag);
+
+    fSao->SetLimitMag(8.0);
 
     fSetup = new TGPopupMenu(p);
     fSetup->AddPopup("Lim. &Magnitude", fLimMag);
     fSetup->Associate(this);
-    fList.Add(fSetup);
+    fList->Add(fSetup);
 
     fMenu = new TGMenuBar(this, 0, 0, kHorizontalFrame);
@@ -121,19 +132,19 @@
     fMenu->Resize(fMenu->GetDefaultSize());
     AddFrame(fMenu); //, new TGLayoutHints (kLHintsNormal, 0, 4, 0, 0));
-    fList.Add(fMenu);
+    fList->Add(fMenu);
 
     fCRaDec = new MGCoordinates(this, kETypeRaDec);
     fCRaDec->Move(1, fMenu->GetDefaultHeight()+584);
     AddFrame(fCRaDec);
-    fList.Add(fCRaDec);
+    fList->Add(fCRaDec);
 
     fCZdAz = new MGCoordinates(this, kETypeZdAz);
     fCZdAz->Move(240+12, fMenu->GetDefaultHeight()+584);
     AddFrame(fCZdAz);
-    fList.Add(fCZdAz);
+    fList->Add(fCZdAz);
 
     // TGHorizontal3DLine *fLineSep = new TGHorizontal3DLine(this);
     // AddFrame(fLineSep, new TGLayoutHints (kLHintsNormal | kLHintsExpandX));
-    // fList.Add(fLineSep);
+    // fList->Add(fLineSep);
 
     //
@@ -143,5 +154,5 @@
     fImage->Move(0, fMenu->GetDefaultHeight());
     AddFrame(fImage);
-    fList.Add(fImage);
+    fList->Add(fImage);
 
     //
@@ -154,9 +165,13 @@
     MapWindow();
 
-    fSao.SetPixSize(0.006);
+    fSao->SetPixSize(0.006);
 }
 
 MGStarguider::~MGStarguider()
 {
+    delete fSao;
+    delete fRaDec;
+
+    delete fList;
     cout << "Camera Display destroyed." << endl;
 }
@@ -281,5 +296,5 @@
                         fLimMag->UnCheckEntry(i);
 
-                fSao.SetLimitMag(mp1-IDM_kLimMag3+3);
+                fSao->SetLimitMag(mp1-IDM_kLimMag3+3);
                 return kTRUE;
             }
@@ -331,11 +346,11 @@
             XY xy = fCRaDec->GetCoordinates();
 
-            fRaDec.Set(xy.X(), xy.Y());
+            fRaDec->Set(xy.X(), xy.Y());
 
             Timer time(tm);
-            fSao.GetImg(img, cimg, time.CalcMjd(), fRaDec);
+            fSao->GetImg(img, cimg, time.CalcMjd(), *fRaDec);
             fImage->DrawColImg(img, cimg);
 
-            fCZdAz->SetCoordinates(fSao.GetZdAz());
+            fCZdAz->SetCoordinates(fSao->GetZdAz());
         }
         else
Index: /trunk/MagicSoft/Cosy/gui/MGStarguider.h
===================================================================
--- /trunk/MagicSoft/Cosy/gui/MGStarguider.h	(revision 1110)
+++ /trunk/MagicSoft/Cosy/gui/MGStarguider.h	(revision 1111)
@@ -11,5 +11,6 @@
 #include "MGList.h"
 #include "MGImage.h"
-#include "StarCatalog.h"
+
+class RaDec;
 
 class TGMenuBar;
@@ -19,8 +20,10 @@
 class MGCoordinates;
 
+class StarCatalog;
+
 class MGStarguider : public Camera, public TGMainFrame
 {
 private:
-    MGList         fList;
+    MGList        *fList;
 
     TGMenuBar     *fMenu;
@@ -38,7 +41,7 @@
     MGCoordinates *fCZdAz;
 
-    StarCatalog    fSao;
+    StarCatalog   *fSao;
 
-    RaDec fRaDec;
+    RaDec *fRaDec;
 
     int fWrtRate;
@@ -50,5 +53,5 @@
     virtual ~MGStarguider();
 
-    void Update();
+    //void Update();
 
     void Layout();
@@ -61,4 +64,6 @@
     //
     void ProcessFrame(const unsigned long n, byte *img, struct timeval *tm);
+
+    ClassDef(MGStarguider, 0)
 };
 
Index: /trunk/MagicSoft/Cosy/gui/MGVelocity.cc
===================================================================
--- /trunk/MagicSoft/Cosy/gui/MGVelocity.cc	(revision 1110)
+++ /trunk/MagicSoft/Cosy/gui/MGVelocity.cc	(revision 1111)
@@ -20,4 +20,6 @@
 #include "coord.h"
 
+ClassImp(MGVelocity);
+
 void MGVelocity::DrawCoordinateSystem()
 {
Index: /trunk/MagicSoft/Cosy/gui/MGVelocity.h
===================================================================
--- /trunk/MagicSoft/Cosy/gui/MGVelocity.h	(revision 1110)
+++ /trunk/MagicSoft/Cosy/gui/MGVelocity.h	(revision 1111)
@@ -51,4 +51,6 @@
 
     void Update(ZdAz &pos);
+
+    ClassDef(MGVelocity, 0)
 };
 
Index: /trunk/MagicSoft/Cosy/main/MCosy.cc
===================================================================
--- /trunk/MagicSoft/Cosy/main/MCosy.cc	(revision 1110)
+++ /trunk/MagicSoft/Cosy/main/MCosy.cc	(revision 1111)
@@ -22,4 +22,6 @@
 //#include <sys/resource.h>  // PRIO_PROCESS
 
+ClassImp(MCosy);
+
 typedef struct tm tm_t;
 
@@ -32,15 +34,15 @@
 double Rad2SE(double rad)
 {
-    return 16384.0/D2PI*rad;
+    return 16384.0/k2Pi*rad;
 }
 
 double Rad2ZdRE(double rad)
 {
-    return 16384.0/D2PI*rad*kGearRatio.X();
+    return 16384.0/k2Pi*rad*kGearRatio.X();
 }
 
 double Rad2AzRE(double rad)
 {
-    return 16384.0/D2PI*rad*kGearRatio.Y();
+    return 16384.0/k2Pi*rad*kGearRatio.Y();
 }
 
@@ -68,8 +70,8 @@
 
     ZdAz source = src * 360.0/16384.0;
-    ZdAz dest   = dst * 360.0/D2PI;
+    ZdAz dest   = dst * kRad2Deg;
 
     if (dest.Zd()>-1e-6 && dest.Zd()<1e-6)
-        return dst*(16384.0/D2PI);
+        return dst*(16384.0/k2Pi);
 
     const float fZdMin = -67;
@@ -122,7 +124,18 @@
 }
 
-
+// --------------------------------------------------------------------------
+//
+//  GetSePos, reads the Shaftencoder positions from the Can-drivers
+//  for the shaftencoders. The two shaft encoders at the elevation axis
+//  are avaraged. The values are returned as a ZdAz object.
+//
+//  The positions are alway up-to-date because the shaftencoders are
+//  sending all changes immediatly.
+//
 ZdAz MCosy::GetSePos()
 {
+    //
+    // Get the values
+    //
     const int p0 = fZd1->GetPos();
     const int p1 = fZd2->GetPos();
@@ -144,4 +157,46 @@
 }
 
+// --------------------------------------------------------------------------
+//
+// request the current positions from the rotary encoders.
+// use GetRePos to get the psotions. If the request fails the function
+// returns kFALSE, otherwise kTRUE
+//
+Bool_t MCosy::RequestRePos()
+{
+    //
+    // Send request
+    //
+    fMac2->RequestSDO(0x6004);
+    fMac1->RequestSDO(0x6004);
+
+    //
+    // Wait until the objects are received.
+    //
+    WaitForSdos();
+
+    //
+    // If waitng was not interrupted everything is ok. return.
+    //
+    if (!StopWaitingForSDO())
+        return kTRUE;
+
+    //
+    // If the waiting was interrupted due to a network error,
+    // print some logging message.
+    //
+    if (HasError())
+        lout << "Error #6004 (requesting re pos from Macs) happened." << endl;
+
+    return kFALSE;
+}
+
+// --------------------------------------------------------------------------
+//
+//  reads the Rotary encoder positions from the last request of the Macs.
+//
+//  The positions are returned as a ZdAz object. Use RequestRePos to request
+//  the current positions first.
+//
 ZdAz MCosy::GetRePos()
 {
@@ -149,4 +204,13 @@
 }
 
+// --------------------------------------------------------------------------
+//
+//  reads the Rotary encoder positions from the Macs.
+//
+//  The positions are returned as a ZdAz object. The positions are the ones
+//  which are send as PDOs to the computer. This is done at a given
+//  frequency. Which means, that this positions are not ought to be
+//  up-to-date.
+//
 ZdAz MCosy::GetRePosPdo()
 {
@@ -154,4 +218,14 @@
 }
 
+// --------------------------------------------------------------------------
+//
+//  set the velocity and accelerations for position maneuvers.
+//
+//  The acceleratin is set as given (in percent of maximum).
+//  The velocity is given in percent, depending on the ratio (<1 or >1)
+//  one of the axis becomes a slower velocity. This is used for maneuvers
+//  in which both axis are moved synchromously and should reach their
+//  target position at the same time.
+//
 void MCosy::SetPosVelocity(const Float_t ratio, Float_t vel, Float_t acc)
 {
@@ -186,7 +260,16 @@
 }
 
+// --------------------------------------------------------------------------
+//
+// Does a relative positioning.
+//
+// The steps to move are given in a ZdAz object relative to the current
+// position. The coordinates are given in Roteryencoder steps.
+// Axis 1 is moved only if axe1==kTRUE, Axis 2 is moved only
+// if Axis 2==kTRUE. The function waits for the movement to be finished.
+//
 void MCosy::DoRelPos(const ZdAz &rd, const Bool_t axe1, const Bool_t axe2)
 {
-    SetStatus(kMoving);
+    SetStatus(MCosy::kMoving);
 
     if (axe1) fMac2->StartRelPos(rd.Zd());
@@ -200,21 +283,80 @@
 }
 
+// --------------------------------------------------------------------------
+//
+// check for a break-signal (from the msgqueue) and errors.
+//
+int MCosy::StopWaitingForSDO() const
+{
+    return Break() || HasError();
+}
+
+// --------------------------------------------------------------------------
+//
+// Waits for a movement to become finished.
+//
+// First waits for all peding Sdos, then waits until both motors are stopped
+// or waiting for SDOs was stopped (either by an error or by Break)
+//
+void MCosy::WaitForEndMovement()
+{
+    WaitForSdos();
+
+    while ((fMac1->IsPositioning() || fMac2->IsPositioning()) && !StopWaitingForSDO())
+        usleep(1);
+}
+
+// --------------------------------------------------------------------------
+//
+// Check for an error...
+//
+// This is ment for usage after the Action: All Motors Stop.
+//
 void MCosy::CheckForError()
 {
+    //
+    // Check all Can-Nodes for an Error. If there is no error the motor
+    // status is set to stopped.
+    //
     if (!HasError())
     {
-        SetStatus(kStopped);
+        SetStatus(MCosy::kStopped);
         return;
     }
 
-    SetStatus(kError);
+    //
+    // If there is an error, the error status is set to Error.
+    //
+    SetStatus(MCosy::kError);
+
+    //
+    // No try to handle the error.
+    //
     fMac1->HandleError();
     fMac2->HandleError();
+
+    //
+    // If the error couldn't get solved return
+    //
     if (HasError())
         return;
 
-    SetStatus(kStopped);
-}
-
+    //
+    // Set motor status to stopped
+    //
+    SetStatus(MCosy::kStopped);
+}
+
+// --------------------------------------------------------------------------
+//
+// Move the telescope to the given position. The position must be given in
+// a ZdAz object in rad.
+//
+// The first positioning is done absolutely. If we didn't reach the
+// correct psotion we try to correct for this by 10 relative position
+// maneuvers. If this doesn't help positioning failed.
+//
+// As a reference the shaftencoder values are used.
+//
 int MCosy::SetPosition(const ZdAz &dst) // [rad]
 {
@@ -296,27 +438,33 @@
 }
 
-Bool_t MCosy::RequestRePos()
-{
-
-    fMac2->RequestSDO(0x6004);
-    fMac1->RequestSDO(0x6004);
+// --------------------------------------------------------------------------
+//
+// Sets the tracking velocity
+//
+// The velocities are given in a ZdAz object in re/min. Return kTRUE
+// in case of success, kFALSE in case of failure.
+//
+Bool_t MCosy::SetVelocity(ZdAz v)
+{
+    //
+    // Send the new velocities for both axes.
+    //
+    fMac2->SendSDO(0x3006, 1, (LWORD_t)v.Zd());  // SetRpmVelocity [re/min]
+    fMac1->SendSDO(0x3006, 1, (LWORD_t)v.Az());  // SetRpmVelocity [re/min]
+
+    //
+    // Wait for the objects to be OKed.
+    //
     WaitForSdos();
+
+    //
+    // If the waiting for the objects wasn't interrupted return kTRUE
+    //
     if (!StopWaitingForSDO())
         return kTRUE;
 
-    if (HasError())
-        lout << "Error #6004 (requesting re pos from Macs) happened." << endl;
-
-    return kFALSE;
-}
-
-Bool_t MCosy::SetVelocity(ZdAz v)
-{
-    fMac2->SendSDO(0x3006, 1, (LWORD_t)v.Zd());  // SetRpmVelocity [re/min]
-    fMac1->SendSDO(0x3006, 1, (LWORD_t)v.Az());  // SetRpmVelocity [re/min]
-    WaitForSdos();
-    if (!StopWaitingForSDO())
-        return kTRUE;
-
+    //
+    // print a message if the interruption was due to a Can-node Error
+    //
     if (HasError())
         lout << "Error #3006 (setting velocity of Macs) happened." << endl;
@@ -325,4 +473,12 @@
 }
 
+// --------------------------------------------------------------------------
+//
+// Initializes Tracking mode
+//
+// Initializes the accelerations of both axes with 90% of the maximum
+// acceleration. Set the status for moving and tracking and starts thr
+// revolution mode.
+//
 void MCosy::InitTracking()
 {
@@ -336,5 +492,5 @@
     fMac1->SetDeceleration(0.90*fMac1->GetVelRes());
 
-    SetStatus(kMoving | kTracking);
+    SetStatus(MCosy::kMoving | MCosy::kTracking);
 
     fMac2->SetRpmMode(TRUE);
@@ -342,4 +498,12 @@
 }
 
+// --------------------------------------------------------------------------
+//
+// Limits the speed. 
+//
+// This function should work as a limiter. If a tracking error is too large
+// to be corrected fast enough we would get enormous velocities. These
+// velocities are limited to the maximum velocity.
+//
 void MCosy::LimitSpeed(ZdAz *vt, const ZdAz &vcalc) const
 {
@@ -527,34 +691,42 @@
 }
 
-int MCosy::IsPositioning() const
-{
-    return (fMac1->IsPositioning() || fMac2->IsPositioning()) && !StopWaitingForSDO();
-}
-
-void MCosy::WaitForEndMovement()
-{
-    WaitForSdos();
-
-    while (IsPositioning())
-        usleep(1);
-}
-
+// --------------------------------------------------------------------------
+//
+// Stops the movement of both motors.
+//
+// Sets the status to stopping. Sets the deceleration to 50% of the maximum.
+// stops. Quits the revolution mode and wait for the end of the movement.
+//
 void MCosy::StopMovement()
 {
-    SetStatus(kStopping);
-
+    //
+    // Set status to stopped
+    //
+    SetStatus(MCosy::kStopping);
+
+    //
+    // set deceleration to 50%
+    //
     cout << "Stopping  positioning..." << endl;
     fMac1->SetDeceleration(0.5*fMac1->GetVelRes());
     fMac2->SetDeceleration(0.5*fMac2->GetVelRes());
 
-    cout << "Stoping possible RPM mode..." << endl;
+    //
+    // Stop revolution mode (movement)
+    //
+    cout << "Stoping possibleRPM mode..." << endl;
     fMac1->SetRpmMode(FALSE);
     fMac2->SetRpmMode(FALSE);
 
+    //
+    // Wait for the movement to really be finished.
+    //
     cout << "Waiting for silence..." << endl;
     WaitForEndMovement();
 
+    //
+    // Check whether everything works fine.
+    //
     CheckForError();
-
     cout << "Movement stopped." << endl;
 }
@@ -587,5 +759,5 @@
 
             RaDec rd(37.94, 89.2644);
-            ZdAz za=sla.CalcZdAz(rd*D2PI/360.0)*16384.0/D2PI;
+            ZdAz za=sla.CalcZdAz(rd*kDeg2Rad)*16384.0/k2Pi;
 
             cout << "Calc Zd: " << za.Zd() << " Az: " << za.Az() << endl;
@@ -607,5 +779,5 @@
             ZdAz dest = *((ZdAz*)mp);
 
-            SetPosition(dest*D2PI/360.0);
+            SetPosition(dest*kDeg2Rad);
         }
         cout << "WM_Position: done. (return 0x7777)" << endl;
@@ -616,5 +788,5 @@
         {
             RaDec dest = *((RaDec*)mp);
-            TrackPosition(dest*D2PI/360.0);
+            TrackPosition(dest*kDeg2Rad);
         }
         cout << "WM_Track: done. (return 0x8888)" << endl;
@@ -843,9 +1015,12 @@
 
 
-int MCosy::StopWaitingForSDO() const
-{
-    return Break() || HasError();
-}
-
+// --------------------------------------------------------------------------
+//
+// Start the work of the application:
+//
+// Start the Can-Network.
+// Start the MCosy::TalkThread thread.
+// turn on the gui update
+//
 void MCosy::Start()
 {
@@ -861,4 +1036,12 @@
 }
 
+// --------------------------------------------------------------------------
+//
+// Start the work of the application:
+//
+// Turn of the gui update
+// stop the MCosy::TalkThread thread.
+// Stop the network
+//
 void MCosy::Stop()
 {
Index: /trunk/MagicSoft/Cosy/main/MCosy.h
===================================================================
--- /trunk/MagicSoft/Cosy/main/MCosy.h	(revision 1110)
+++ /trunk/MagicSoft/Cosy/main/MCosy.h	(revision 1111)
@@ -37,9 +37,4 @@
 };
 
-#define kError     0x01
-#define kMoving    0x02
-#define kTracking  0x04
-#define kStopping  0x08
-#define kStopped   0x10
 
 class TTimer;
@@ -50,4 +45,13 @@
 
 private:
+    enum
+    {
+        kError    = 0x01,
+        kMoving   = 0x02,
+        kTracking = 0x04,
+        kStopping = 0x08,
+        kStopped  = 0x10
+    };
+
     ShaftEncoder *fZd1;
     ShaftEncoder *fZd2;
@@ -99,5 +103,4 @@
 
     int StopWaitingForSDO() const;
-    int IsPositioning() const;
     void CheckForError();
 
@@ -117,6 +120,7 @@
 
     static ZdAz CorrectTarget(const ZdAz &src, const ZdAz &dst);
-//    static ZdAz RaDec2ZdAz(const double mjd, const RaDec &pos, const RaDec &pm=RaDec(0,0));
+    //    static ZdAz RaDec2ZdAz(const double mjd, const RaDec &pos, const RaDec &pm=RaDec(0,0));
 
+    ClassDef(MCosy, 0)
 };
 
Index: unk/MagicSoft/Cosy/main/MainCint.h
===================================================================
--- /trunk/MagicSoft/Cosy/main/MainCint.h	(revision 1110)
+++ 	(revision )
@@ -1,35 +1,0 @@
-/********************************************************************
-* MainCint.h
-********************************************************************/
-#ifdef __CINT__
-#error MainCint.h/C is only for compilation. Abort cint.
-#endif
-#include <stddef.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-#define G__ANSIHEADER
-#define G__DICTIONARY
-#include "G__ci.h"
-extern "C" {
-extern void G__cpp_setup_tagtableMainCint();
-extern void G__cpp_setup_inheritanceMainCint();
-extern void G__cpp_setup_typetableMainCint();
-extern void G__cpp_setup_memvarMainCint();
-extern void G__cpp_setup_globalMainCint();
-extern void G__cpp_setup_memfuncMainCint();
-extern void G__cpp_setup_funcMainCint();
-extern void G__set_cpp_environmentMainCint();
-}
-
-
-#include "TROOT.h"
-#include "TMemberInspector.h"
-#include "MainIncl.h"
-
-#ifndef G__MEMFUNCBODY
-#endif
-
-
-/* STUB derived class for protected member access */
Index: /trunk/MagicSoft/Cosy/main/MainLinkDef.h
===================================================================
--- /trunk/MagicSoft/Cosy/main/MainLinkDef.h	(revision 1110)
+++ /trunk/MagicSoft/Cosy/main/MainLinkDef.h	(revision 1111)
@@ -5,3 +5,5 @@
 #pragma link off all functions;
 
+#pragma link C++ class MCosy;
+
 #endif
Index: /trunk/MagicSoft/Cosy/main/Makefile
===================================================================
--- /trunk/MagicSoft/Cosy/main/Makefile	(revision 1110)
+++ /trunk/MagicSoft/Cosy/main/Makefile	(revision 1111)
@@ -35,7 +35,8 @@
            MStarguider.cc
 
-SRCS    = $(SRCFILES)
-HEADERS = $(SRCFILES:.cc=.h)
-OBJS    = $(SRCFILES:.cc=.o) 
+SRCS        = $(SRCFILES)
+HEADERS     = $(SRCFILES:.cc=.h)
+OBJS        = $(SRCFILES:.cc=.o) 
+CINTHEADERS = $(HEADERS)
 
 ############################################################
Index: /trunk/MagicSoft/Cosy/videodev/Camera.cc
===================================================================
--- /trunk/MagicSoft/Cosy/videodev/Camera.cc	(revision 1110)
+++ /trunk/MagicSoft/Cosy/videodev/Camera.cc	(revision 1111)
@@ -21,4 +21,6 @@
 #include <sys/resource.h>
 
+ClassImp(Camera);
+
 inline int Camera::Ioctl(int req, void *opt, const char *str)
 {
Index: /trunk/MagicSoft/Cosy/videodev/Camera.h
===================================================================
--- /trunk/MagicSoft/Cosy/videodev/Camera.h	(revision 1110)
+++ /trunk/MagicSoft/Cosy/videodev/Camera.h	(revision 1111)
@@ -2,6 +2,15 @@
 #define CAMERA_H
 
+#ifdef __CINT__
+typedef unsigned long int pthread_t;
+struct pthread_mutex_t;
+struct pthread_cond_t;
+struct timeval;
+#else
+#include <TROOT.h>
 #include <pthread.h>
 #include <sys/time.h>
+#endif
+
 
 typedef unsigned char byte;
@@ -95,4 +104,5 @@
     void GetPicPar(int *bright, int *hue, int *contrast);
 
+    ClassDef(Camera, 0)
 };
 
Index: /trunk/MagicSoft/Cosy/videodev/Filter.cc
===================================================================
--- /trunk/MagicSoft/Cosy/videodev/Filter.cc	(revision 1110)
+++ /trunk/MagicSoft/Cosy/videodev/Filter.cc	(revision 1111)
@@ -3,4 +3,6 @@
 #include <memory.h>   // memset
 #include <iostream.h> // cout
+
+ClassImp(Filter);
 
 void Filter::DrawBox(const int x1, const int y1,
Index: /trunk/MagicSoft/Cosy/videodev/Filter.h
===================================================================
--- /trunk/MagicSoft/Cosy/videodev/Filter.h	(revision 1110)
+++ /trunk/MagicSoft/Cosy/videodev/Filter.h	(revision 1111)
@@ -1,4 +1,8 @@
 #ifndef FILTER_H
 #define FILTER_H
+
+#ifndef __CINT__
+#include <TROOT.h>
+#endif
 
 typedef unsigned char byte;
@@ -25,4 +29,6 @@
 public:
     static void Execute(byte *img);
+
+    ClassDef(Filter, 0)
 };
 
Index: /trunk/MagicSoft/Cosy/videodev/Makefile
===================================================================
--- /trunk/MagicSoft/Cosy/videodev/Makefile	(revision 1110)
+++ /trunk/MagicSoft/Cosy/videodev/Makefile	(revision 1111)
@@ -35,7 +35,8 @@
            Writer.cc 
 
-SRCS    = $(SRCFILES)
-HEADERS = $(SRCFILES:.cc=.h)
-OBJS    = $(SRCFILES:.cc=.o) 
+SRCS        = $(SRCFILES)
+HEADERS     = $(SRCFILES:.cc=.h)
+OBJS        = $(SRCFILES:.cc=.o) 
+CINTHEADERS = $(HEADERS)
 
 ############################################################
Index: /trunk/MagicSoft/Cosy/videodev/VideodevLinkDef.h
===================================================================
--- /trunk/MagicSoft/Cosy/videodev/VideodevLinkDef.h	(revision 1110)
+++ /trunk/MagicSoft/Cosy/videodev/VideodevLinkDef.h	(revision 1111)
@@ -5,3 +5,8 @@
 #pragma link off all functions;
 
+#pragma link C++ class Writer+;
+#pragma link C++ class Filter+;
+
+#pragma link C++ class Camera+;
+
 #endif
Index: /trunk/MagicSoft/Cosy/videodev/Writer.cc
===================================================================
--- /trunk/MagicSoft/Cosy/videodev/Writer.cc	(revision 1110)
+++ /trunk/MagicSoft/Cosy/videodev/Writer.cc	(revision 1111)
@@ -8,4 +8,6 @@
 
 #include "base/timer.h"
+
+ClassImp(Writer);
 
 void Writer::Png(const char *fname, const byte *buf,
Index: /trunk/MagicSoft/Cosy/videodev/Writer.h
===================================================================
--- /trunk/MagicSoft/Cosy/videodev/Writer.h	(revision 1110)
+++ /trunk/MagicSoft/Cosy/videodev/Writer.h	(revision 1111)
@@ -2,5 +2,10 @@
 #define WRITER_H
 
+#ifdef __CINT__
+struct timeval;
+#else
+#include <TROOT.h>
 #include <sys/time.h>
+#endif
 
 typedef unsigned char byte;
@@ -14,4 +19,6 @@
     static void Ppm(const char *fname, const byte *img);
     static void Png(const char *fname, const byte *buf, struct timeval *date);
+
+    ClassDef(Writer, 0)
 };
 
