Index: /trunk/MagicSoft/Cosy/Changelog
===================================================================
--- /trunk/MagicSoft/Cosy/Changelog	(revision 1817)
+++ /trunk/MagicSoft/Cosy/Changelog	(revision 1818)
@@ -575,4 +575,70 @@
      - added Reset Bending
      - changed the MAC and SE Id to be a resource value (from .cosyrc)
+
+
+
+ 2002/12/18 - Thomas Bretz (LaPalma):
+
+   * Makefile:
+     - added cosy.so
+   
+   * base/BaseLinkDef.h, base/Makefile:
+     - added MGList
+
+   * catalog/SlaStars.cc:
+     - changed temperature to 20degC
+     - changed wavelength to 0.55
+     
+   * main/MCosy.[h,cc]:
+     - added correct gear ratio for magic
+     - added support for mode in which not all clients are available
+     - added demo and shaftencoder mode
+     - added support for the bending correction
+     - removed support for 'the shortest distance' when positioning
+
+   * videodev/Makefile, videodev/VideodevLinkDef.:
+     - added Filter2 for Starguider
+
+   * base/MStarList.[h,cc], base/MStar.[h,cc], main/MBending.[h,cc]:
+     - added
+ 
+   * starg.cc:
+     - slight changes to get rid of the segfault when program ends
+
+   * base/MGList.h:
+     - changed from TOrdCollection to TList
+     - added some debug stuff
+
+   * candrv/network.cc:
+     - added 'Zombie' support
+   
+   * candrv/nodedrv.[h,cc]:
+     - added WaitForSDO return type
+     - added 'Zombie' support
+   
+   * devdrv/macs.[h,cc]:
+     - added 0x6501, econder resolution
+
+   * devdrv/shaftencoder.[h,cc]:
+     - added 'Zombie' support
+     - added data member for phys resolution
+ 
+   * gui/MGCosy.cc:
+     - added SetAspect-stuff
+ 
+   * gui/MGEmbeddedCanvas.cc:
+     - removed debugging output
+ 
+   * gui/MGImage.[h,cc]:
+     - changed update not to produce X11 Asyn Errors
+ 
+   * gui/MGSkyPosition.[h,cc], gui/MGVelocity.cc:
+     - removed some wrong floor-calls
+ 
+   * gui/MGStarguider.[h,cc]:
+     - added better support for camera display update
+   
+   * macros/rootlogon.C:
+     - added paths
 
 
Index: unk/MagicSoft/Cosy/MStarguider.cc
===================================================================
--- /trunk/MagicSoft/Cosy/MStarguider.cc	(revision 1817)
+++ 	(revision )
@@ -1,95 +1,0 @@
-#include "MStarguider.h"
-/*
-#include <iostream.h>
-#include <signal.h>
-
-#include <TROOT.h>
-#include <TSystem.h>
-#include <TCanvas.h>
-#include <TApplication.h>
-
-#include "timer.h"
-#include "Writer.h"
-#include "grab-v4l.h"
-#include "StarDisplay.h"
-#include "CameraDisplay.h"
-*/
-/* ---------------------------------------------------------------------- */
-/*
-void MStarguider::ReadoutLoop()
-{
-    //disp->Update();
-
-    //---    WriterPng png(768, 576);
-    //---    Writer task1(&png, 25*5/1);  // one png per five seconds
-
-    // ---
-    fCcd = new Camera;
-    CameraDisplay *task=new CameraDisplay(gClient->GetRoot());
-
-    fCcd->SetIntegrationNum(1);
-//    fCcd->Loop(task, 25*60*15); // 15min
-
-    //
-    // Stop Application Loop
-    //
-
-    //
-    // FIXME! stupid workaround for tasks without a gui!
-    //
-    //---
-    // TCanvas *c = new TCanvas("Dummy", "Dummy");
-
-//    gStopLoop= 1;
-//    while (fCcd->IsRunning())
-//        sleep(1);
-
-    delete fCcd;
-    //delete task;
-
-    gSystem->ExitLoop();
-    gSystem->DispatchOneEvent(kTRUE);
-    // ReturnFromRun(); // SetReturnFromRun();
-
-
-    cout << "Event Loop Done." << endl;
-}
-
-void *MStarguider::MapReadoutLoop(void *arg)
-{
-    MStarguider *starg = (MStarguider*)arg;
-
-    starg->ReadoutLoop();
-
-    return NULL;
-}
-
-void MStarguider::StartReadoutLoop()
-{
-    pthread_t thread;
-    if (pthread_create(&thread, NULL, MapReadoutLoop, this))
-    {
-        cout << "Error starting main thread." << endl;
-        exit(0);
-    }
-    pthread_detach(thread);
-}
-
-MStarguider::MStarguider(int *argc, char **argv, void *options=0,
-                         int numOptions=0)
-: TApplication("Starguider", argc, argv, options, numOptions), fCcd(NULL)
-{
-
-    signal(SIGINT, SignalRcvd);
-
-    //---
-
-    StartReadoutLoop();
-}
-
-MStarguider::~MStarguider()
-{
-    //---
-}
-
-*/
Index: unk/MagicSoft/Cosy/MStarguider.h
===================================================================
--- /trunk/MagicSoft/Cosy/MStarguider.h	(revision 1817)
+++ 	(revision )
@@ -1,24 +1,0 @@
-#ifndef MSTARGUIDER_H
-#define MSTARGUIDER_H
-
-#include "Camera.h"
-#include "Starguider.h"
-
-class MStarguider : public Camera
-{
-private:
-    Starguider *fDisplay;
-
-public:
-    MStarguider()
-    {
-        fDisplay = new Starguider;
-    }
-
-    ~MStarguider()
-    {
-        delete fDisplay;
-    }
-};
-
-#endif
Index: unk/MagicSoft/Cosy/Starguider.cc
===================================================================
--- /trunk/MagicSoft/Cosy/Starguider.cc	(revision 1817)
+++ 	(revision )
@@ -1,398 +1,0 @@
-#include "Starguider.h"
-
-#include <iostream.h> // cout
-
-#include <TGMenu.h>
-#include <TSystem.h>
-#include <TGSplitter.h>    // TGHorizontal3DLine
-
-#include "MGImage.h"
-#include "MGCoordinates.h"
-
-#include "Filter.h"
-#include "Writer.h"
-#include "base/timer.h"
-
-enum {
-    IDM_kFilter,
-    IDM_kCatalog,
-    IDM_kStart,
-    IDM_kStop,
-    IDM_kFileType,
-    IDM_kPPM,
-    IDM_kPNG,
-    IDM_kOnce,
-    IDM_kContinous,
-    IDM_kRate25ps,
-    IDM_kRate5ps,
-    IDM_kRate1s,
-    IDM_kRate5s,
-    IDM_kRate30s,
-    IDM_kRate1m,
-    IDM_kRate5m,
-    IDM_kSetup,
-    IDM_kLimMag3,
-    IDM_kLimMag4,
-    IDM_kLimMag5,
-    IDM_kLimMag6,
-    IDM_kLimMag7,
-    IDM_kLimMag8,
-    IDM_kLimMag9,
-    IDM_kInterpol125,
-    IDM_kInterpol25,
-    IDM_kInterpol10,
-    IDM_kInterpol5,
-    IDM_kInterpol2,
-    IDM_kInterpol1
-};
-
-Starguider::Starguider()
-: Camera(), TGMainFrame(gClient->GetRoot(), 768, 700), fRaDec(180, 40)
-{
-    // p = pointer to MainFrame (not owner)
-
-    const TGWindow *p=gClient->GetRoot();
-
-    //
-    // Create Menu for Starguider Display
-    //
-    fDisplay = new TGPopupMenu(p);
-    fDisplay->AddEntry("&Filter",      IDM_kFilter);
-    fDisplay->AddEntry("Sao &Catalog", IDM_kCatalog);
-    fDisplay->Associate(this);
-    fList.Add(fDisplay);
-
-    fFileType = new TGPopupMenu(p);
-    fFileType->AddEntry("PP&M", IDM_kPPM);
-    fFileType->AddEntry("&PNG", IDM_kPNG);
-    fFileType->CheckEntry(IDM_kPNG);
-    fFileType->Associate(this);
-    fList.Add(fFileType);
-
-    fWriteType = new TGPopupMenu(p);
-    fWriteType->AddEntry("Once",      IDM_kOnce);
-    fWriteType->AddEntry("Continous", IDM_kContinous);
-    fWriteType->CheckEntry(IDM_kOnce);
-    fWriteType->Associate(this);
-    fList.Add(fWriteType);
-
-    fWriteRate = new TGPopupMenu(p);
-    fWriteRate->AddEntry("25/s", IDM_kRate25ps);
-    fWriteRate->AddEntry("5/s",  IDM_kRate5ps);
-    fWriteRate->AddEntry("1s",   IDM_kRate1s);
-    fWriteRate->AddEntry("5s",   IDM_kRate5s);
-    fWriteRate->AddEntry("30s",  IDM_kRate30s);
-    fWriteRate->AddEntry("1min", IDM_kRate1m);
-    fWriteRate->AddEntry("5min", IDM_kRate5m);
-    fWriteRate->CheckEntry(IDM_kRate1m);
-    fWriteRate->Associate(this);
-    fList.Add(fWriteRate);
-
-    fWrtRate = 25*60;
-
-    fInterpol = new TGPopupMenu(p);
-    fInterpol->AddEntry("125", IDM_kInterpol125);
-    fInterpol->AddEntry("25",  IDM_kInterpol25);
-    fInterpol->AddEntry("10",  IDM_kInterpol10);
-    fInterpol->AddEntry("5",   IDM_kInterpol5);
-    fInterpol->AddEntry("2",   IDM_kInterpol2);
-    fInterpol->AddEntry("Off", IDM_kInterpol1);
-    fInterpol->CheckEntry(IDM_kInterpol0);
-    fInterpol->Associate(this);
-    fList.Add(fInterpol);
-
-    fIntRate = 1;
-
-    fWrite = new TGPopupMenu(p);
-    fWrite->AddEntry("&Start",      IDM_kStart);
-    fWrite->AddEntry("Sto&p",       IDM_kStop);
-    fWrite->AddSeparator();
-    fWrite->AddPopup("File &Type",  fFileType);
-    fWrite->AddPopup("&Write Type", fWriteType);
-    fWrite->AddPopup("Write &Rate", fWriteRate);
-    fWrite->DisableEntry(IDM_kStop);
-    fWrite->Associate(this);
-    fList.Add(fWrite);
-
-    fLimMag = new TGPopupMenu(p);
-    fLimMag->AddEntry("3", IDM_kLimMag3);
-    fLimMag->AddEntry("4", IDM_kLimMag4);
-    fLimMag->AddEntry("5", IDM_kLimMag5);
-    fLimMag->AddEntry("6", IDM_kLimMag6);
-    fLimMag->AddEntry("7", IDM_kLimMag7);
-    fLimMag->AddEntry("8", IDM_kLimMag8);
-    fLimMag->AddEntry("9", IDM_kLimMag9);
-    fLimMag->CheckEntry(IDM_kLimMag8);
-    fLimMag->Associate(this);
-    fList.Add(fLimMag);
-
-    fSao.SetLimitMag(8.0);
-
-    fSetup = new TGPopupMenu(p);
-    fSetup->AddPopup("Lim. &Magnitude", fLimMag);
-    fSetup->Associate(this);
-    fList.Add(fSetup);
-
-    fMenu = new TGMenuBar(this, 0, 0, kHorizontalFrame);
-    fMenu->AddPopup("&Display", fDisplay, NULL);
-    fMenu->AddPopup("&Write",   fWrite,   NULL);
-    fMenu->AddPopup("&Setup",   fSetup,   NULL);
-    fMenu->Resize(fMenu->GetDefaultSize());
-    AddFrame(fMenu); //, new TGLayoutHints (kLHintsNormal, 0, 4, 0, 0));
-    fList.Add(fMenu);
-
-    fCRaDec = new MGCoordinates(this, kETypeRaDec);
-    fCRaDec->Move(1, fMenu->GetDefaultHeight()+584);
-    AddFrame(fCRaDec);
-    fList.Add(fCRaDec);
-
-    fCZdAz = new MGCoordinates(this, kETypeZdAz);
-    fCZdAz->Move(240+12, fMenu->GetDefaultHeight()+584);
-    AddFrame(fCZdAz);
-    fList.Add(fCZdAz);
-
-    // TGHorizontal3DLine *fLineSep = new TGHorizontal3DLine(this);
-    // AddFrame(fLineSep, new TGLayoutHints (kLHintsNormal | kLHintsExpandX));
-    // fList.Add(fLineSep);
-
-    //
-    // Create Image Display
-    //
-    fImage = new MGImage(this, 768, 576);
-    fImage->Move(0, fMenu->GetDefaultHeight());
-    AddFrame(fImage);
-    fList.Add(fImage);
-
-    //
-    // Make everything visible
-    //
-    SetWindowName("Starguider Main Window");
-    SetIconName("Starguider");
-
-    MapSubwindows();
-    MapWindow();
-
-    fSao.SetPixSize(0.006);
-}
-
-Starguider::~Starguider()
-{
-    cout << "Camera Display destroyed." << endl;
-}
-
-void Starguider::Layout()
-{
-    // Resize(GetDefaultSize());
-}
-
-void Starguider::CloseWindow()
-{
-    cout << "EventDisplay::CloseWindow: Exit Application Loop." << endl;
-
-    ExitLoop();
-
-    gSystem->ExitLoop();
-}
-
-Bool_t Starguider::ProcessMessage(Long_t msg, Long_t mp1, Long_t mp2)
-{
-    switch (GET_MSG(msg))
-    {
-    case kC_COMMAND:
-        switch (GET_SUBMSG(msg))
-        {
-        case kCM_MENU:
-            switch (mp1)
-            {
-            case IDM_kCatalog:
-                if (fDisplay->IsEntryChecked(IDM_kCatalog))
-                    fDisplay->UnCheckEntry(IDM_kCatalog);
-                else
-                    fDisplay->CheckEntry(IDM_kCatalog);
-                return kTRUE;
-
-            case IDM_kFilter:
-                if (fDisplay->IsEntryChecked(IDM_kFilter))
-                    fDisplay->UnCheckEntry(IDM_kFilter);
-                else
-                    fDisplay->CheckEntry(IDM_kFilter);
-                return kTRUE;
-
-            case IDM_kStart:
-                fWrite->DisableEntry(IDM_kStart);
-                fWrite->EnableEntry(IDM_kStop);
-                return kTRUE;
-
-            case IDM_kStop:
-                fWrite->DisableEntry(IDM_kStop);
-                fWrite->EnableEntry(IDM_kStart);
-                return kTRUE;
-
-            case IDM_kPNG:
-                fFileType->CheckEntry(IDM_kPNG);
-                fFileType->UnCheckEntry(IDM_kPPM);
-                return kTRUE;
-
-            case IDM_kPPM:
-                fFileType->CheckEntry(IDM_kPPM);
-                fFileType->UnCheckEntry(IDM_kPNG);
-                return kTRUE;
-
-            case IDM_kOnce:
-                fWriteType->CheckEntry(IDM_kOnce);
-                fWriteType->UnCheckEntry(IDM_kContinous);
-                return kTRUE;
-
-            case IDM_kContinous:
-                fWriteType->CheckEntry(IDM_kContinous);
-                fWriteType->UnCheckEntry(IDM_kOnce);
-                return kTRUE;
-
-            case IDM_kRate25ps:
-            case IDM_kRate5ps:
-            case IDM_kRate1s:
-            case IDM_kRate5s:
-            case IDM_kRate30s:
-            case IDM_kRate1m:
-            case IDM_kRate5m:
-                for (int i=IDM_kRate25ps; i<=IDM_kRate5m; i++)
-                    if (mp1==i)
-                        fWriteRate->CheckEntry(i);
-                    else
-                        fWriteRate->UnCheckEntry(i);
-                switch (mp1)
-                {
-                case IDM_kRate25ps:
-                    fWrtRate = 1;
-                    return kTRUE;
-                case IDM_kRate5ps:
-                    fWrtRate = 5;
-                    return kTRUE;
-                case IDM_kRate1s:
-                    fWrtRate = 25;
-                    return kTRUE;
-                case IDM_kRate5s:
-                    fWrtRate = 5*25;
-                    return kTRUE;
-                case IDM_kRate30s:
-                    fWrtRate = 30*25;
-                    return kTRUE;
-                case IDM_kRate1m:
-                    fWrtRate = 60*25;
-                    return kTRUE;
-                case IDM_kRate5m:
-                    fWrtRate = 5*60*25;
-                    return kTRUE;
-                }
-                return kTRUE;
-
-            case IDM_kInterpol125:
-            case IDM_kInterpol25:
-            case IDM_kInterpol10:
-            case IDM_kInterpol5:
-            case IDM_kInterpol2:
-            case IDM_kInterpol1:
-                for (int i=IDM_kInterpol125; i<=IDM_kInterpol1; i++)
-                    if (mp1==i)
-                        fWriteRate->CheckEntry(i);
-                    else
-                        fWriteRate->UnCheckEntry(i);
-                switch (mp1)
-                {
-                case IDM_kInterpol1:
-                    fWrtRate = 1;
-                    return kTRUE;
-                case IDM_kInterpol2:
-                    fWrtRate = 2;
-                    return kTRUE;
-                case IDM_kInterpol5:
-                    fWrtRate = 5;
-                    return kTRUE;
-                case IDM_kInterpol10:
-                    fWrtRate = 10;
-                    return kTRUE;
-                case IDM_kInterpol25:
-                    fWrtRate = 25;
-                    return kTRUE;
-                case IDM_kInterpol125:
-                    fWrtRate = 125;
-                    return kTRUE;
-                }
-                return kTRUE;
-
-            case IDM_kLimMag3:
-            case IDM_kLimMag4:
-            case IDM_kLimMag5:
-            case IDM_kLimMag6:
-            case IDM_kLimMag7:
-            case IDM_kLimMag8:
-            case IDM_kLimMag9:
-                for (int i=IDM_kLimMag3; i<=IDM_kLimMag9; i++)
-                    if (mp1==i)
-                        fLimMag->CheckEntry(i);
-                    else
-                        fLimMag->UnCheckEntry(i);
-
-                fSao.SetLimitMag(mp1-IDM_kLimMag3+3);
-                return kTRUE;
-            }
-            break;
-        }
-        break;
-    }
-    return kTRUE;
-}
-
-void Starguider::ProcessFrame(const unsigned long n, byte *img, struct timeval *tm)
-{
-
-    if (!fWrite->IsEntryEnabled(IDM_kStart) &&
-        (!(n%fWrtRate) || fWriteType->IsEntryChecked(IDM_kOnce)))
-    {
-        if (fFileType->IsEntryChecked(IDM_kPNG))
-        {
-            static int num = 0;
-
-            char name[80];
-            sprintf(name, "pix/file%04d.png", num);
-            Writer::Png(name, img, tm);
-        }
-
-        if (fFileType->IsEntryChecked(IDM_kPPM))
-        {
-            static int num = 0;
-            char name[80];
-            sprintf(name, "pix/file%04d.ppm", num);
-            Writer::Ppm(name, img);
-        }
-
-        if (fWriteType->IsEntryChecked(IDM_kOnce))
-            ProcessMessage(MK_MSG(kC_COMMAND, kCM_MENU), IDM_kStop, 0);
-    }
-
-    if (!(n%fIntRate))
-    {
-        cout << "Img: " << n << endl;
-
-        if (fDisplay->IsEntryChecked(IDM_kFilter))
-            Filter::Execute(img);
-
-        if (fDisplay->IsEntryChecked(IDM_kCatalog))
-        {
-            byte cimg[768*576];
-
-            XY xy = fCRaDec->GetCoordinates();
-
-            fRaDec.Set(xy.X()*360/24, xy.Y());
-
-            Timer time(tm);
-            fSao.GetImg(img, cimg, time.CalcMjd(), fRaDec);
-            fImage->DrawColImg(img, cimg);
-
-            fCZdAz->SetCoordinates(fSao.GetZdAz());
-        }
-        else
-            fImage->DrawImg(img);
-    }
-
-}
Index: unk/MagicSoft/Cosy/Starguider.h
===================================================================
--- /trunk/MagicSoft/Cosy/Starguider.h	(revision 1817)
+++ 	(revision )
@@ -1,67 +1,0 @@
-#ifndef STARGUIDER_H
-#define STARGUIDER_H
-
-#ifndef ROOT_TGFrame
-#include <TGFrame.h>
-#endif
-#ifndef CAMERA_H
-#include "Camera.h"
-#endif
-
-#include "MGList.h"
-#include "MGImage.h"
-#include "StarCatalog.h"
-
-class TGMenuBar;
-class TGPopupMenu;
-
-class MGImage;
-class MGCoordinates;
-
-class Starguider : public Camera, public TGMainFrame
-{
-private:
-    MGList         fList;
-
-    TGMenuBar     *fMenu;
-    MGImage       *fImage;
-
-    TGPopupMenu   *fDisplay;
-    TGPopupMenu   *fWrite;
-    TGPopupMenu   *fFileType;
-    TGPopupMenu   *fWriteType;
-    TGPopupMenu   *fWriteRate;
-    TGPopupMenu   *fInterpol;
-    TGPopupMenu   *fSetup;
-    TGPopupMenu   *fLimMag;
-
-    MGCoordinates *fCRaDec;
-    MGCoordinates *fCZdAz;
-
-    StarCatalog    fSao;
-
-    RaDec fRaDec;
-
-    int fWrtRate;
-    int fIntRate;
-
-    void SetPixSize(const double pixsize);
-
-public:
-    Starguider();
-    virtual ~Starguider();
-
-    void Update();
-
-    void Layout();
-    void CloseWindow();
-
-    Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
-
-    //
-    // Execution of one frame - this function may be overloaded!
-    //
-    void ProcessFrame(const unsigned long n, byte *img, struct timeval *tm);
-};
-
-#endif
