Ignore:
Timestamp:
05/20/04 04:42:48 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Cosy/gui
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Cosy/gui/GuiLinkDef.h

    r2278 r4104  
    44#pragma link off all classes;
    55#pragma link off all functions;
    6 
    7 #pragma link C++ class MGAccuracy+;
    86
    97#pragma link C++ class MGCoordinate+;
     
    1412#pragma link C++ class MGImage+;
    1513
     14#pragma link C++ class MGAccuracy+;
    1615#pragma link C++ class MGSkyPosition+;
    17 #pragma link C++ class MGVelocity+;
    1816
    1917#pragma link C++ class MGCosy+;
  • trunk/MagicSoft/Cosy/gui/MGCosy.cc

    r2615 r4104  
    2424#include "MCosy.h"
    2525#include "MTime.h"
     26#include "MString.h"
    2627#include "MAstro.h"
    2728#include "MGList.h"
    2829#include "MDriveCom.h"
     30#include "MGImage.h"
    2931#include "MGAccuracy.h"
     32//#include "MGAccuracyTime.h"
    3033#include "MGCoordinates.h"
    3134#include "MGSkyPosition.h"
     
    161164    fList->Add(l);
    162165
     166    fWeather = new TGLabel(f, "");
     167    fWeather->MoveResize(10, y+280, 280, 16);
     168    fList->Add(fWeather);
     169
    163170    fLabel1 = new TGLabel(f, "00000"); // Max: 16384
    164171    fLabel2 = new TGLabel(f, "00000");
     
    733740    cout << "MGCosy: Creating MGVelocity" << endl;
    734741#endif
    735     fVelocity = new MGVelocity(f2, "Velocity [\"/min]", 300);
    736 //    fOffset      = new MGVelocity   (f, "Offset se-re [']", 300);
     742
     743    fImage = new MGImage(f2, 768/2-1, 576/2-1, kRaisedFrame);
     744    //fVelocity = new MGVelocity(f2, "Velocity [U_{mot}/min]", 300);
     745    //    fOffset      = new MGVelocity   (f, "Offset se-re [']", 300);
     746#ifdef DEBUG
     747    cout << "MGCosy: Creating MGVelocityTime" << endl;
     748#endif
     749//  fAccuracyTime = new MGAccuracyTime(f2, 300);
    737750
    738751    fList->Add(fSkyPosition);
    739752    fList->Add(fAccuracy);
    740     fList->Add(fVelocity);
    741 //    fList->Add(fOffset);
     753    //  fList->Add(fAccuracyTime);
     754    //  fList->Add(fVelocity);
     755    //  fList->Add(fOffset);
     756    fList->Add(fImage);
    742757
    743758#ifdef DEBUG
     
    757772    TGLayoutHints *hints1  = new TGLayoutHints(kLHintsNormal  | kLHintsExpandX|kLHintsExpandY, 6, 6, 6, 3);
    758773    TGLayoutHints *hints2  = new TGLayoutHints(kLHintsNormal  | kLHintsExpandX|kLHintsExpandY, 6, 6, 3, 6);
    759     TGLayoutHints *hints1a = new TGLayoutHints(kLHintsLeft    | kLHintsTop   |kLHintsExpandX|kLHintsExpandY);
    760     TGLayoutHints *hints2a = new TGLayoutHints(kLHintsCenterY | kLHintsTop   |kLHintsExpandX|kLHintsExpandY, 6, 6);
    761     TGLayoutHints *hints3a = new TGLayoutHints(kLHintsRight   | kLHintsTop   |kLHintsExpandX|kLHintsExpandY);
    762     TGLayoutHints *hints1b = new TGLayoutHints(kLHintsLeft    | kLHintsBottom|kLHintsExpandX|kLHintsExpandY);
    763     TGLayoutHints *hints2b = new TGLayoutHints(kLHintsCenterY | kLHintsBottom|kLHintsExpandX|kLHintsExpandY, 6, 6);
    764     TGLayoutHints *hints3b = new TGLayoutHints(kLHintsRight   | kLHintsBottom|kLHintsExpandX|kLHintsExpandY);
     774
     775    TGLayoutHints *hints1a = new TGLayoutHints(kLHintsLeft    | kLHintsCenterY|kLHintsExpandX|kLHintsExpandY);
     776    TGLayoutHints *hints2a = new TGLayoutHints(kLHintsCenterX | kLHintsCenterY|kLHintsExpandX|kLHintsExpandY, 6, 6);
     777    TGLayoutHints *hints3a = new TGLayoutHints(kLHintsRight   | kLHintsCenterY|kLHintsExpandX|kLHintsExpandY);
     778    TGLayoutHints *hints1b = new TGLayoutHints(kLHintsLeft    | kLHintsCenterY|kLHintsExpandX|kLHintsExpandY);
     779    TGLayoutHints *hints2b = new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 6, 6);
     780    TGLayoutHints *hints3b = new TGLayoutHints(kLHintsRight   | kLHintsCenterY|kLHintsExpandX|kLHintsExpandY);
    765781
    766782    fList->Add(hints1);
     
    779795
    780796    // Layout upper frame
    781     f2->AddFrame(frame,        hints1b);
    782     f2->AddFrame(fVelocity,    hints2b);
    783     f2->AddFrame(fLog,         hints3b);
     797    f2->AddFrame(frame,         hints1b);
     798    f2->AddFrame(fImage,        hints2b);
     799    //f2->AddFrame(fVelocity,    hints2b);
     800    //f2->AddFrame(fAccuracyTime, hints2b);
     801    f2->AddFrame(fLog,          hints3b);
    784802
    785803    // Layout window
     
    802820    cout << "MGCosy: Setting Size" << endl;
    803821#endif
    804     const Int_t w = 940;
    805     const Int_t h = 660;
     822    const Int_t w = 1010;
     823    const Int_t h =  700;
    806824    SetWMSizeHints(w, h, 1280, 900, 10, 10);  // set the smallest and biggest size of the Main frame
    807825
     
    10131031    if (oldmjd != (ULong_t)(1000000*mjd))
    10141032    {
    1015         fMjd->SetText(new TGString(Form("%12.6f", mjd)));
     1033        MString str;
     1034        str.Print("%12.6f", mjd);
     1035        fMjd->SetText(new TGString(str));
    10161036        oldmjd = (ULong_t)(1000000*mjd);
    10171037    }
     
    10521072    {
    10531073        fAccuracy->Update(pos, acc);
    1054         fVelocity->Update(vel);
     1074        // fAccuracyTime->Update(pos, acc);
     1075        // fVelocity->Update(vel);
    10551076        fAccuracy->MapWindow();
    1056         fVelocity->MapWindow();
     1077        // fAccuracyTime->MapWindow();
     1078        // fVelocity->MapWindow();
    10571079    }
    10581080    else
    10591081    {
    10601082        fAccuracy->UnmapWindow();
    1061         fVelocity->UnmapWindow();
     1083        // fAccuracyTime->UnmapWindow();
     1084        // fVelocity->UnmapWindow();
    10621085    }
    10631086    //    stat&kTracking ? fOffset->MapWindow()   : fOffset->UnmapWindow();
    10641087
    1065 /*
    1066     if (fLog->TestBit(kHasChanged))
    1067     {
    1068         fLog->MapSubwindows();
    1069         fLog->Layout();
    1070         fLog->ResetBit(kHasChanged);
    1071     }*/
    1072 }
    1073 // ======================================================================
     1088    //unsigned char empty[(768/2-1)*(576/2-1)];
     1089    //fImage->DrawImg(empty);
     1090    //fImage->DoRedraw();
     1091
     1092   // if (IsMapped())
     1093   //     fImage->DoRedraw();
     1094}
     1095
     1096void MGCosy::UpdateWeather(const MCeCoCom &com)
     1097{
     1098    ULong_t color;
     1099    switch (com.GetWeatherStatus())
     1100    {
     1101    case 0:
     1102        color=TGFrame::GetDefaultFrameBackground();
     1103        break;
     1104    case 1:
     1105        gClient->GetColorByName("Yellow", color);
     1106        break;
     1107    case 2:
     1108        gClient->GetColorByName("Orange", color);
     1109        break;
     1110    default:
     1111        gClient->GetColorByName("Red", color);
     1112        break;
     1113    }
     1114
     1115    if (com.HasAlarm())
     1116    {
     1117        static int i=0;
     1118        if ((i++/4)%2==0)
     1119            color = TGFrame::GetDefaultFrameBackground();
     1120    }
     1121
     1122    const TString old(fWeather->GetText()->GetString());
     1123    const TString txt(com.GetWeather());
     1124
     1125    // Color is only updated if the text has changed
     1126    if (old!=txt || color!=fWeather->GetBackground())
     1127        fWeather->SetText(txt);
     1128
     1129    if (color!=fWeather->GetBackground())
     1130        fWeather->SetBackgroundColor(color);
     1131}
    10741132
    10751133void MGCosy::CloseWindow()
  • trunk/MagicSoft/Cosy/gui/MGCosy.h

    r2280 r4104  
    2828class RaDec;
    2929class MsgQueue;
     30class MCeCoCom;
    3031
    3132class MGList;
    3233class MGImage;
    3334class MGAccuracy;
     35class MGAccuracyTime;
    3436class MGVelocity;
    3537class MGCoordinates;
     
    6567    TGLabel       *fMjd;
    6668
     69    TGLabel       *fWeather;
     70
    6771    MStarList     fPreDefList;
    6872    MStarList     fStarList;
     
    7276    MGCoordinates *fCCalib;
    7377
    74     MGSkyPosition *fSkyPosition;
    75     MGAccuracy    *fAccuracy;
    76     MGVelocity    *fVelocity;
    77     MGVelocity    *fOffset;
     78    MGSkyPosition  *fSkyPosition;
     79    MGAccuracy     *fAccuracy;
     80    //MGAccuracyTime *fAccuracyTime;
     81    MGVelocity     *fVelocity;
     82    MGVelocity     *fOffset;
     83
     84    MGImage *fImage;
    7885
    7986    MsgQueue      *fQueue;
     
    128135
    129136    TGTextView *GetLog() const { return fLog; }
     137    MGImage    *GetImage()     { return fImage; }
    130138
    131139    void Update(ZdAz pos, ZdAz acc, ZdAz vel, /*ZdAz off,*/ RaDec radec, ZdAz soll, UInt_t stat, UInt_t stat2);
     140    void UpdateWeather(const MCeCoCom &com);
    132141
    133142    Bool_t ProcessMessage(Long_t msg, Long_t mp1, Long_t mp2);
  • trunk/MagicSoft/Cosy/gui/Makefile

    r2384 r4104  
    3838           MGEmbeddedCanvas.cc \
    3939           MGAccuracy.cc \
    40            MGVelocity.cc \
    41            MGSkyPosition.cc \
    42            MGMenu.cc
     40           MGSkyPosition.cc
    4341           
    4442SRCS        = $(SRCFILES)
Note: See TracChangeset for help on using the changeset viewer.