Changeset 808 for trunk/MagicSoft/Cosy/gui
- Timestamp:
- 05/25/01 16:51:24 (24 years ago)
- Location:
- trunk/MagicSoft/Cosy/gui
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/gui/MGCoordinate.cc
r732 r808 25 25 MGCoordinate::MGCoordinate(const TGWindow* p, 26 26 const Bool_t flag, const char *txt, 27 const UInt_t deg, const UInt_t min, const UInt_t sec)27 const Int_t deg, const UInt_t min, const UInt_t sec) 28 28 : TGFrame(p, 114, flag?76:46, kSunkenFrame|kFixedSize), fDeg(deg), fMin(min), fSec(sec) 29 29 { … … 131 131 Double_t MGCoordinate::GetVal() const 132 132 { 133 return (Double_t)(60*(60*fDeg+fMin)+fSec)/3600; 133 const Int_t deg = fDeg<0 ? -fDeg : fDeg; 134 const Int_t sgn = fDeg<0 ? -1 : 1; 135 136 return (Double_t)sgn*(60*(60*deg+fMin)+fSec)/3600; 134 137 } 135 138 … … 139 142 } 140 143 141 void MGCoordinate::Set(TGLabel *label, UInt_t val)144 void MGCoordinate::Set(TGLabel *label, Int_t val) 142 145 { 143 146 char txt[20]; … … 148 151 } 149 152 150 void MGCoordinate::Set(TGTextEntry *entry, UInt_t val)153 void MGCoordinate::Set(TGTextEntry *entry, Int_t val) 151 154 { 152 155 char txt[20]; … … 184 187 185 188 186 Bool_t MGCoordinate::Set(TGLabel *label, UInt_t &val, TGTextEntry *entry)187 { 188 UInt_t newval = atoi(entry->GetText());189 190 Bool_t ok = (entry == fTextEntryDeg || newval<60);189 Bool_t MGCoordinate::Set(TGLabel *label, Int_t &val, TGTextEntry *entry) 190 { 191 Int_t newval = atoi(entry->GetText()); 192 193 Bool_t ok = (entry == fTextEntryDeg || (newval>=0 && newval<60)); 191 194 192 195 if (ok) -
trunk/MagicSoft/Cosy/gui/MGCoordinate.h
r732 r808 20 20 class MGCoordinate : public TGFrame 21 21 { 22 UInt_t fDeg;23 UInt_t fMin;24 UInt_t fSec;22 Int_t fDeg; 23 Int_t fMin; 24 Int_t fSec; 25 25 26 26 MGList fList; … … 36 36 TGLabel *fLabel; 37 37 38 void Set(TGLabel *label, const UInt_t val);39 void Set(TGTextEntry *entry, const UInt_t val);40 Bool_t Set(TGLabel *label, UInt_t &val, TGTextEntry *label);38 void Set(TGLabel *label, const Int_t val); 39 void Set(TGTextEntry *entry, const Int_t val); 40 Bool_t Set(TGLabel *label, Int_t &val, TGTextEntry *label); 41 41 42 42 public: 43 43 MGCoordinate(const TGWindow* p, 44 44 const Bool_t flag=kTRUE, const char *txt="Coordinates:", 45 const UInt_t deg=0, const UInt_t min=0, const UInt_t sec=0);45 const Int_t deg=0, const UInt_t min=0, const UInt_t sec=0); 46 46 ~MGCoordinate(); 47 47 -
trunk/MagicSoft/Cosy/gui/MGCoordinates.cc
r732 r808 14 14 const Bool_t flag, 15 15 const char *txt1, const char *txt2, 16 const UInt_t deg1, const UInt_t min1, const UInt_t sec1,17 const UInt_t deg2, const UInt_t min2, const UInt_t sec2)16 const Int_t deg1, const UInt_t min1, const UInt_t sec1, 17 const Int_t deg2, const UInt_t min2, const UInt_t sec2) 18 18 : TGFrame(p, 234, 76, kFixedSize) 19 19 { -
trunk/MagicSoft/Cosy/gui/MGCoordinates.h
r732 r808 27 27 const char *txt1="Coordinate1:", 28 28 const char *txt2="Coordinate2:", 29 const UInt_t deg1=0, const UInt_t min1=0, const UInt_t sec1=0,30 const UInt_t deg2=0, const UInt_t min2=0, const UInt_t sec2=0);29 const Int_t deg1=0, const UInt_t min1=0, const UInt_t sec1=0, 30 const Int_t deg2=0, const UInt_t min2=0, const UInt_t sec2=0); 31 31 ~MGCoordinates(); 32 32 -
trunk/MagicSoft/Cosy/gui/MGCosy.cc
r740 r808 16 16 #include "MGList.h" 17 17 #include "MGCoordinates.h" 18 19 #include "Slalib.h" 18 20 19 21 #define IDM_EXIT 1 … … 242 244 t.GetTime(); 243 245 246 Slalib sla; 247 sla.Set(t.GetMjd()); 248 244 249 XY xy = fCoord->GetCoordinates(); 245 250 RaDec rd(xy.X(), xy.Y()); 246 251 247 252 cout << "Ra/Dec: " << rd.Ra() << kDEG << " " << rd.Dec() << kDEG << endl; 248 ZdAz aa= MCosy::RaDec2ZdAz(t.GetMjd(),rd*D2PI/360.0)*360.0/D2PI;253 ZdAz aa=sla.CalcZdAz(rd*D2PI/360.0)*360.0/D2PI; 249 254 cout << "Zd/Az: " << aa.Zd() << kDEG << " " << aa.Az() << kDEG << endl; 250 255 } -
trunk/MagicSoft/Cosy/gui/MGImage.cc
r732 r808 195 195 196 196 197 #include <TGClient.h>198 void MGImage::DrawImg(const char*buffer)197 //#include <TGClient.h> 198 void MGImage::DrawImg(const byte *buffer) 199 199 { 200 200 if (pthread_mutex_trylock((pthread_mutex_t*)fMuxPixmap)) … … 205 205 for (UInt_t x=0; x<fWidth; x++) 206 206 { 207 const unsigned charcol = buffer[y*fWidth+x];207 const byte col = buffer[y*fWidth+x]; 208 208 209 209 fBody[y][x*2] = fColors[col][0]; … … 306 306 } 307 307 308 void MGImage::DrawColImg(const char *gbuf, const char*cbuf)308 void MGImage::DrawColImg(const byte *gbuf, const byte *cbuf) 309 309 { 310 310 if (pthread_mutex_trylock((pthread_mutex_t*)fMuxPixmap)) … … 315 315 for (UInt_t x=0; x<fWidth; x++) 316 316 { 317 const unsigned charccol = cbuf[y*fWidth+x];317 const byte ccol = cbuf[y*fWidth+x]; 318 318 319 319 if (ccol) … … 324 324 else 325 325 { 326 const unsigned chargcol = gbuf[y*fWidth+x];326 const byte gcol = gbuf[y*fWidth+x]; 327 327 fBody[y][x*2] = fColors[gcol][0]; 328 328 fBody[y][x*2+1] = fColors[gcol][1]; -
trunk/MagicSoft/Cosy/gui/MGImage.h
r732 r808 9 9 10 10 #include <TGFrame.h> 11 12 typedef unsigned char byte; 11 13 12 14 class MGImage : public TGFrame … … 38 40 void MoveResize(Int_t x, Int_t y, UInt_t w, UInt_t h); 39 41 40 void DrawImg(const char*buffer);41 void DrawColImg(const char *gbuf, const char*cbuf);42 void DrawImg(const byte *buffer); 43 void DrawColImg(const byte *gbuf, const byte *cbuf); 42 44 }; 43 45
Note:
See TracChangeset
for help on using the changeset viewer.