Changeset 920 for trunk/MagicSoft/Cosy/gui
- Timestamp:
- 08/29/01 16:44:38 (23 years ago)
- Location:
- trunk/MagicSoft/Cosy/gui
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/gui/MGAccuracy.cc
r918 r920 184 184 void MGAccuracy::UpdateText(Float_t pzd, Float_t azd, Float_t aaz) 185 185 { 186 const Float_t d2r = TMath::Pi()/ 360.;186 const Float_t d2r = TMath::Pi()/180.; 187 187 188 188 pzd *= d2r; -
trunk/MagicSoft/Cosy/gui/MGCosy.cc
r918 r920 12 12 #include <TSystem.h> // gSystem 13 13 #include <TGLabel.h> // TGLabel 14 #include <TGListBox.h> // TGListBox 14 15 #include <TG3DLine.h> // TGHorizontal3DLine (TGSplitter) 15 16 #include <TGFrame.h> // TGGroupFrame … … 72 73 void MGCosy::CreateLabel(TGCompositeFrame *f) 73 74 { 75 const int x = 180; 74 76 const int y = 25; 75 const int x = 180; 77 78 TGLabel *l; 79 80 l = new TGLabel(f, "SE-Az:"); 81 l->Move(x-60, y); 82 fList->Add(l); 83 84 l = new TGLabel(f, "SE-Zd1:"); 85 l->Move(x-60, y+20); 86 fList->Add(l); 87 88 l = new TGLabel(f, "SE-Zd2:"); 89 l->Move(x-60, y+40); 90 fList->Add(l); 91 76 92 77 93 fLabel1 = new TGLabel*[3]; … … 126 142 //f->AddFrame(fLabel3[2]); 127 143 144 l = new TGLabel(f, "Offset-Zd:"); 145 l->Move(x-60, y+80); 146 fList->Add(l); 147 148 l = new TGLabel(f, "Offset-Az:"); 149 l->Move(x-60, y+100); 150 fList->Add(l); 151 152 fOffsetZd = new TGLabel(f, "0000000"); 153 fOffsetAz = new TGLabel(f, "0000000"); 154 fOffsetZd->SetTextJustify(kTextRight); 155 fOffsetAz->SetTextJustify(kTextRight); 156 fOffsetZd->Move(x, y+80); 157 fOffsetAz->Move(x, y+100); 158 fList->Add(fOffsetZd); 159 fList->Add(fOffsetAz); 160 128 161 129 162 fError = new TGLabel(f, "Error"); … … 258 291 fAccuracy = new MGAccuracy (f, 300); 259 292 fVelocity = new MGVelocity (f, "Velocity ['/min]", 300); 260 fOffset = new MGVelocity (f, "Offset se-re [']", 300);293 // fOffset = new MGVelocity (f, "Offset se-re [']", 300); 261 294 262 295 fList->Add(fSkyPosition); 263 296 fList->Add(fAccuracy); 264 297 fList->Add(fVelocity); 265 fList->Add(fOffset);298 // fList->Add(fOffset); 266 299 267 300 TGGroupFrame *frame = new TGGroupFrame(f, "Status"); 268 301 frame->Resize(300, 300); 269 302 fList->Add(frame); 303 304 fLog = new TGListBox(f, -1, kSunkenFrame); //kSunkenFrame|kDoubleBorder, 305 fLog->Resize(300, 300); 306 fList->Add(fLog); 270 307 271 308 // … … 277 314 f->AddFrame(frame); 278 315 f->AddFrame(fVelocity); 279 f->AddFrame(f Offset);316 f->AddFrame(fLog); 280 317 281 318 AddFrame(f, new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 0, 0, 1, 0)); … … 337 374 } 338 375 376 void MGCosy::UpdateOffset(ZdAz &off) 377 { 378 static Int_t zd=~0; 379 static Int_t az=~0; 380 381 char text[21]; 382 383 if (zd!=(Int_t)off.Zd()) 384 { 385 zd = (Int_t)off.Zd(); 386 sprintf(text, "%ld", zd); 387 fOffsetZd->SetText(new TGString(text)); 388 } 389 if (az!=(Int_t)off.Az()) 390 { 391 az = (Int_t)off.Az(); 392 sprintf(text, "%ld", az); 393 fOffsetAz->SetText(new TGString(text)); 394 } 395 } 396 339 397 void MGCosy::Update(ZdAz pos, ZdAz acc, ZdAz vel, ZdAz off, UInt_t stat) 340 398 { … … 342 400 fAccuracy->Update(pos, acc); 343 401 fVelocity->Update(vel); 344 fOffset->Update(off);402 UpdateOffset(off); 345 403 346 404 #define kError 0x01 … … 358 416 stat&kTracking ? fAccuracy->MapWindow() : fAccuracy->UnmapWindow(); 359 417 stat&kTracking ? fVelocity->MapWindow() : fVelocity->UnmapWindow(); 360 stat&kTracking ? fOffset->MapWindow() : fOffset->UnmapWindow(); 418 // stat&kTracking ? fOffset->MapWindow() : fOffset->UnmapWindow(); 419 420 if (!fLog->TestBit(kHasChanged)) 421 return; 422 423 fLog->MapSubwindows(); 424 fLog->Layout(); 425 fLog->ResetBit(kHasChanged); 361 426 } 362 427 // ====================================================================== -
trunk/MagicSoft/Cosy/gui/MGCosy.h
r918 r920 33 33 class TGCompositeFrame; 34 34 class TGTab; 35 class TGListBox; 35 36 36 37 class MGCosy : public TGMainFrame … … 50 51 TGLabel **fLabel3; 51 52 53 TGLabel *fOffsetZd; 54 TGLabel *fOffsetAz; 55 52 56 MGCoordinates *fCoord; 53 57 MGSkyPosition *fSkyPosition; … … 66 70 TGLabel *fStopped; 67 71 72 TGListBox *fLog; 73 68 74 void CreateMenu(); 69 75 void CreateLabel(TGCompositeFrame *f); … … 73 79 74 80 void EnableLabel(TGLabel *label, Bool_t stat); 81 void UpdateOffset(ZdAz &off); 75 82 76 83 public: … … 80 87 void CloseWindow(); 81 88 82 TGLabel **GetLabel1() { return fLabel1; } 83 TGLabel **GetLabel2() { return fLabel2; } 84 TGLabel **GetLabel3() { return fLabel3; } 89 TGLabel **GetLabel1() const { return fLabel1; } 90 TGLabel **GetLabel2() const { return fLabel2; } 91 TGLabel **GetLabel3() const { return fLabel3; } 92 93 TGListBox *GetLog() const { return fLog; } 85 94 86 95 void Update(ZdAz pos, ZdAz acc, ZdAz vel, ZdAz off, UInt_t stat); -
trunk/MagicSoft/Cosy/gui/MGEmbeddedCanvas.cc
r918 r920 12 12 MGEmbeddedCanvas::MGEmbeddedCanvas(const char *name, const TGWindow* p, 13 13 const UInt_t width, Float_t range) 14 : TRootEmbeddedCanvas(name, p, width+1, width+1, kRaisedFrame),//, 0) //234, 76, kFixedSize)14 : TRootEmbeddedCanvas(name, p, width+1, width+1, 0/*kRaisedFrame*/), 15 15 fModified(kFALSE), fWidth(width), fRange(range), fPix(2.*range/width) 16 16 { -
trunk/MagicSoft/Cosy/gui/MGSkyPosition.cc
r918 r920 203 203 void MGSkyPosition::UpdatePosition(Float_t zd, Float_t az) 204 204 { 205 static int X=~0; 206 static int Y=~0; 205 static int X =~0; 206 static int Y =~0; 207 static int Rx=~0; 208 static int Ry=~0; 207 209 208 210 const float rad = D2PI*az/360.0; … … 217 219 const int pixy = (int)(y/fPix); 218 220 219 if (X==pixx && Y==pixy) 221 const int rx = (int)(s*fWidth/2.); 222 const int ry = (int)(c*fWidth/2.); 223 224 if (X==pixx && Y==pixy && Rx==rx && Ry==ry) 220 225 return; 221 226 222 227 X = pixx; 223 228 Y = pixy; 229 230 Rx = rx; 231 Ry = ry; 224 232 225 233 const float dx = s*4.;
Note:
See TracChangeset
for help on using the changeset viewer.