Changeset 1111 for trunk/MagicSoft/Cosy/gui
- Timestamp:
- 12/12/01 13:26:34 (23 years ago)
- Location:
- trunk/MagicSoft/Cosy/gui
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/gui/MGAccuracy.cc
r921 r1111 18 18 19 19 #include "coord.h" 20 21 ClassImp(MGAccuracy); 20 22 21 23 void MGAccuracy::DrawCoordinateSystem() -
trunk/MagicSoft/Cosy/gui/MGAccuracy.h
r918 r1111 12 12 #endif 13 13 14 class TList;15 14 class TLine; 16 15 class TText; 17 class TCanvas;18 16 19 17 class ZdAz; 20 class SlaPlanets;21 18 22 19 class MGAccuracy : public MGEmbeddedCanvas … … 40 37 41 38 void Update(ZdAz &pos, ZdAz &acc); 39 40 ClassDef(MGAccuracy, 0) 42 41 }; 43 42 -
trunk/MagicSoft/Cosy/gui/MGCoordinate.cc
r921 r1111 17 17 #include "slamac.h" 18 18 19 ClassImp(MGCoordinate); 20 19 21 enum { 20 22 IDM_kDeg, … … 28 30 : TGFrame(p, 119, flag?76:46, kSunkenFrame|kFixedSize), fDeg(deg), fMin(min), fSec(sec) 29 31 { 32 fList = new MGList; 33 30 34 // p = pointer to MainFrame (not owner) 31 35 if (flag) … … 43 47 fTextEntryMin->MapWindow(); 44 48 fTextEntrySec->MapWindow(); 45 fList .Add(fTextEntrySec);46 fList .Add(fTextEntryMin);47 fList .Add(fTextEntryDeg);49 fList->Add(fTextEntrySec); 50 fList->Add(fTextEntryMin); 51 fList->Add(fTextEntryDeg); 48 52 49 53 Set(fTextEntryDeg, fDeg); … … 66 70 fLabelMin->MapWindow(); 67 71 fLabelSec->MapWindow(); 68 fList .Add(fLabelSec);69 fList .Add(fLabelDeg);70 fList .Add(fLabelMin);72 fList->Add(fLabelSec); 73 fList->Add(fLabelDeg); 74 fList->Add(fLabelMin); 71 75 72 76 Set(fLabelDeg, fDeg); … … 78 82 fLabel->Move(4, 4); 79 83 fLabel->MapWindow(); 80 fList .Add(fLabel);84 fList->Add(fLabel); 81 85 82 86 TGLabel *label; … … 92 96 label->Move(39, 26); 93 97 label->MapWindow(); 94 fList .Add(label);98 fList->Add(label); 95 99 96 100 label = new TGLabel(this, min); … … 98 102 label->Move(73, 26); 99 103 label->MapWindow(); 100 fList .Add(label);104 fList->Add(label); 101 105 102 106 label = new TGLabel(this, sec); … … 104 108 label->Move(107, 26); 105 109 label->MapWindow(); 106 fList .Add(label);110 fList->Add(label); 107 111 } 108 112 … … 111 115 label->Move(39, ypos); 112 116 label->MapWindow(); 113 fList .Add(label);117 fList->Add(label); 114 118 115 119 label = new TGLabel(this, min); … … 117 121 label->Move(73, ypos); 118 122 label->MapWindow(); 119 fList .Add(label);123 fList->Add(label); 120 124 121 125 label = new TGLabel(this, sec); … … 123 127 label->Move(107, ypos); 124 128 label->MapWindow(); 125 fList .Add(label);129 fList->Add(label); 126 130 127 131 MapWindow(); … … 130 134 MGCoordinate::~MGCoordinate() 131 135 { 132 // cout << "MGCoordinate destroyed." << endl;136 delete fList; 133 137 } 134 138 -
trunk/MagicSoft/Cosy/gui/MGCoordinate.h
r921 r1111 29 29 Int_t fSec; 30 30 31 MGList fList;31 MGList *fList; 32 32 33 33 TGTextEntry *fTextEntryDeg; … … 57 57 58 58 void Print(); 59 60 ClassDef(MGCoordinate, 0) 59 61 }; 60 62 -
trunk/MagicSoft/Cosy/gui/MGCoordinates.cc
r921 r1111 10 10 11 11 #include "MGCoordinate.h" 12 #include "coord.h" 13 14 ClassImp(MGCoordinates); 12 15 13 16 MGCoordinates::MGCoordinates(const TGWindow* p, -
trunk/MagicSoft/Cosy/gui/MGCoordinates.h
r921 r1111 11 11 #include <TGFrame.h> 12 12 #endif 13 #ifndef COORD_H 14 #include "coord.h" 15 #endif 13 14 class XY; 16 15 17 16 enum { … … 38 37 39 38 void Print(); 39 40 ClassDef(MGCoordinates, 0) 40 41 }; 41 42 -
trunk/MagicSoft/Cosy/gui/MGCosy.cc
r926 r1111 4 4 5 5 #include "msgqueue.h" 6 #include "coord.h" 6 7 7 8 #include <TROOT.h> … … 28 29 #include "SlaStars.h" 29 30 31 ClassImp(MGCosy); 32 30 33 #define IDM_EXIT 1 31 34 #define IDM_TEXT 2 … … 50 53 // 51 54 TGPopupMenu *fFileMenu = new TGPopupMenu(gClient->GetRoot()); 52 fFileMenu->AddEntry ("Exit", IDM_EXIT);53 //fFileMenu->Associate(this);55 fFileMenu->AddEntry("Exit", IDM_EXIT); 56 fFileMenu->Associate(this); 54 57 fList->Add(fFileMenu); 55 58 … … 516 519 517 520 cout << "Ra/Dec: " << rd.Ra() << kDEG << " " << rd.Dec() << kDEG << endl; 518 ZdAz aa=sla.CalcZdAz(rd* D2PI/360.0)*360.0/D2PI;521 ZdAz aa=sla.CalcZdAz(rd*kDeg2Rad)*kRad2Deg; 519 522 cout << "Zd/Az: " << aa.Zd() << kDEG << " " << aa.Az() << kDEG << endl; 520 523 } -
trunk/MagicSoft/Cosy/gui/MGCosy.h
r921 r1111 6 6 #endif 7 7 8 //#ifndef ROOT_TOrdCollection 9 //#include <TOrdCollection.h> 10 //#endif 11 12 #ifndef ROOT_TGWidget 13 #include <TGWidget.h> 14 #endif 15 16 #include <iostream.h> 17 18 #include "coord.h" 8 class TIterator; 19 9 20 10 class TGLabel; … … 23 13 class TGHorizontal3DLine; 24 14 class TGLayoutHints; 15 class TGCompositeFrame; 16 class TGTab; 17 class TGListBox; 18 19 class ZdAz; 20 class RaDec; 25 21 class MsgQueue; 26 class TIterator; 22 27 23 class MGImage; 28 24 class MGList; … … 31 27 class MGAccuracy; 32 28 class MGVelocity; 33 class TGCompositeFrame;34 class TGTab;35 class TGListBox;36 29 37 30 class MGCosy : public TGMainFrame … … 99 92 100 93 Bool_t ProcessMessage(Long_t msg, Long_t mp1, Long_t mp2); 94 95 ClassDef(MGCosy, 0) 101 96 }; 102 97 -
trunk/MagicSoft/Cosy/gui/MGEmbeddedCanvas.cc
r920 r1111 9 9 #include <TList.h> 10 10 #include <TCanvas.h> 11 12 ClassImp(MGEmbeddedCanvas); 11 13 12 14 MGEmbeddedCanvas::MGEmbeddedCanvas(const char *name, const TGWindow* p, -
trunk/MagicSoft/Cosy/gui/MGEmbeddedCanvas.h
r913 r1111 26 26 TList *fList; 27 27 28 const UInt_t fWidth;29 const Float_t fRange;30 const Float_t fPix;28 UInt_t fWidth; // const: rootcint/TMemberInspector 29 Float_t fRange; // const: rootcint/TMemberInspector 30 Float_t fPix; // const: rootcint/TMemberInspector 31 31 32 32 void InitCanvas(); … … 40 40 41 41 void SetModified() { fModified = kTRUE; } 42 43 ClassDef(MGEmbeddedCanvas, 0) 42 44 }; 43 45 -
trunk/MagicSoft/Cosy/gui/MGImage.cc
r808 r1111 11 11 #include <iostream.h> 12 12 #include <pthread.h> 13 14 ClassImp(MGImage); 13 15 14 16 MGImage::MGImage(const TGWindow* p, UInt_t w, UInt_t h, UInt_t options, ULong_t back) -
trunk/MagicSoft/Cosy/gui/MGImage.h
r808 r1111 42 42 void DrawImg(const byte *buffer); 43 43 void DrawColImg(const byte *gbuf, const byte *cbuf); 44 45 ClassDef(MGImage, 0) 44 46 }; 45 47 -
trunk/MagicSoft/Cosy/gui/MGSkyPosition.cc
r921 r1111 17 17 #include "coord.h" 18 18 #include "SlaPlanets.h" 19 20 ClassImp(MGSkyPosition); 19 21 20 22 void MGSkyPosition::InitPlanets() … … 208 210 static int Ry=~0; 209 211 210 const float rad = D2PI*az/360.0;212 const float rad = az*kDeg2Rad; 211 213 212 214 const float s = sin(rad); … … 306 308 const float c = cos(zdaz.Az()); 307 309 308 const float deg = 360.0/D2PI*zdaz.Zd();310 const float deg = zdaz.Zd()*kRad2Deg; 309 311 310 312 const float x = s*deg; -
trunk/MagicSoft/Cosy/gui/MGSkyPosition.h
r913 r1111 58 58 59 59 void Update(ZdAz &pos); 60 61 ClassDef(MGSkyPosition, 0) 60 62 }; 61 63 -
trunk/MagicSoft/Cosy/gui/MGStarguider.cc
r924 r1111 10 10 #include "MGCoordinates.h" 11 11 12 #include "coord.h" 13 14 #include "StarCatalog.h" 15 12 16 #include "Filter.h" 13 17 #include "Writer.h" 14 18 #include "base/timer.h" 19 20 ClassImp(MGStarguider); 15 21 16 22 enum { … … 42 48 43 49 MGStarguider::MGStarguider() 44 : Camera(), TGMainFrame(gClient->GetRoot(), 768, 700), fRaDec(180, 40) 45 { 50 : Camera(), TGMainFrame(gClient->GetRoot(), 768, 700) 51 { 52 fList = new MGList; 53 54 fSao = new StarCatalog; 55 fRaDec = new RaDec(180, 40); 56 46 57 // p = pointer to MainFrame (not owner) 47 58 … … 55 66 fDisplay->AddEntry("Sao &Catalog", IDM_kCatalog); 56 67 fDisplay->Associate(this); 57 fList .Add(fDisplay);68 fList->Add(fDisplay); 58 69 59 70 fFileType = new TGPopupMenu(p); … … 62 73 fFileType->CheckEntry(IDM_kPNG); 63 74 fFileType->Associate(this); 64 fList .Add(fFileType);75 fList->Add(fFileType); 65 76 66 77 fWriteType = new TGPopupMenu(p); … … 69 80 fWriteType->CheckEntry(IDM_kOnce); 70 81 fWriteType->Associate(this); 71 fList .Add(fWriteType);82 fList->Add(fWriteType); 72 83 73 84 fWriteRate = new TGPopupMenu(p); … … 81 92 fWriteRate->CheckEntry(IDM_kRate1m); 82 93 fWriteRate->Associate(this); 83 fList .Add(fWriteRate);94 fList->Add(fWriteRate); 84 95 85 96 fWrtRate = 25*60; … … 94 105 fWrite->DisableEntry(IDM_kStop); 95 106 fWrite->Associate(this); 96 fList .Add(fWrite);107 fList->Add(fWrite); 97 108 98 109 fLimMag = new TGPopupMenu(p); … … 106 117 fLimMag->CheckEntry(IDM_kLimMag8); 107 118 fLimMag->Associate(this); 108 fList .Add(fLimMag);109 110 fSao .SetLimitMag(8.0);119 fList->Add(fLimMag); 120 121 fSao->SetLimitMag(8.0); 111 122 112 123 fSetup = new TGPopupMenu(p); 113 124 fSetup->AddPopup("Lim. &Magnitude", fLimMag); 114 125 fSetup->Associate(this); 115 fList .Add(fSetup);126 fList->Add(fSetup); 116 127 117 128 fMenu = new TGMenuBar(this, 0, 0, kHorizontalFrame); … … 121 132 fMenu->Resize(fMenu->GetDefaultSize()); 122 133 AddFrame(fMenu); //, new TGLayoutHints (kLHintsNormal, 0, 4, 0, 0)); 123 fList .Add(fMenu);134 fList->Add(fMenu); 124 135 125 136 fCRaDec = new MGCoordinates(this, kETypeRaDec); 126 137 fCRaDec->Move(1, fMenu->GetDefaultHeight()+584); 127 138 AddFrame(fCRaDec); 128 fList .Add(fCRaDec);139 fList->Add(fCRaDec); 129 140 130 141 fCZdAz = new MGCoordinates(this, kETypeZdAz); 131 142 fCZdAz->Move(240+12, fMenu->GetDefaultHeight()+584); 132 143 AddFrame(fCZdAz); 133 fList .Add(fCZdAz);144 fList->Add(fCZdAz); 134 145 135 146 // TGHorizontal3DLine *fLineSep = new TGHorizontal3DLine(this); 136 147 // AddFrame(fLineSep, new TGLayoutHints (kLHintsNormal | kLHintsExpandX)); 137 // fList .Add(fLineSep);148 // fList->Add(fLineSep); 138 149 139 150 // … … 143 154 fImage->Move(0, fMenu->GetDefaultHeight()); 144 155 AddFrame(fImage); 145 fList .Add(fImage);156 fList->Add(fImage); 146 157 147 158 // … … 154 165 MapWindow(); 155 166 156 fSao .SetPixSize(0.006);167 fSao->SetPixSize(0.006); 157 168 } 158 169 159 170 MGStarguider::~MGStarguider() 160 171 { 172 delete fSao; 173 delete fRaDec; 174 175 delete fList; 161 176 cout << "Camera Display destroyed." << endl; 162 177 } … … 281 296 fLimMag->UnCheckEntry(i); 282 297 283 fSao .SetLimitMag(mp1-IDM_kLimMag3+3);298 fSao->SetLimitMag(mp1-IDM_kLimMag3+3); 284 299 return kTRUE; 285 300 } … … 331 346 XY xy = fCRaDec->GetCoordinates(); 332 347 333 fRaDec .Set(xy.X(), xy.Y());348 fRaDec->Set(xy.X(), xy.Y()); 334 349 335 350 Timer time(tm); 336 fSao .GetImg(img, cimg, time.CalcMjd(),fRaDec);351 fSao->GetImg(img, cimg, time.CalcMjd(), *fRaDec); 337 352 fImage->DrawColImg(img, cimg); 338 353 339 fCZdAz->SetCoordinates(fSao .GetZdAz());354 fCZdAz->SetCoordinates(fSao->GetZdAz()); 340 355 } 341 356 else -
trunk/MagicSoft/Cosy/gui/MGStarguider.h
r924 r1111 11 11 #include "MGList.h" 12 12 #include "MGImage.h" 13 #include "StarCatalog.h" 13 14 class RaDec; 14 15 15 16 class TGMenuBar; … … 19 20 class MGCoordinates; 20 21 22 class StarCatalog; 23 21 24 class MGStarguider : public Camera, public TGMainFrame 22 25 { 23 26 private: 24 MGList 27 MGList *fList; 25 28 26 29 TGMenuBar *fMenu; … … 38 41 MGCoordinates *fCZdAz; 39 42 40 StarCatalog 43 StarCatalog *fSao; 41 44 42 RaDec fRaDec;45 RaDec *fRaDec; 43 46 44 47 int fWrtRate; … … 50 53 virtual ~MGStarguider(); 51 54 52 void Update();55 //void Update(); 53 56 54 57 void Layout(); … … 61 64 // 62 65 void ProcessFrame(const unsigned long n, byte *img, struct timeval *tm); 66 67 ClassDef(MGStarguider, 0) 63 68 }; 64 69 -
trunk/MagicSoft/Cosy/gui/MGVelocity.cc
r921 r1111 20 20 #include "coord.h" 21 21 22 ClassImp(MGVelocity); 23 22 24 void MGVelocity::DrawCoordinateSystem() 23 25 { -
trunk/MagicSoft/Cosy/gui/MGVelocity.h
r921 r1111 51 51 52 52 void Update(ZdAz &pos); 53 54 ClassDef(MGVelocity, 0) 53 55 }; 54 56
Note:
See TracChangeset
for help on using the changeset viewer.