Index: trunk/MagicSoft/Cosy/Changelog
===================================================================
--- trunk/MagicSoft/Cosy/Changelog	(revision 909)
+++ trunk/MagicSoft/Cosy/Changelog	(revision 910)
@@ -1,4 +1,71 @@
                                                                   -*-*- END -*-*-
+ 2001/08/15 - Thomas Bretz:
 
+   * .cosyrc:
+     - changed names
+     - added HomeTime
+   
+   * MCosy.[h,cc]:
+     - added home time
+     - added MTGui, MTTalk
+     - added reading environment
+   
+   * Makefile, Makefile.conf.linux-gnu, Makefile.rules
+     - changed to Mars style
+   
+   * Starguider.cc:
+     - changed include timer.g to base/timer.h
+   
+   * Starguider.[h,cc]:
+     - renamed Execute to ProcessFrame
+ 
+   * cosy.cc:
+     - removed unnecessary includes
+   
+   * base/MGList.h:
+     - added debug output
+   
+   * base/msgqueue.cc:
+     - added comments
+   
+   * base/msgqueue.h:
+     - made Break const
+   
+   * candrv/canopen.[h,cc]:
+     - made CobId const
+   
+   * candrv/network.[h,cc]:
+     - fixed typo
+     - StopReceiver -> VmodIcan::Stop
+     - made HasError const
+   
+   * candrv/nodedrv.[h,cc]:
+     - added timeout to WaitForSdo
+   
+   * candrv/sdolist.[h,cc]:
+     - made IsPending const
+     
+   * candrv/vmodican.[h,cc]:
+     - changed ReceiveThread to new stylish MThread
+   
+   * devdrv/macs.[h,cc]:
+     - changed SetHome to use a maximum positioning time
+     - added comments
+     - replaces SetSyncMode by StartPosSync and StartVelSync
+
+   * devdrv/shaftencoder.[h,cc]:
+     - removed gui thread (the update is done by MTGui now)
+   
+   * gui/MGCosy.[h,cc]:
+     - some small changed
+     - removed fList->Delete()
+     - added MSkyPosition-Object
+     - gSystem->ExitLoop() replaced by gSystem->Terminate(0)
+   
+   * videodev/Camera.[h,cc]:
+     - renamed Execute to ProcessFrame
+
+
+   
  2001/05/25 - Thomas Bretz:
  
Index: trunk/MagicSoft/Cosy/Makefile.conf.general
===================================================================
--- trunk/MagicSoft/Cosy/Makefile.conf.general	(revision 910)
+++ trunk/MagicSoft/Cosy/Makefile.conf.general	(revision 910)
@@ -0,0 +1,20 @@
+#
+#  ----->>>   root libraries
+#
+
+ROOTVER    =  `root-config --version`
+ROOTLIBS   =  `root-config --libs`
+ROOTGLIBS  =  `root-config --glibs`
+ROOTCFLAGS =  `root-config --cflags`
+
+#
+#  compiler flags
+#
+
+CANDEFS	  = -DCPU=486 -DBUS_LITTLE_ENDIAN -DDEBUG=0 -DLINUX -DSHOW 
+DEFINES	  = -D__COSY__ -DROOTVER=\"$(ROOTVER)\" $(CANDEFS)
+
+CXXFLAGS  = $(ROOTCFLAGS) $(INCLUDES) $(OPTIM) $(DEBUG) $(DEFINES)
+CFLAGS    = $(CXXFLAGS)
+FFLAGS    = $(CXXFLAGS)
+
Index: trunk/MagicSoft/Cosy/base/MThread.cc
===================================================================
--- trunk/MagicSoft/Cosy/base/MThread.cc	(revision 910)
+++ trunk/MagicSoft/Cosy/base/MThread.cc	(revision 910)
@@ -0,0 +1,135 @@
+#include <MThread.h>
+
+#include <pthread.h>
+#include <sys/resource.h>  // PRIO_PROCESS
+
+// ----------------------------------------------------------------------
+//
+// Constructor
+//
+// Starts the derived thread if you don't specify false.
+//
+MThread::MThread(bool start) : fIsRunning(false), fIsDetached(false), fThread(NULL), fReturn(NULL), fPriority(0)
+{
+    if (start)
+        Start();
+}
+
+// ----------------------------------------------------------------------
+//
+// Destructor
+//
+// Stops the derived thread if it is still running.
+//
+MThread::~MThread()
+{
+    if (fIsRunning)
+        Stop();
+}
+
+// ----------------------------------------------------------------------
+//
+// Detach the derived thread. This means, that if the thread ends the
+// needed resources (eg. for storing the return code) are freed.
+// In other word you cannot get any value back from the Thread.
+//
+void MThread::Detach()
+{
+    if (fIsRunning)
+        pthread_detach(*fThread);
+
+    fIsDetached = true;
+}
+
+// ----------------------------------------------------------------------
+//
+// Sets the priority of the thread.
+//  -20 highest priority
+//    0 standard
+//  +20 lowest priority
+// This can only be done before the thread is started.
+//
+bool MThread::SetPriority(int prio)
+{
+    if (fIsRunning)
+        return false;
+
+    fPriority = prio;
+    return true;
+}
+
+// ----------------------------------------------------------------------
+//
+// Now we are back in a class instance, but running in new thread.
+// All class members can be accessed like before.
+// Set the flag for a running thread. Check if the thread should get
+// detached. Set the priority of the thread. Now reset the stop flag and
+// execute the thread. After the thread stopped it's execution reset the
+// running flag and exit.
+//
+void *MThread::RunThread()
+{
+    fIsRunning = true;
+
+    if (fIsDetached)
+        pthread_detach(pthread_self());
+
+    setpriority(PRIO_PROCESS, 0, fPriority); //lowest priority
+
+    fStop = false;
+
+    void *rc = Thread();
+
+    fIsRunning = false;
+
+    return rc;
+}
+
+// ----------------------------------------------------------------------
+//
+// Get the Instance back from the thread argument and call the
+// RunThread member function, which handles all MThread bspecific stuff.
+//
+void *MThread::MapThread(void *arg)
+{
+    MThread *thread = (MThread*)arg;
+
+    return thread->RunThread();
+}
+
+// ----------------------------------------------------------------------
+//
+// A thread is created and started (MapThread).
+// As an argument the actual instance is used.
+//
+void MThread::Start()
+{
+    fThread = new pthread_t;
+    pthread_create(fThread, NULL, MapThread, this);
+}
+
+// ----------------------------------------------------------------------
+//
+// Check if a thread is existing and running.
+// If the thread is detached, cancel the thread. Otherwise set the stop
+// flag and wait for the thread to exit.
+//
+void MThread::Stop()
+{
+    if (!fThread || !fIsRunning)
+        return;
+
+    if (fIsDetached)
+    {
+        pthread_cancel(*fThread);
+        fIsRunning = false;
+    }
+    else
+    {
+        fStop = true;
+        pthread_join(*fThread, &fReturn);
+    }
+
+    delete fThread;
+    fThread = NULL;
+}
Index: trunk/MagicSoft/Cosy/base/MThread.h
===================================================================
--- trunk/MagicSoft/Cosy/base/MThread.h	(revision 910)
+++ trunk/MagicSoft/Cosy/base/MThread.h	(revision 910)
@@ -0,0 +1,37 @@
+#ifndef MTHREAD_H
+#define MTHREAD_H
+
+#include <pthread.h>
+
+class MThread 
+{
+private:
+    bool fIsRunning;
+    bool fIsDetached;
+    bool fStop;
+
+    pthread_t *fThread;
+
+    void *fReturn;
+
+    int fPriority;
+
+    static void *MapThread(void *arg);
+    void *RunThread();
+    virtual void *Thread() = 0;
+
+public:
+    MThread(bool start=true);
+    virtual ~MThread();
+
+    bool SetPriority(int prio);
+
+    void Detach();
+
+    void Start();
+    void Stop();
+
+    bool HasStopFlag() const { return fStop; }
+};
+
+#endif
Index: trunk/MagicSoft/Cosy/base/MTimeout.h
===================================================================
--- trunk/MagicSoft/Cosy/base/MTimeout.h	(revision 910)
+++ trunk/MagicSoft/Cosy/base/MTimeout.h	(revision 910)
@@ -0,0 +1,29 @@
+#ifndef MTIMEOUT_H
+#define MTIMEOUT_H
+
+#include <TTimer.h>
+
+class MTimeout : public TTimer
+{
+    Bool_t Notify()
+    {
+        TurnOff(); // remove from system list
+        return kFALSE;
+    }
+
+public:
+    MTimeout(Long_t ms=500) : TTimer(ms, kFALSE)
+    {
+        // Use SetTime to change the timing
+        if (ms) TurnOn(); // Add to system list
+    }
+
+    void Start()
+    {
+        Reset();  // reset before adding
+        TurnOn(); // Add to system list
+    }
+};
+
+
+#endif
Index: trunk/MagicSoft/Cosy/base/Makefile
===================================================================
--- trunk/MagicSoft/Cosy/base/Makefile	(revision 910)
+++ trunk/MagicSoft/Cosy/base/Makefile	(revision 910)
@@ -0,0 +1,55 @@
+##################################################################
+#
+#   makefile
+# 
+#   for the MARS software
+#
+##################################################################
+# @maintitle
+
+# @code
+
+#
+#  please change all system depend values in the 
+#  config.mk.${OSTYPE} file 
+#
+#
+include ../Makefile.conf.$(OSTYPE)
+include ../Makefile.conf.general
+
+# @endcode 
+
+INCLUDES = -I. -I..
+
+# @code 
+
+CINT     = Base
+LIB      = base.a
+
+#------------------------------------------------------------------------------
+
+.SUFFIXES: .c .cc .cxx .h .hxx .o 
+
+SRCFILES = File.cc \
+	   MStopwatch.cc \
+           MThread.cc \
+	   MTimeout.cc \
+           msgqueue.cc \
+           timer.cc 
+
+SRCS    = $(SRCFILES)
+HEADERS = $(SRCFILES:.cc=.h)
+OBJS    = $(SRCFILES:.cc=.o) 
+
+############################################################
+
+all: $(LIB)
+
+include ../Makefile.rules
+
+clean:	rmlib rmcint rmobjs rmcore
+
+mrproper:	clean rmbak
+
+# @endcode
+
Index: trunk/MagicSoft/Cosy/candrv/Makefile
===================================================================
--- trunk/MagicSoft/Cosy/candrv/Makefile	(revision 910)
+++ trunk/MagicSoft/Cosy/candrv/Makefile	(revision 910)
@@ -0,0 +1,54 @@
+##################################################################
+#
+#   makefile
+# 
+#   for the MARS software
+#
+##################################################################
+# @maintitle
+
+# @code
+
+#
+#  please change all system depend values in the 
+#  config.mk.${OSTYPE} file 
+#
+#
+include ../Makefile.conf.$(OSTYPE)
+include ../Makefile.conf.general
+
+# @endcode 
+
+INCLUDES = -I. -I.. -I../incl -I../base
+
+# @code 
+
+CINT     = Candrv
+LIB      = candrv.a
+
+#------------------------------------------------------------------------------
+
+.SUFFIXES: .c .cc .cxx .h .hxx .o 
+
+SRCFILES = canopen.cc \
+	   network.cc \
+           nodedrv.cc \
+	   sdolist.cc \
+           vmodican.cc 
+
+SRCS    = $(SRCFILES)
+HEADERS = $(SRCFILES:.cc=.h)
+OBJS    = $(SRCFILES:.cc=.o) 
+
+############################################################
+
+all: $(LIB)
+
+include ../Makefile.rules
+
+clean:	rmlib rmcint rmobjs rmcore
+
+mrproper:	clean rmbak
+
+# @endcode
+
Index: trunk/MagicSoft/Cosy/candrv/vmodican.cc
===================================================================
--- trunk/MagicSoft/Cosy/candrv/vmodican.cc	(revision 909)
+++ trunk/MagicSoft/Cosy/candrv/vmodican.cc	(revision 910)
@@ -793,35 +793,2 @@
     SendCanFrame(cobid, msg);
 }
-/*
-void VmodIcan::StopReceiver()
-{
-    if (!fRxThrd)
-        return;
-
-    pthread_cancel(*fRxThrd);
-
-    delete fRxThrd;
-    fRxThrd = NULL;
-    lout << "- Receiver Thread stopped." << endl;
-}
-*/
-
-/*
-void VmodIcan::StartReceiver()
-{
-    **************************************
-    * create thread waiting for messages *
-    **************************************
-    if (fRxThrd)
-    {
-        cout << "Error: rx thread already started." << endl;
-        return;
-    }
-
-    lout << "- Starting receiving Thread." << endl;
-
-    fRxThrd = new pthread_t;
-    pthread_create(fRxThrd, NULL, ReceiveThread, this);
-}
-*/
-
Index: trunk/MagicSoft/Cosy/candrv/vmodican.h
===================================================================
--- trunk/MagicSoft/Cosy/candrv/vmodican.h	(revision 909)
+++ trunk/MagicSoft/Cosy/candrv/vmodican.h	(revision 910)
@@ -10,20 +10,5 @@
 
 #include "MThread.h"
-/*
-class VmodIcanRX : public MThread
-{
-private:
-    VmodIcan *fModule;
 
-    void *Thread();
-
-public:
-    MTGui(VmodIcan *mod) : MThread(false), fModule(mod)
-    {
-        SetPriority(-10);
-        Detach();
-    }
-};
-*/
 class VmodIcan : public Log, protected MThread
 {
@@ -32,5 +17,4 @@
 private:
     int fd; // file descriptor for can module
-    //    pthread_t *fRxThrd;
 
     int Ioctl(int msg, void *arg);
@@ -71,8 +55,4 @@
     virtual void TerminateApp() { exit(-1); }
 
-//protected:
-//    void StartReceiver();
-//    void StopReceiver();
-
 public:
     VmodIcan(const char *dev, const int baud, ostream &out=cout);
Index: trunk/MagicSoft/Cosy/catalog/Makefile
===================================================================
--- trunk/MagicSoft/Cosy/catalog/Makefile	(revision 910)
+++ trunk/MagicSoft/Cosy/catalog/Makefile	(revision 910)
@@ -0,0 +1,52 @@
+##################################################################
+#
+#   makefile
+# 
+#   for the MARS software
+#
+##################################################################
+# @maintitle
+
+# @code
+
+#
+#  please change all system depend values in the 
+#  config.mk.${OSTYPE} file 
+#
+#
+include ../Makefile.conf.$(OSTYPE)
+include ../Makefile.conf.general
+
+# @endcode 
+
+INCLUDES = -I. -I..
+
+# @code 
+
+CINT     = Catalog
+LIB      = catalog.a
+
+#------------------------------------------------------------------------------
+
+.SUFFIXES: .c .cc .cxx .h .hxx .o 
+
+SRCFILES = SaoFile.cc \
+	   Slalib.cc \
+	   StarCatalog.cc
+
+SRCS    = $(SRCFILES)
+HEADERS = $(SRCFILES:.cc=.h)
+OBJS    = $(SRCFILES:.cc=.o) 
+
+############################################################
+
+all: $(LIB)
+
+include ../Makefile.rules
+
+clean:	rmlib rmcint rmobjs rmcore
+
+mrproper:	clean rmbak
+
+# @endcode
+
Index: trunk/MagicSoft/Cosy/devdrv/macs.cc
===================================================================
--- trunk/MagicSoft/Cosy/devdrv/macs.cc	(revision 909)
+++ trunk/MagicSoft/Cosy/devdrv/macs.cc	(revision 910)
@@ -188,5 +188,5 @@
 }
 
-void Macs::SetHome(LWORDS_t pos)
+void Macs::SetHome(LWORDS_t pos, WORD_t maxtime)
 {
     lout << "- Driving #" << (int)GetId() << " to home position, Offset=" << dec << pos << endl;
@@ -195,6 +195,7 @@
 
     // home also defines the zero point of the system
+    // maximum time allowd for home drive: 25.000ms
     SendSDO(0x3001, string('h','o','m','e'));       // home
-    WaitForSdo(0x3001);
+    WaitForSdo(0x3001, 0, maxtime*1000);
     lout << "- Home position of #" << (int)GetId() << " reached. " << endl;
 
@@ -253,9 +254,24 @@
 }
 
-void Macs::SetSyncMode()
-{
-    lout << "- Setting Sync Mode #" << (int)GetId() << endl;
-    SendSDO(0x3007, string('S', 'Y', 'N', 'C'));
-    WaitForSdo(0x3007);
+void Macs::StartVelSync()
+{
+    //
+    // The syncronization mode is disabled by a 'MOTOR STOP'
+    // or by a positioning command (POSA, ...)
+    //
+    lout << "- Setting Vel Sync Mode #" << (int)GetId() << endl;
+    SendSDO(0x3007, 0, string('S', 'Y', 'N', 'C'));
+    WaitForSdo(0x3007, 0);
+}
+
+void Macs::StartPosSync()
+{
+    //
+    // The syncronization mode is disabled by a 'MOTOR STOP'
+    // or by a positioning command (POSA, ...)
+    //
+    lout << "- Setting Pos Sync Mode #" << (int)GetId() << endl;
+    SendSDO(0x3007, 1, string('S', 'Y', 'N', 'C'));
+    WaitForSdo(0x3007, 1);
 }
 /*
Index: trunk/MagicSoft/Cosy/devdrv/macs.h
===================================================================
--- trunk/MagicSoft/Cosy/devdrv/macs.h	(revision 909)
+++ trunk/MagicSoft/Cosy/devdrv/macs.h	(revision 910)
@@ -2,6 +2,6 @@
 #define MACS_H
 
-#include "timer.h"
 #include "nodedrv.h"
+#include "base/timer.h"
 
 class Macs : public NodeDrv
@@ -51,10 +51,9 @@
     void ReqAxEnd();
     void ReqVelRes();
-    void SetHome(LWORDS_t pos=0);
+    void SetHome(LWORDS_t pos=0, WORD_t maxtime=25);
     void SetAcceleration(LWORD_t acc);
     void SetDeceleration(LWORD_t dec);
     void SetVelocity(LWORD_t vel);
     void SetNoWait(BYTE_t flag=TRUE);
-    void SetSyncMode();
     void SetRpmMode(BYTE_t mode=TRUE);
     void SetRpmVelocity(LWORDS_t cvel);
@@ -64,4 +63,7 @@
 
     void EnableEndswitches(bool neg=true, bool pos=true);
+
+    void StartVelSync();
+    void StartPosSync();
 
     void StartRelPos(LWORDS_t pos);
Index: trunk/MagicSoft/Cosy/devdrv/shaftencoder.cc
===================================================================
--- trunk/MagicSoft/Cosy/devdrv/shaftencoder.cc	(revision 909)
+++ trunk/MagicSoft/Cosy/devdrv/shaftencoder.cc	(revision 910)
@@ -18,5 +18,5 @@
     // Show information
     //
-    pthread_create(&fThread, NULL, MapUpdateThread, this);
+    //    pthread_create(&fThread, NULL, MapUpdateThread, this);
 
 }
@@ -24,5 +24,5 @@
 ShaftEncoder::~ShaftEncoder()
 {
-    pthread_cancel(fThread);
+    //    pthread_cancel(fThread);
 }
 
@@ -91,5 +91,5 @@
     cout << endl;
 }
-
+/*
 void *ShaftEncoder::MapUpdateThread(void *data)
 {
@@ -106,11 +106,38 @@
     return NULL;
 }
-
+*/
+void ShaftEncoder::DisplayVal()
+{
+    static LWORDS_t pos;   // ticks
+    static WORDS_t  vel;   // ticks per 5ms
+    static WORDS_t  acc;   // ticks per 25ms^2
+
+    char text[21];
+
+    if (fPos!=pos)
+    {
+        sprintf(text, "%ld", fPos);
+        fLabel[0]->SetText(new TGString(text));
+    }
+
+    if (fVel!=vel)
+    {
+        sprintf(text, "%d", fVel);
+        fLabel[1]->SetText(new TGString(text));
+    }
+
+    if (fAcc!=acc)
+    {
+        sprintf(text, "%d", fAcc);
+        fLabel[2]->SetText(new TGString(text));
+    }
+}
+/*
 void ShaftEncoder::UpdateThread()
 {
+    return;
     //
     // check for a running thread and lock mutex
     //
-    char text[21];
 
     //
@@ -122,25 +149,19 @@
     while (1)
     {
-        WaitForNextPdo1();
+        usleep(40000);
+        //WaitForNextPdo1();
 
         //
         // Update information
         //
-        sprintf(text, "%ld", fPos);
-        fLabel[0]->SetText(new TGString(text));
-
-        sprintf(text, "%d", fVel);
-        fLabel[1]->SetText(new TGString(text));
-
-        sprintf(text, "%d", fAcc);
-        fLabel[2]->SetText(new TGString(text));
+
 
         //
         // make updated information visible
         //
-        gSystem->ProcessEvents();
-    }
-}
-
+        //gSystem->ProcessEvents(); ----> MCosy::GuiThread
+    }
+}
+*/
 void ShaftEncoder::HandlePDOType0(BYTE_t *data)
 {
Index: trunk/MagicSoft/Cosy/devdrv/shaftencoder.h
===================================================================
--- trunk/MagicSoft/Cosy/devdrv/shaftencoder.h	(revision 909)
+++ trunk/MagicSoft/Cosy/devdrv/shaftencoder.h	(revision 910)
@@ -23,8 +23,7 @@
     Timer fTime;
 
-    pthread_t fThread;
-
-    static void *MapUpdateThread(void *se);
-    void UpdateThread();
+    //    pthread_t fThread;
+    //    static void *MapUpdateThread(void *se);
+    //    void UpdateThread();
 
     void HandlePDOType0(BYTE_t *data);
@@ -58,4 +57,6 @@
 
     void SetPreset(LWORD_t pre=0);
+
+    void DisplayVal();
 };
 
Index: trunk/MagicSoft/Cosy/gui/MGCosy.cc
===================================================================
--- trunk/MagicSoft/Cosy/gui/MGCosy.cc	(revision 909)
+++ trunk/MagicSoft/Cosy/gui/MGCosy.cc	(revision 910)
@@ -10,4 +10,5 @@
 #include <TGLabel.h>       // TGLabel
 #include <TGSplitter.h>    // TGHorizontal3DLine
+#include <TApplication.h>  // gApplication
 
 #include "timer.h"         // Timer
@@ -16,4 +17,5 @@
 #include "MGList.h"
 #include "MGCoordinates.h"
+#include "MGSkyPosition.h"
 
 #include "Slalib.h"
@@ -149,12 +151,17 @@
 
     fCoord = new MGCoordinates(this, kTRUE,
-                                "Coordinate 1 [\xb0]:", "Coordinate 2 [\xb0]:");
+                               "Coordinate 1 [\xb0]:", "Coordinate 2 [\xb0]:");
     fCoord->Move(10, 160);
     fList->Add(fCoord);
 
+    fSkyPosition = new MGSkyPosition(this);
+    fSkyPosition->Move(320, 40);
+    fSkyPosition->Resize(200, 200);
+    fList->Add(fSkyPosition);
+
     //
     //   Map the window, set up the layout, etc.
     //
-    SetWMSizeHints(350, 250, 350, 250, 10, 10 ) ;  // set the smallest and biggest size of the Main frame
+    SetWMSizeHints(550, 250, 550, 250, 10, 10);  // set the smallest and biggest size of the Main frame
 
     MapSubwindows();
@@ -173,9 +180,14 @@
 MGCosy::~MGCosy()
 {
+    cout << "Deleting MGCosy." << endl;
+
     delete fLayMenuBar;
     delete fLayMenuItem;
 
-    fList->Delete();
+    cout << "Deleting MGCosy::fList" << endl;
+
     delete fList;
+
+    cout << "MGCosy deleted." << endl;
 }
 // ======================================================================
@@ -188,9 +200,9 @@
     // window menu item is selected.
 
-    gSystem->ExitLoop();
+    //gSystem->ExitLoop();
     //  gSystem->DispatchOneEvent(kTRUE);
 
     //    TGMainFrame::CloseWindow();
-    //  gROOT->GetApplication()->Terminate(0);
+    gApplication->Terminate(0);
 }
 
@@ -270,4 +282,5 @@
             {
             case IDM_EXIT:
+                cout << "Idm_Exit." << endl;
                 CloseWindow();
                 return kTRUE;
Index: trunk/MagicSoft/Cosy/gui/MGCosy.h
===================================================================
--- trunk/MagicSoft/Cosy/gui/MGCosy.h	(revision 909)
+++ trunk/MagicSoft/Cosy/gui/MGCosy.h	(revision 910)
@@ -26,4 +26,5 @@
 class MGList;
 class MGCoordinates;
+class MGSkyPosition;
 
 class MGCosy : public TGMainFrame
@@ -44,4 +45,5 @@
 
     MGCoordinates *fCoord;
+    MGSkyPosition *fSkyPosition;
 
     MsgQueue      *fQueue;
@@ -61,4 +63,6 @@
     TGLabel **GetLabel3() { return fLabel3; }
 
+    MGSkyPosition *GetSkyDisplay() { return fSkyPosition; }
+
     Bool_t ProcessMessage(Long_t msg, Long_t mp1, Long_t mp2);
 };
Index: trunk/MagicSoft/Cosy/gui/Makefile
===================================================================
--- trunk/MagicSoft/Cosy/gui/Makefile	(revision 910)
+++ trunk/MagicSoft/Cosy/gui/Makefile	(revision 910)
@@ -0,0 +1,54 @@
+##################################################################
+#
+#   makefile
+# 
+#   for the MARS software
+#
+##################################################################
+# @maintitle
+
+# @code
+
+#
+#  please change all system depend values in the 
+#  config.mk.${OSTYPE} file 
+#
+#
+include ../Makefile.conf.$(OSTYPE)
+include ../Makefile.conf.general
+
+# @endcode 
+
+INCLUDES = -I. -I.. -I../base -I../slalib -I../candrv -I../incl -I../catalog
+
+# @code 
+
+CINT     = Gui
+LIB      = gui.a
+
+#------------------------------------------------------------------------------
+
+.SUFFIXES: .c .cc .cxx .h .hxx .o 
+
+SRCFILES = MGCoordinate.cc \
+	   MGCoordinates.cc \
+	   MGCosy.cc \
+	   MGImage.cc \
+	   MGSkyPosition.cc
+
+SRCS    = $(SRCFILES)
+HEADERS = $(SRCFILES:.cc=.h)
+OBJS    = $(SRCFILES:.cc=.o) 
+
+############################################################
+
+all: $(LIB)
+
+include ../Makefile.rules
+
+clean:	rmlib rmcint rmobjs rmcore
+
+mrproper:	clean rmbak
+
+# @endcode
+
Index: trunk/MagicSoft/Cosy/videodev/Camera.cc
===================================================================
--- trunk/MagicSoft/Cosy/videodev/Camera.cc	(revision 909)
+++ trunk/MagicSoft/Cosy/videodev/Camera.cc	(revision 910)
@@ -187,7 +187,6 @@
 
 
-void Camera::Execute(const unsigned long n,
-                     byte *img,
-                     struct timeval *tm)
+void Camera::ProcessFrame(const unsigned long n, byte *img,
+                          struct timeval *tm)
 {
     cout << "Img: " << n << "  " << (void*)img << endl;
@@ -247,5 +246,5 @@
             if (!StartGrab(i&1))
                 break;
-            Execute(i, (byte*)fImg, &fTime);
+            ProcessFrame(i, (byte*)fImg, &fTime);
             i++;
         }
@@ -254,10 +253,10 @@
         {
             LoopStep(i);
-            Execute(i, (byte*)fImg, &fTime);
+            ProcessFrame(i, (byte*)fImg, &fTime);
             i++;
         }
 
         LoopStep(i);
-        Execute(i, (byte*)fImg, &fTime);
+        ProcessFrame(i, (byte*)fImg, &fTime);
         i++;
 
Index: trunk/MagicSoft/Cosy/videodev/Camera.h
===================================================================
--- trunk/MagicSoft/Cosy/videodev/Camera.h	(revision 909)
+++ trunk/MagicSoft/Cosy/videodev/Camera.h	(revision 910)
@@ -86,6 +86,6 @@
     // Execution of one frame - this function may be overloaded!
     //
-    virtual void Execute(const unsigned long n,
-                         byte *img, struct timeval *tm);
+    virtual void ProcessFrame(const unsigned long n,
+                              byte *img, struct timeval *tm);
 
     //
Index: trunk/MagicSoft/Cosy/videodev/Writer.cc
===================================================================
--- trunk/MagicSoft/Cosy/videodev/Writer.cc	(revision 909)
+++ trunk/MagicSoft/Cosy/videodev/Writer.cc	(revision 910)
@@ -7,5 +7,5 @@
 #include <png.h>
 
-#include "timer.h"
+#include "base/timer.h"
 
 void Writer::Png(const char *fname, const byte *buf,
@@ -80,6 +80,6 @@
         char text[36];
 
-        Timer time(date);
-        sprintf(text, "*** %s ***", time.GetTimeStr());
+        Timer timet(date);
+        sprintf(text, "*** %s ***", timet.GetTimeStr());
         png_write_chunk(fPng, (png_byte*)"UTC", (png_byte*)text, strlen(text));
         sprintf(text,"*** %s %s %.1f %i ***", tzname[0], tzname[1], 1.0/3600*timezone, daylight);
