Changeset 1804 for trunk/MagicSoft/Cosy/gui
- Timestamp:
- 03/02/03 17:08:13 (22 years ago)
- Location:
- trunk/MagicSoft/Cosy/gui
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/gui/MGEmbeddedCanvas.cc
r1702 r1804 52 52 } 53 53 54 void MGEmbeddedCanvas::Resize(TGDimension size) 55 { 56 fWidth = size.fWidth; 57 fPix = 2.*fRange/size.fWidth; 58 TRootEmbeddedCanvas::Resize(size); 59 } 60 61 void MGEmbeddedCanvas::Resize(UInt_t w, UInt_t h) 62 { 63 fWidth = w; 64 fPix = 2.*fRange/w; 65 TRootEmbeddedCanvas::Resize(w, h); 66 } 67 68 void MGEmbeddedCanvas::MoveResize(Int_t x, Int_t y, UInt_t w, UInt_t h) 69 { 70 fWidth = w; 71 fPix = 2.*fRange/w; 72 TRootEmbeddedCanvas::MoveResize(x, y, w, h); 73 } 74 54 75 // ------------------------------------------------------------------------ 55 76 // -
trunk/MagicSoft/Cosy/gui/MGEmbeddedCanvas.h
r1702 r1804 37 37 ~MGEmbeddedCanvas(); 38 38 39 void Resize(TGDimension size); 40 void Resize(UInt_t w, UInt_t h); 41 void MoveResize(Int_t x, Int_t y, UInt_t w, UInt_t h); 42 39 43 void UpdateCanvas(); 40 44 -
trunk/MagicSoft/Cosy/gui/MGSkyPosition.cc
r1793 r1804 262 262 float y = c*zdaz.Zd()*kRad2Deg; // [deg] 263 263 264 if (x>95 || x<-95 || y>95 || y<-95) 265 { 266 if (arc->GetX1()==10 && arc->GetY1()==100) 267 return; 268 269 x=-100; 270 y= 100; 271 } 272 273 const int pixx = (int)(x/fPix); 274 const int pixy = (int)(y/fPix); 275 276 const int oldx = (int)(arc->GetX1()/fPix); 277 const int oldy = (int)(arc->GetY1()/fPix); 278 279 if (pixx==oldx && pixy==oldy) 280 return; 281 282 arc->SetX1(x); 283 arc->SetY1(y); 284 285 SetModified(); //***MEMORY LEAK!!!*** 264 SetDotRange(arc, x, y); 286 265 } 287 266 … … 393 372 } 394 373 374 bool MGSkyPosition::SetDotRange(TArc *arc, float &x, float &y) 375 { 376 if (!(x>-95 && x<95 && y>-95 && y<95)) 377 { 378 if (arc->GetX1()==-100 && arc->GetY1()==100) 379 return false; 380 381 x=-100; 382 y= 100; 383 } 384 385 const int pixx = (int)(x/fPix); 386 const int pixy = (int)(y/fPix); 387 388 const int oldx = (int)(arc->GetX1()/fPix); 389 const int oldy = (int)(arc->GetY1()/fPix); 390 391 if (pixx==oldx && pixy==oldy) 392 return false; 393 394 arc->SetX1(x); 395 arc->SetY1(y); 396 397 SetModified(); 398 399 return true; 400 } 401 395 402 void MGSkyPosition::UpdatePlanet(Int_t planet, TArc *arc) 396 403 { … … 400 407 fSlaPlanet->UpdatePlanetPos((ePlanets_t)planet); 401 408 402 ZdAz zdaz = fSlaPlanet->GetPlanetPos((ePlanets_t)planet);409 const ZdAz zdaz = fSlaPlanet->GetPlanetPos((ePlanets_t)planet); 403 410 404 411 // … … 413 420 float y = c*deg; 414 421 415 if (x>95 || x<-95 || y>95 || y<-95) 416 { 417 if (arc->GetX1()==10 && arc->GetY1()==100) 418 return; 419 420 x=-100; 421 y= 100; 422 } 423 424 const int pixx = (int)(x/fPix); 425 const int pixy = (int)(y/fPix); 426 427 const int oldx = (int)(arc->GetX1()/fPix); 428 const int oldy = (int)(arc->GetY1()/fPix); 429 430 if (oldx==pixx && oldy==pixy) 422 if (!SetDotRange(arc, x, y)) 431 423 return; 432 433 //434 // Set new position435 //436 arc->SetX1(x);437 arc->SetY1(y);438 439 SetModified();440 424 441 425 if (planet==kESaturn) -
trunk/MagicSoft/Cosy/gui/MGSkyPosition.h
r1793 r1804 54 54 const MObservatory::LocationName_t fObservatory; 55 55 56 // Int_t fStarX[13]; 57 // Int_t fStarY[13]; 58 59 // Int_t fPlanetX[9]; 60 // Int_t fPlanetY[9]; 56 bool SetDotRange(TArc *arc, float &x, float &y); 61 57 62 58 void InitArc(TArc *arc, Int_t fillstyle, Int_t fillcolor, Int_t linecolor); -
trunk/MagicSoft/Cosy/gui/MGStarguider.cc
r1802 r1804 77 77 gVirtualX->GrabButton(fId, kButton2, 0, 0, 0, 0, kTRUE); 78 78 79 80 79 fList = new MGList; 81 80 … … 188 187 fList->Add(fCZdAz); 189 188 190 const Double_t pixsize = 23. 4;189 const Double_t pixsize = 23.5; 191 190 192 191 fSao->SetPixSize(pixsize/3600); … … 555 554 void MGStarguider::ProcessFrame(const unsigned long n, byte *img, struct timeval *tm) 556 555 { 556 static float myimg[768*576]; 557 558 for (int i=0; i<768*576; i++) 559 myimg[i] += img[i]; 560 561 if (n%fIntRate) 562 return; 563 564 cout << "Img: " << n << endl; 565 566 byte c[768*576]; 567 for (int i=0; i<768*576; i++) 568 c[i] = (byte)(myimg[i]/fIntRate+.5); 569 557 570 if (!fWrite->IsEntryEnabled(IDM_kStart) && 558 571 (!(n%fWrtRate) || fWriteType->IsEntryChecked(IDM_kOnce))) … … 563 576 char name[80]; 564 577 sprintf(name, "pix/file%04d.png", num++); 565 Writer::Png(name, img, tm);578 Writer::Png(name, c, tm); 566 579 } 567 580 … … 571 584 char name[80]; 572 585 sprintf(name, "pix/file%04d.ppm", num++); 573 Writer::Ppm(name, img);586 Writer::Ppm(name, c); 574 587 } 575 588 … … 578 591 } 579 592 580 static float myimg[768*576];581 582 for (int i=0; i<768*576; i++)583 myimg[i] += img[i];584 585 if (n%fIntRate)586 return;587 588 cout << "Img: " << n << endl;589 590 byte c[768*576];591 for (int i=0; i<768*576; i++)592 c[i] = (byte)(myimg[i]/fIntRate+.5);593 593 594 594 MStarList spots;
Note:
See TracChangeset
for help on using the changeset viewer.