Index: trunk/MagicSoft/Cosy/catalog/CatalogLinkDef.h
===================================================================
--- trunk/MagicSoft/Cosy/catalog/CatalogLinkDef.h	(revision 4103)
+++ trunk/MagicSoft/Cosy/catalog/CatalogLinkDef.h	(revision 4104)
@@ -9,5 +9,4 @@
 #pragma link C++ class SlaPlanets+;
 
-#pragma link C++ class SaoFile+;
 #pragma link C++ class StarCatalog+;
 
Index: trunk/MagicSoft/Cosy/catalog/Makefile
===================================================================
--- trunk/MagicSoft/Cosy/catalog/Makefile	(revision 4103)
+++ trunk/MagicSoft/Cosy/catalog/Makefile	(revision 4104)
@@ -31,6 +31,5 @@
 .SUFFIXES: .c .cc .cxx .h .hxx .o 
 
-SRCFILES = SaoFile.cc \
-	   Slalib.cc \
+SRCFILES = Slalib.cc \
 	   SlaStars.cc \
 	   SlaPlanets.cc \
Index: trunk/MagicSoft/Cosy/catalog/Slalib.cc
===================================================================
--- trunk/MagicSoft/Cosy/catalog/Slalib.cc	(revision 4103)
+++ trunk/MagicSoft/Cosy/catalog/Slalib.cc	(revision 4104)
@@ -61,142 +61,2 @@
     return ZdAz(kPiDiv2-alt, az);
 }
-/*
-Double_t Slalib::Hms2Sec(Int_t deg, UInt_t min, Double_t sec, Char_t sgn)
-{
-    const Double_t rc = TMath::Sign((60.0 * (60.0 * (Double_t)TMath::Abs(deg) + (Double_t)min) + sec), (Double_t)deg);
-    return sgn=='-' ? -rc : rc;
-}
-
-Double_t Slalib::Dms2Rad(Int_t deg, UInt_t min, Double_t sec, Char_t sgn)
-{
-    // pi/(180*3600):  arcseconds to radians
-#define DAS2R 4.8481368110953599358991410235794797595635330237270e-6
-    return Hms2Sec(deg, min, sec, sgn)*DAS2R;
-}
-
-Double_t Slalib::Hms2Rad(Int_t hor, UInt_t min, Double_t sec, Char_t sgn)
-{
-    // pi/(12*3600):  seconds of time to radians
-#define DS2R 7.2722052166430399038487115353692196393452995355905e-5
-    return Hms2Sec(hor, min, sec, sgn)*DS2R;
-}
-
-Double_t Slalib::Dms2Deg(Int_t deg, UInt_t min, Double_t sec, Char_t sgn)
-{
-    return Hms2Sec(deg, min, sec, sgn)/3600.;
-}
-
-Double_t Slalib::Hms2Deg(Int_t hor, UInt_t min, Double_t sec, Char_t sgn)
-{
-    return Hms2Sec(hor, min, sec, sgn)/240.;
-}
-
-Double_t Slalib::Dms2Hor(Int_t deg, UInt_t min, Double_t sec, Char_t sgn)
-{
-    return Hms2Sec(deg, min, sec, sgn)/15.;
-}
-
-Double_t Slalib::Hms2Hor(Int_t hor, UInt_t min, Double_t sec, Char_t sgn)
-{
-    return Hms2Sec(hor, min, sec, sgn)/3600.;
-}
-
-void Slalib::Day2Hms(Double_t day, Char_t &sgn, UShort_t &hor, UShort_t &min, UShort_t &sec)
-{
-    // Handle sign
-    sgn = day<0?'-':'+';
-
-    // Round interval and express in smallest units required
-    Double_t a = Round(86400. * TMath::Abs(day)); // Days to seconds
-
-    // Separate into fields
-    const Double_t ah = Trunc(a/3600.);
-    a -= ah * 3600.;
-    const Double_t am = Trunc(a/60.);
-    a -= am * 60.;
-    const Double_t as = Trunc(a);
-
-    // Return results
-    hor = (UShort_t)ah;
-    min = (UShort_t)am;
-    sec = (UShort_t)as;
-}
-
-void Slalib::Rad2Hms(Double_t rad, Char_t &sgn, UShort_t &deg, UShort_t &min, UShort_t &sec)
-{
-    Day2Hms(rad/(TMath::Pi()*2), sgn, deg, min, sec);
-}
-
-void Slalib::Rad2Dms(Double_t rad, Char_t &sgn, UShort_t &deg, UShort_t &min, UShort_t &sec)
-{
-    Rad2Hms(rad*15, sgn, deg, min, sec);
-}
-
-void Slalib::Deg2Dms(Double_t d, Char_t &sgn, UShort_t &deg, UShort_t &min, UShort_t &sec)
-{
-    Day2Hms(d/24, sgn, deg, min, sec);
-}
-
-void Slalib::Deg2Hms(Double_t d, Char_t &sgn, UShort_t &deg, UShort_t &min, UShort_t &sec)
-{
-    Rad2Hms(d/360, sgn, deg, min, sec);
-}
-
-void Slalib::Hor2Dms(Double_t h, Char_t &sgn, UShort_t &deg, UShort_t &min, UShort_t &sec)
-{
-    Day2Hms(h*15/24, sgn, deg, min, sec);
-}
-
-void Slalib::Hor2Hms(Double_t h, Char_t &sgn, UShort_t &deg, UShort_t &min, UShort_t &sec)
-{
-    Day2Hms(h/24, sgn, deg, min, sec);
-}
-
-void Slalib::Day2Hm(Double_t day, Char_t &sgn, UShort_t &hor, Double_t &min)
-{
-    // Handle sign
-    sgn = day<0?'-':'+';
-
-    // Round interval and express in smallest units required
-    Double_t a = Round(86400. * TMath::Abs(day)); // Days to seconds
-
-    // Separate into fields
-    const Double_t ah = Trunc(a/3600.);
-    a -= ah * 3600.;
-
-    // Return results
-    hor = (UShort_t)ah;
-    min = a/60.;
-}
-
-void Slalib::Rad2Hm(Double_t rad, Char_t &sgn, UShort_t &deg, Double_t &min)
-{
-    Day2Hm(rad/(TMath::Pi()*2), sgn, deg, min);
-}
-
-void Slalib::Rad2Dm(Double_t rad, Char_t &sgn, UShort_t &deg, Double_t &min)
-{
-    Rad2Hm(rad*15, sgn, deg, min);
-}
-
-void Slalib::Deg2Dm(Double_t d, Char_t &sgn, UShort_t &deg, Double_t &min)
-{
-    Day2Hm(d/24, sgn, deg, min);
-}
-
-void Slalib::Deg2Hm(Double_t d, Char_t &sgn, UShort_t &deg, Double_t &min)
-{
-    Rad2Hm(d/360, sgn, deg, min);
-}
-
-void Slalib::Hor2Dm(Double_t h, Char_t &sgn, UShort_t &deg, Double_t &min)
-{
-    Day2Hm(h*15/24, sgn, deg, min);
-}
-
-void Slalib::Hor2Hm(Double_t h, Char_t &sgn, UShort_t &deg, Double_t &min)
-{
-    Day2Hm(h/24, sgn, deg, min);
-}
-
-*/
Index: trunk/MagicSoft/Cosy/catalog/StarCatalog.cc
===================================================================
--- trunk/MagicSoft/Cosy/catalog/StarCatalog.cc	(revision 4103)
+++ trunk/MagicSoft/Cosy/catalog/StarCatalog.cc	(revision 4104)
@@ -196,4 +196,7 @@
         Float_t yy = loc.X()*fSinAngle + loc.Y()*fCosAngle;
 
+        if (xx<0 || xx >=768 || yy<0 || yy>=576)
+            continue;
+
         // Store pixel coordinates of star in list
         list.Add(xx+768/2, yy+576/2, -2.5*log10(mag));
Index: trunk/MagicSoft/Cosy/devdrv/macs.cc
===================================================================
--- trunk/MagicSoft/Cosy/devdrv/macs.cc	(revision 4103)
+++ trunk/MagicSoft/Cosy/devdrv/macs.cc	(revision 4104)
@@ -382,5 +382,5 @@
     //SetNoWait(TRUE);
 
-    StartGuarding(400, 1, kFALSE); // Using PDO1 @ 100ms
+    //StartGuarding(400, 1, kFALSE); // Using PDO1 @ 100ms
     //StartGuarding(250, 4);
     //StartHostGuarding();
Index: trunk/MagicSoft/Cosy/devdrv/macs.h
===================================================================
--- trunk/MagicSoft/Cosy/devdrv/macs.h	(revision 4103)
+++ trunk/MagicSoft/Cosy/devdrv/macs.h	(revision 4104)
@@ -1,7 +1,12 @@
-#ifndef MACS_H
-#define MACS_H
+#ifndef COSY_Macs
+#define COSY_Macs
 
+#ifndef COSY_NodeDrv
 #include "nodedrv.h"
+#endif
+
+#ifndef MARS_MTime
 #include "MTime.h"
+#endif
 
 class Macs : public NodeDrv
@@ -119,4 +124,6 @@
 
     Double_t GetPosTime() const { return fPosTime; }
+    Double_t GetMjd() const { return fPosTime.GetMjd(); }
+    Double_t GetPdoMjd() const { return fPdoTime.GetMjd(); }
 
     ClassDef(Macs, 0)
Index: trunk/MagicSoft/Cosy/devdrv/shaftencoder.cc
===================================================================
--- trunk/MagicSoft/Cosy/devdrv/shaftencoder.cc	(revision 4103)
+++ trunk/MagicSoft/Cosy/devdrv/shaftencoder.cc	(revision 4104)
@@ -8,4 +8,6 @@
 #include <TGLabel.h>       // TGLabel->SetText
 
+#include "macs.h"
+
 ClassImp(ShaftEncoder);
 
@@ -14,8 +16,20 @@
 ShaftEncoder::ShaftEncoder(const BYTE_t nodeid, const char *name, MLog &out)
     : NodeDrv(nodeid, name, out), fPos(0), fVel(0), fAcc(0),
-    fTurn(0), fLabel(NULL), fPosHasChanged(false), fReport(NULL)
-{
-}
-
+    fTurn(0), fLabel(NULL), fPosHasChanged(false), fReport(NULL),/*fTwin(0),
+    fIsUpdated(kFALSE),*/ fMotor(0), fOffset(0)
+{
+}
+/*
+void ShaftEncoder::CheckTwin(Int_t diff) const
+{
+    if (!fTwin)
+        return;
+
+    if (fTwin->fIsUpdated)
+        fTwin->fIsUpdated = kFALSE;
+    else
+        fTwin->fOffset += diff;
+}
+*/
 void ShaftEncoder::HandleSDO(WORD_t idx, BYTE_t subidx, LWORD_t val, timeval_t *tv)
 {
@@ -79,4 +93,7 @@
         fPos  = val;
         fTurn = 0;
+        fOffset = fMotor ? fMotor->GetPdoPos() : 0;
+        //fIsUpdated=kTRUE;
+        //fOffset = 0;
         return;
 
@@ -154,18 +171,18 @@
 void ShaftEncoder::DisplayVal()
 {
+    const LWORDS_t pos = GetPos();
     if (IsZombieNode())
     {
         fLabel->SetText(new TGString(""));
-        fUpdPos = ~fPos;
+        fUpdPos = ~pos;
         return;
     }
 
     char text[21];
-
-    if (fPos!=fUpdPos && fLabel)
-    {
-        sprintf(text, "%ld", fPos);
+    if (pos!=fUpdPos && fLabel)
+    {
+        sprintf(text, "%ld", pos);
         fLabel->SetText(new TGString(text));
-        fUpdPos = fPos;
+        fUpdPos = pos;
     }
 }
@@ -177,16 +194,21 @@
     //
     LWORDS_t pos = data[0] | (data[1]<<8) | (data[2]<<16); // | (data[3]<<24);
-    if (pos==fPos)
-        return;
+
+    //if (pos==fPos)
+    //    return;
 
     fPos = pos;
+    fOffset = fMotor ? fMotor->GetPdoPos() : 0;
     fTime.Set(*tv);
     fPosHasChanged = true;
 
+    //CheckTwin(fPos-pos);
+    //fIsUpdated=kTRUE;
+
     if (fReport)
     {
-        fReport->Lock();
+        fReport->Lock("ShaftEncoder::HandlePDOType0");
         *fReport << "SE-REPORT " << (int)GetId() << " " << fTime << " PDO0 " << pos << " " << GetNodeName() << endl;
-        fReport->UnLock();
+        fReport->UnLock("ShaftEncoder::HandlePDOType0");
     }
 }
@@ -200,10 +222,14 @@
     BYTE_t   flag = data[4];
 
-    if (fPos==pos)
-        return;
-
+    //if (fPos==pos)
+    //    return;
+
+    //CheckTwin(fPos-pos);
     fPos=pos;
+    fOffset = fMotor ? fMotor->GetPdoPos() : 0;
     fTime.Set(*tv);
     fPosHasChanged=true;
+    //fIsUpdated=kTRUE;
+    //fOffset = 0;
 
     flag=flag;
@@ -211,7 +237,7 @@
     if (fReport)
     {
-        fReport->Lock();
+        fReport->Lock("ShaftEncoder::HandlePDOType1");
         *fReport << "SE-REPORT " << (int)GetId() << " " << fTime << " PDO1 " << pos << " " << (int)flag << " " << GetNodeName() << endl;
-        fReport->UnLock();
+        fReport->UnLock("ShaftEncoder::HandlePDOType1");
     }
 }
@@ -241,18 +267,24 @@
         turn--;
 
-    if (fPos==pos && fTurn==fTurn)
-        return;
+    //if (fPos==pos && fTurn==fTurn)
+    //    return;
+
+    //CheckTwin(fPos-pos);
 
     fPos  = pos;
     fTurn = turn;
 
+    fOffset = fMotor ? fMotor->GetPdoPos() : 0;
     fTime.Set(*tv);
     fPosHasChanged=true;
+    //fIsUpdated=kTRUE;
+    //fOffset = 0;
+
 
     if (fReport)
     {
-        fReport->Lock();
+        fReport->Lock("ShaftEncoder::HandlePDOType2");
         *fReport << "SE-REPORT " << (int)GetId() << " " << fTime << " PDO2 " << pos << " " << fVel << " " << fAcc << " " << GetNodeName() << endl;
-        fReport->UnLock();
+        fReport->UnLock("ShaftEncoder::HandlePDOType2");
     }
 }
@@ -383,4 +415,6 @@
     fPos  = pre%16384;
     fTurn = pre/16384;
+
+    fOffset = fMotor ? fMotor->GetPdoPos() : 0;
 }
 
Index: trunk/MagicSoft/Cosy/devdrv/shaftencoder.h
===================================================================
--- trunk/MagicSoft/Cosy/devdrv/shaftencoder.h	(revision 4103)
+++ trunk/MagicSoft/Cosy/devdrv/shaftencoder.h	(revision 4104)
@@ -1,8 +1,14 @@
-#ifndef SHAFTENCODER_H
-#define SHAFTENCODER_H
+#ifndef COSY_ShafTEncoder
+#define COSY_ShafTEncoder
 
+#ifndef COSY_NodeDrv
 #include "nodedrv.h"
+#endif
+
+#ifndef MARS_MTime
 #include "MTime.h"
+#endif
 
+class Macs;
 class TGLabel;
 
@@ -19,6 +25,4 @@
     TGLabel  *fLabel;     //
     LWORDS_t  fUpdPos;    // ticks
-    //    WORDS_t   fUpdVel;    // ticks per 5ms
-    //    WORDS_t   fUpdAcc;    // ticks per 25ms^2
 
     bool fPosHasChanged;  //!
@@ -26,4 +30,7 @@
     MTime fTime;
     MLog *fReport;
+
+    Macs *fMotor;
+    Int_t fOffset;
 
     void HandlePDOType0(BYTE_t *data, timeval_t *tv);
@@ -35,4 +42,5 @@
     void Init();
     void CheckConnection();
+    // void CheckTwin(Int_t diff) const;
 
 public:
@@ -42,4 +50,6 @@
 
     void SetDisplay(TGLabel *label) { fLabel = label; }
+    void SetMotor(Macs *m) { fMotor = m; }
+    //void SetTwin(ShaftEncoder *se) { fTwin = se; }
 
     void HandleSDO(WORD_t idx, BYTE_t subidx, LWORD_t val, timeval_t *tv);
@@ -52,6 +62,8 @@
     void HandlePDO2(BYTE_t *data, timeval_t *tv) { HandlePDOType2(data, tv); }
 
-    LWORDS_t GetPos() { return IsZombieNode() ? 0 : fPos+fTurn*fTicks; } // FIXME? 0?
-    LWORD_t  GetPhysRes() { return fTicks; }
+    LWORDS_t GetPos() const { return IsZombieNode() ? 0 : fPos+fTurn*fTicks; } // FIXME? 0?
+    LWORD_t  GetPhysRes() const { return fTicks; }
+    Int_t    GetOffset() const { return fOffset; }
+    void     SetOffset(Int_t off) { fOffset = off; }
 
     double GetMjd();
Index: trunk/MagicSoft/Cosy/gui/GuiLinkDef.h
===================================================================
--- trunk/MagicSoft/Cosy/gui/GuiLinkDef.h	(revision 4103)
+++ trunk/MagicSoft/Cosy/gui/GuiLinkDef.h	(revision 4104)
@@ -4,6 +4,4 @@
 #pragma link off all classes;
 #pragma link off all functions;
-
-#pragma link C++ class MGAccuracy+;
 
 #pragma link C++ class MGCoordinate+;
@@ -14,6 +12,6 @@
 #pragma link C++ class MGImage+;
 
+#pragma link C++ class MGAccuracy+;
 #pragma link C++ class MGSkyPosition+;
-#pragma link C++ class MGVelocity+;
 
 #pragma link C++ class MGCosy+;
Index: trunk/MagicSoft/Cosy/gui/MGCosy.cc
===================================================================
--- trunk/MagicSoft/Cosy/gui/MGCosy.cc	(revision 4103)
+++ trunk/MagicSoft/Cosy/gui/MGCosy.cc	(revision 4104)
@@ -24,8 +24,11 @@
 #include "MCosy.h"
 #include "MTime.h"
+#include "MString.h"
 #include "MAstro.h"
 #include "MGList.h"
 #include "MDriveCom.h"
+#include "MGImage.h"
 #include "MGAccuracy.h"
+//#include "MGAccuracyTime.h"
 #include "MGCoordinates.h"
 #include "MGSkyPosition.h"
@@ -161,4 +164,8 @@
     fList->Add(l);
 
+    fWeather = new TGLabel(f, "");
+    fWeather->MoveResize(10, y+280, 280, 16);
+    fList->Add(fWeather);
+
     fLabel1 = new TGLabel(f, "00000"); // Max: 16384
     fLabel2 = new TGLabel(f, "00000");
@@ -733,11 +740,19 @@
     cout << "MGCosy: Creating MGVelocity" << endl;
 #endif
-    fVelocity = new MGVelocity(f2, "Velocity [\"/min]", 300);
-//    fOffset      = new MGVelocity   (f, "Offset se-re [']", 300);
+
+    fImage = new MGImage(f2, 768/2-1, 576/2-1, kRaisedFrame);
+    //fVelocity = new MGVelocity(f2, "Velocity [U_{mot}/min]", 300);
+    //    fOffset      = new MGVelocity   (f, "Offset se-re [']", 300);
+#ifdef DEBUG
+    cout << "MGCosy: Creating MGVelocityTime" << endl;
+#endif
+//  fAccuracyTime = new MGAccuracyTime(f2, 300);
 
     fList->Add(fSkyPosition);
     fList->Add(fAccuracy);
-    fList->Add(fVelocity);
-//    fList->Add(fOffset);
+    //  fList->Add(fAccuracyTime);
+    //  fList->Add(fVelocity);
+    //  fList->Add(fOffset);
+    fList->Add(fImage);
 
 #ifdef DEBUG
@@ -757,10 +772,11 @@
     TGLayoutHints *hints1  = new TGLayoutHints(kLHintsNormal  | kLHintsExpandX|kLHintsExpandY, 6, 6, 6, 3);
     TGLayoutHints *hints2  = new TGLayoutHints(kLHintsNormal  | kLHintsExpandX|kLHintsExpandY, 6, 6, 3, 6);
-    TGLayoutHints *hints1a = new TGLayoutHints(kLHintsLeft    | kLHintsTop   |kLHintsExpandX|kLHintsExpandY);
-    TGLayoutHints *hints2a = new TGLayoutHints(kLHintsCenterY | kLHintsTop   |kLHintsExpandX|kLHintsExpandY, 6, 6);
-    TGLayoutHints *hints3a = new TGLayoutHints(kLHintsRight   | kLHintsTop   |kLHintsExpandX|kLHintsExpandY);
-    TGLayoutHints *hints1b = new TGLayoutHints(kLHintsLeft    | kLHintsBottom|kLHintsExpandX|kLHintsExpandY);
-    TGLayoutHints *hints2b = new TGLayoutHints(kLHintsCenterY | kLHintsBottom|kLHintsExpandX|kLHintsExpandY, 6, 6);
-    TGLayoutHints *hints3b = new TGLayoutHints(kLHintsRight   | kLHintsBottom|kLHintsExpandX|kLHintsExpandY);
+
+    TGLayoutHints *hints1a = new TGLayoutHints(kLHintsLeft    | kLHintsCenterY|kLHintsExpandX|kLHintsExpandY);
+    TGLayoutHints *hints2a = new TGLayoutHints(kLHintsCenterX | kLHintsCenterY|kLHintsExpandX|kLHintsExpandY, 6, 6);
+    TGLayoutHints *hints3a = new TGLayoutHints(kLHintsRight   | kLHintsCenterY|kLHintsExpandX|kLHintsExpandY);
+    TGLayoutHints *hints1b = new TGLayoutHints(kLHintsLeft    | kLHintsCenterY|kLHintsExpandX|kLHintsExpandY);
+    TGLayoutHints *hints2b = new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 6, 6);
+    TGLayoutHints *hints3b = new TGLayoutHints(kLHintsRight   | kLHintsCenterY|kLHintsExpandX|kLHintsExpandY);
 
     fList->Add(hints1);
@@ -779,7 +795,9 @@
 
     // Layout upper frame
-    f2->AddFrame(frame,        hints1b);
-    f2->AddFrame(fVelocity,    hints2b);
-    f2->AddFrame(fLog,         hints3b);
+    f2->AddFrame(frame,         hints1b);
+    f2->AddFrame(fImage,        hints2b);
+    //f2->AddFrame(fVelocity,    hints2b);
+    //f2->AddFrame(fAccuracyTime, hints2b);
+    f2->AddFrame(fLog,          hints3b);
 
     // Layout window
@@ -802,6 +820,6 @@
     cout << "MGCosy: Setting Size" << endl;
 #endif
-    const Int_t w = 940;
-    const Int_t h = 660;
+    const Int_t w = 1010;
+    const Int_t h =  700;
     SetWMSizeHints(w, h, 1280, 900, 10, 10);  // set the smallest and biggest size of the Main frame
 
@@ -1013,5 +1031,7 @@
     if (oldmjd != (ULong_t)(1000000*mjd))
     {
-        fMjd->SetText(new TGString(Form("%12.6f", mjd)));
+        MString str;
+        str.Print("%12.6f", mjd);
+        fMjd->SetText(new TGString(str));
         oldmjd = (ULong_t)(1000000*mjd);
     }
@@ -1052,24 +1072,62 @@
     {
         fAccuracy->Update(pos, acc);
-        fVelocity->Update(vel);
+        // fAccuracyTime->Update(pos, acc);
+        // fVelocity->Update(vel);
         fAccuracy->MapWindow();
-        fVelocity->MapWindow();
+        // fAccuracyTime->MapWindow();
+        // fVelocity->MapWindow();
     }
     else
     {
         fAccuracy->UnmapWindow();
-        fVelocity->UnmapWindow();
+        // fAccuracyTime->UnmapWindow();
+        // fVelocity->UnmapWindow();
     }
     //    stat&kTracking ? fOffset->MapWindow()   : fOffset->UnmapWindow();
 
-/*
-    if (fLog->TestBit(kHasChanged))
-    {
-        fLog->MapSubwindows();
-        fLog->Layout();
-        fLog->ResetBit(kHasChanged);
-    }*/
-}
-// ======================================================================
+    //unsigned char empty[(768/2-1)*(576/2-1)];
+    //fImage->DrawImg(empty);
+    //fImage->DoRedraw();
+
+   // if (IsMapped())
+   //     fImage->DoRedraw();
+}
+
+void MGCosy::UpdateWeather(const MCeCoCom &com)
+{
+    ULong_t color;
+    switch (com.GetWeatherStatus())
+    {
+    case 0:
+        color=TGFrame::GetDefaultFrameBackground();
+        break;
+    case 1:
+        gClient->GetColorByName("Yellow", color);
+        break;
+    case 2:
+        gClient->GetColorByName("Orange", color);
+        break;
+    default:
+        gClient->GetColorByName("Red", color);
+        break;
+    }
+
+    if (com.HasAlarm())
+    {
+        static int i=0;
+        if ((i++/4)%2==0)
+            color = TGFrame::GetDefaultFrameBackground();
+    }
+
+    const TString old(fWeather->GetText()->GetString());
+    const TString txt(com.GetWeather());
+
+    // Color is only updated if the text has changed
+    if (old!=txt || color!=fWeather->GetBackground())
+        fWeather->SetText(txt);
+
+    if (color!=fWeather->GetBackground())
+        fWeather->SetBackgroundColor(color);
+}
 
 void MGCosy::CloseWindow()
Index: trunk/MagicSoft/Cosy/gui/MGCosy.h
===================================================================
--- trunk/MagicSoft/Cosy/gui/MGCosy.h	(revision 4103)
+++ trunk/MagicSoft/Cosy/gui/MGCosy.h	(revision 4104)
@@ -28,8 +28,10 @@
 class RaDec;
 class MsgQueue;
+class MCeCoCom;
 
 class MGList;
 class MGImage;
 class MGAccuracy;
+class MGAccuracyTime;
 class MGVelocity;
 class MGCoordinates;
@@ -65,4 +67,6 @@
     TGLabel       *fMjd;
 
+    TGLabel       *fWeather;
+
     MStarList     fPreDefList;
     MStarList     fStarList;
@@ -72,8 +76,11 @@
     MGCoordinates *fCCalib;
 
-    MGSkyPosition *fSkyPosition;
-    MGAccuracy    *fAccuracy;
-    MGVelocity    *fVelocity;
-    MGVelocity    *fOffset;
+    MGSkyPosition  *fSkyPosition;
+    MGAccuracy     *fAccuracy;
+    //MGAccuracyTime *fAccuracyTime;
+    MGVelocity     *fVelocity;
+    MGVelocity     *fOffset;
+
+    MGImage *fImage;
 
     MsgQueue      *fQueue;
@@ -128,6 +135,8 @@
 
     TGTextView *GetLog() const { return fLog; }
+    MGImage    *GetImage()     { return fImage; }
 
     void Update(ZdAz pos, ZdAz acc, ZdAz vel, /*ZdAz off,*/ RaDec radec, ZdAz soll, UInt_t stat, UInt_t stat2);
+    void UpdateWeather(const MCeCoCom &com);
 
     Bool_t ProcessMessage(Long_t msg, Long_t mp1, Long_t mp2);
Index: trunk/MagicSoft/Cosy/gui/Makefile
===================================================================
--- trunk/MagicSoft/Cosy/gui/Makefile	(revision 4103)
+++ trunk/MagicSoft/Cosy/gui/Makefile	(revision 4104)
@@ -38,7 +38,5 @@
 	   MGEmbeddedCanvas.cc \
 	   MGAccuracy.cc \
-	   MGVelocity.cc \
-	   MGSkyPosition.cc \
-           MGMenu.cc 
+	   MGSkyPosition.cc
 	   
 SRCS        = $(SRCFILES)
