Changeset 8821 for trunk/MagicSoft/Cosy/main
- Timestamp:
- 01/19/08 13:05:23 (17 years ago)
- Location:
- trunk/MagicSoft/Cosy/main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/main/MStarguider.cc
r8376 r8821 34 34 #include "MGStarg.h" 35 35 #include "MGNumStars.h" 36 #include "TGFrame.h"37 36 38 37 #include "MGImage.h" … … 53 52 #include "MAstroCamera.h" 54 53 55 #include "MGMenu.h"56 54 #include "MGCosy.h" 57 55 … … 148 146 { 149 147 fList = new MGList; 148 fList->SetOwner(); 150 149 151 150 const TGWindow *p=gClient->GetRoot(); 152 151 153 fChannel = new MGPopupMenu(p);152 fChannel = new TGPopupMenu(p); 154 153 fChannel->AddEntry("Starfield Camera", IDM_kChannel1); 155 154 fChannel->AddEntry("TPoint Camera", IDM_kChannel2); … … 162 161 fList->Add(fChannel); 163 162 163 fFileType = new TGPopupMenu(p); 164 fFileType->AddEntry("PP&M", IDM_kPPM); 165 fFileType->AddEntry("&PNG", IDM_kPNG); 166 fFileType->CheckEntry(IDM_kPNG); 167 fFileType->Associate(this); 168 fList->Add(fFileType); 169 170 fWriteType = new TGPopupMenu(p); 171 fWriteType->AddEntry("&Once", IDM_kOnce); 172 fWriteType->AddEntry("&Continous", IDM_kContinous); 173 fWriteType->CheckEntry(IDM_kOnce); 174 fWriteType->Associate(this); 175 fList->Add(fWriteType); 176 177 fWriteRate = new TGPopupMenu(p); 178 fWriteRate->AddEntry("25/s", IDM_kRate25ps); 179 fWriteRate->AddEntry("5/s", IDM_kRate5ps); 180 fWriteRate->AddEntry("1s", IDM_kRate1s); 181 fWriteRate->AddEntry("5s", IDM_kRate5s); 182 fWriteRate->AddEntry("30s", IDM_kRate30s); 183 fWriteRate->AddEntry("1min", IDM_kRate1m); 184 fWriteRate->AddEntry("5min", IDM_kRate5m); 185 fWriteRate->CheckEntry(IDM_kRate1m); 186 fWriteRate->Associate(this); 187 fList->Add(fWriteRate); 188 189 fWrtRate = 25*60; 190 191 fLimMag = new TGPopupMenu(p); 192 fLimMag->AddEntry("3", IDM_kLimMag3); 193 fLimMag->AddEntry("4", IDM_kLimMag4); 194 fLimMag->AddEntry("5", IDM_kLimMag5); 195 fLimMag->AddEntry("6", IDM_kLimMag6); 196 fLimMag->AddEntry("7", IDM_kLimMag7); 197 fLimMag->AddEntry("8", IDM_kLimMag8); 198 fLimMag->AddEntry("9", IDM_kLimMag9); 199 fLimMag->CheckEntry(IDM_kLimMag9); 200 fLimMag->Associate(this); 201 fList->Add(fLimMag); 202 203 fSao->SetLimitMag(9.0); 204 205 fInterpol = new TGPopupMenu(p); 206 fInterpol->AddEntry("250", IDM_kInterpol250); 207 fInterpol->AddEntry("125", IDM_kInterpol125); 208 fInterpol->AddEntry("50", IDM_kInterpol50); 209 fInterpol->AddEntry("25", IDM_kInterpol25); 210 fInterpol->AddEntry("10", IDM_kInterpol10); 211 fInterpol->AddEntry("5", IDM_kInterpol5); 212 fInterpol->AddEntry("2", IDM_kInterpol2); 213 fInterpol->AddEntry("Off", IDM_kInterpol1); 214 fInterpol->Associate(this); 215 fList->Add(fInterpol); 216 217 TString disp=gVirtualX->DisplayName(); 218 cout << "Display: " << disp << endl; 219 if (disp.First(':')>=0) 220 disp=disp(0, disp.First(':')); 221 222 if (disp.IsNull() || disp==(TString)"localhost") 223 { 224 fInterpol->CheckEntry(IDM_kInterpol5); 225 fIntRate = 50; 226 } 227 else 228 { 229 fInterpol->CheckEntry(IDM_kInterpol125); 230 fIntRate = 125; 231 } 232 233 fCaosPrint = new TGPopupMenu(p); 234 fCaosPrint->AddEntry("&Leds", IDM_kCaosPrintLeds); 235 fCaosPrint->AddEntry("&Rings", IDM_kCaosPrintRings); 236 fCaosPrint->Associate(this); 237 fList->Add(fCaosPrint); 238 239 fCaosWrite = new TGPopupMenu(p); 240 fCaosWrite->AddEntry("&Start", IDM_kCaosWriteStart); 241 fCaosWrite->AddEntry("Sto&p", IDM_kCaosWriteStop); 242 fCaosWrite->DisableEntry(IDM_kCaosWriteStop); 243 fCaosWrite->Associate(this); 244 fList->Add(fCaosWrite); 245 246 fCaosAnalyse = new TGPopupMenu(p); 247 fCaosAnalyse->AddEntry("S&tart Analysis", IDM_kCaosAnalStart); 248 fCaosAnalyse->AddEntry("St&op Analysis", IDM_kCaosAnalStop); 249 fCaosAnalyse->DisableEntry(IDM_kCaosAnalStop); 250 // fCaosAnalyse->AddEntry("&Reset Histograms", IDM_kResetHistograms); 251 // fCaosAnalyse->AddEntry("Reset &Graph", IDM_kResetGraph); 252 fCaosAnalyse->Associate(this); 253 fList->Add(fCaosAnalyse); 254 255 fMenu = new TGMenuBar(this, 0, 0, kHorizontalFrame); 256 //fMenu->SetCleanup(); 257 //fMenu->AddPopup("&Display", fDisplay, NULL); 258 //fMenu->AddPopup("&Mode", fMode, NULL); 259 //fMenu->AddPopup("&WritePics", fWritePictures, NULL); 260 //fMenu->AddPopup("&Setup", fSetup, NULL); 261 //fMenu->AddPopup("&Operations", fOperations, NULL); 262 fDisplay = fMenu->AddPopup("&Display"); 263 fMode = fMenu->AddPopup("&Mode"); 264 fWritePictures = fMenu->AddPopup("&WritePics"); 265 fSetup = fMenu->AddPopup("&Setup"); 266 fOperations = fMenu->AddPopup("&Operations"); 267 fMenu->Resize(fMenu->GetDefaultSize()); 268 //fMenu->BindKeys(this); 269 AddFrame(fMenu); 270 //fList->Add(fMenu); 271 164 272 // 165 273 // Create Menu for MStarguider Display 166 274 // 167 fDisplay = newMGPopupMenu(p);275 //fDisplay = new MMGPopupMenu(p); 168 276 fDisplay->AddEntry("&Filter", IDM_kFilter); 169 277 fDisplay->AddEntry("Stretch", IDM_kStretch); … … 182 290 fDisplay->CheckEntry(IDM_kStretch); 183 291 fDisplay->Associate(this); 184 fList->Add(fDisplay);185 186 fMode = new MGPopupMenu(p);292 //fList->Add(fDisplay); 293 294 //fMode = new MGPopupMenu(p); 187 295 fMode->AddEntry("Starguider", IDM_kStarguiderMode); 188 296 fMode->AddEntry("Tpoint", IDM_kTpointMode); 189 297 fMode->Associate(this); 190 fList->Add(fMode); 191 192 fOperations = new MGPopupMenu(p); 193 fOperations->AddEntry("Roque Lamp Analysis", IDM_kRoqueLampAna); 194 fOperations->AddEntry("Starguider Analysis", IDM_kStargAnalysis); 195 fOperations->DisableEntry(IDM_kStargAnalysis); 196 fOperations->Associate(this); 197 fList->Add(fOperations); 198 199 200 fFileType = new MGPopupMenu(p); 201 fFileType->AddEntry("PP&M", IDM_kPPM); 202 fFileType->AddEntry("&PNG", IDM_kPNG); 203 fFileType->CheckEntry(IDM_kPNG); 204 fFileType->Associate(this); 205 fList->Add(fFileType); 206 207 fWriteType = new MGPopupMenu(p); 208 fWriteType->AddEntry("&Once", IDM_kOnce); 209 fWriteType->AddEntry("&Continous", IDM_kContinous); 210 fWriteType->CheckEntry(IDM_kOnce); 211 fWriteType->Associate(this); 212 fList->Add(fWriteType); 213 214 fWriteRate = new MGPopupMenu(p); 215 fWriteRate->AddEntry("25/s", IDM_kRate25ps); 216 fWriteRate->AddEntry("5/s", IDM_kRate5ps); 217 fWriteRate->AddEntry("1s", IDM_kRate1s); 218 fWriteRate->AddEntry("5s", IDM_kRate5s); 219 fWriteRate->AddEntry("30s", IDM_kRate30s); 220 fWriteRate->AddEntry("1min", IDM_kRate1m); 221 fWriteRate->AddEntry("5min", IDM_kRate5m); 222 fWriteRate->CheckEntry(IDM_kRate1m); 223 fWriteRate->Associate(this); 224 fList->Add(fWriteRate); 225 226 fWrtRate = 25*60; 227 228 fWritePictures = new MGPopupMenu(p); 298 //fList->Add(fMode); 299 300 //fWritePictures = new MGPopupMenu(p); 229 301 fWritePictures->AddEntry("&Start", IDM_kStart); 230 302 fWritePictures->AddEntry("Sto&p", IDM_kStop); … … 235 307 fWritePictures->DisableEntry(IDM_kStop); 236 308 fWritePictures->Associate(this); 237 fList->Add(fWritePictures); 238 239 fLimMag = new MGPopupMenu(p); 240 fLimMag->AddEntry("3", IDM_kLimMag3); 241 fLimMag->AddEntry("4", IDM_kLimMag4); 242 fLimMag->AddEntry("5", IDM_kLimMag5); 243 fLimMag->AddEntry("6", IDM_kLimMag6); 244 fLimMag->AddEntry("7", IDM_kLimMag7); 245 fLimMag->AddEntry("8", IDM_kLimMag8); 246 fLimMag->AddEntry("9", IDM_kLimMag9); 247 fLimMag->CheckEntry(IDM_kLimMag9); 248 fLimMag->Associate(this); 249 fList->Add(fLimMag); 250 251 fSao->SetLimitMag(9.0); 252 253 fInterpol = new MGPopupMenu(p); 254 fInterpol->AddEntry("250", IDM_kInterpol250); 255 fInterpol->AddEntry("125", IDM_kInterpol125); 256 fInterpol->AddEntry("50", IDM_kInterpol50); 257 fInterpol->AddEntry("25", IDM_kInterpol25); 258 fInterpol->AddEntry("10", IDM_kInterpol10); 259 fInterpol->AddEntry("5", IDM_kInterpol5); 260 fInterpol->AddEntry("2", IDM_kInterpol2); 261 fInterpol->AddEntry("Off", IDM_kInterpol1); 262 fInterpol->Associate(this); 263 fList->Add(fInterpol); 264 265 TString disp=gVirtualX->DisplayName(); 266 cout << "Display: " << disp << endl; 267 if (disp.First(':')>=0) 268 disp=disp(0, disp.First(':')); 269 270 if (disp.IsNull() || disp==(TString)"localhost") 271 { 272 fInterpol->CheckEntry(IDM_kInterpol5); 273 fIntRate = 50; 274 } 275 else 276 { 277 fInterpol->CheckEntry(IDM_kInterpol125); 278 fIntRate = 125; 279 } 280 281 fSetup = new MGPopupMenu(p); 309 //fList->Add(fWritePictures); 310 311 //fSetup = new MGPopupMenu(p); 282 312 fSetup->AddPopup("Lim. &Magnitude", fLimMag); 283 313 fSetup->AddPopup("Disp. &Interpolation", fInterpol); 284 314 //fSetup->AddEntry("Use Ra/Dec from file", IDM_kUseFileRaDec); 285 315 fSetup->Associate(this); 286 fList->Add(fSetup); 287 288 fCaosPrint = new MGPopupMenu(p); 289 fCaosPrint->AddEntry("&Leds", IDM_kCaosPrintLeds); 290 fCaosPrint->AddEntry("&Rings", IDM_kCaosPrintRings); 291 fCaosPrint->Associate(this); 292 fList->Add(fCaosPrint); 293 294 fCaosWrite = new MGPopupMenu(p); 295 fCaosWrite->AddEntry("&Start", IDM_kCaosWriteStart); 296 fCaosWrite->AddEntry("Sto&p", IDM_kCaosWriteStop); 297 fCaosWrite->DisableEntry(IDM_kCaosWriteStop); 298 fCaosWrite->Associate(this); 299 fList->Add(fCaosWrite); 300 301 fCaosAnalyse = new MGPopupMenu(p); 302 fCaosAnalyse->AddEntry("S&tart Analysis", IDM_kCaosAnalStart); 303 fCaosAnalyse->AddEntry("St&op Analysis", IDM_kCaosAnalStop); 304 fCaosAnalyse->DisableEntry(IDM_kCaosAnalStop); 305 // fCaosAnalyse->AddEntry("&Reset Histograms", IDM_kResetHistograms); 306 // fCaosAnalyse->AddEntry("Reset &Graph", IDM_kResetGraph); 307 fCaosAnalyse->Associate(this); 308 fList->Add(fCaosAnalyse); 309 310 fMenu = new MGMenuBar(this, 0, 0, kHorizontalFrame); 311 fMenu->AddPopup("&Display", fDisplay, NULL); 312 fMenu->AddPopup("&Mode", fMode, NULL); 313 fMenu->AddPopup("&WritePics", fWritePictures, NULL); 314 fMenu->AddPopup("&Setup", fSetup, NULL); 315 fMenu->AddPopup("&Operations", fOperations, NULL); 316 317 fMenu->Resize(fMenu->GetDefaultSize()); 318 fMenu->BindKeys(this); 319 AddFrame(fMenu); 320 fList->Add(fMenu); 321 322 fCaOs = new MGPopupMenu(p); 316 //fList->Add(fSetup); 317 318 //fOperations = new MGPopupMenu(p); 319 fOperations->AddEntry("Roque Lamp Analysis", IDM_kRoqueLampAna); 320 fOperations->AddEntry("Starguider Analysis", IDM_kStargAnalysis); 321 fOperations->DisableEntry(IDM_kStargAnalysis); 322 fOperations->Associate(this); 323 //fList->Add(fOperations); 324 325 fCaOs = new TGPopupMenu(p); 323 326 fCaOs->AddPopup("&Write", fCaosWrite); 324 327 fCaOs->AddPopup("&Print", fCaosPrint); 325 328 fCaOs->AddPopup("&Analyse", fCaosAnalyse); 326 329 fCaOs->Associate(this); 327 fCaOs->BindKeys(fMenu, this);330 //fCaOs->BindKeys(fMenu, this); 328 331 fList->Add(fCaOs); 329 332 /* 330 333 TGLayoutHints *hints2a = 331 334 new TGLayoutHints(kLHintsCenterX|kLHintsCenterY| 332 335 kLHintsExpandX|kLHintsExpandY,1,1); 333 336 fList->Add(hints2a); 334 337 */ 335 338 fGStarg = new MGStarg(this, 235); 336 339 fGStarg->DrawText("0.75'", "1.50'", "3.00'", "Mispointing [min]"); … … 343 346 fCRaDec->Move(4, fMenu->GetDefaultHeight()+584); 344 347 AddFrame(fCRaDec); 345 fList->Add(fCRaDec);348 //fList->Add(fCRaDec); 346 349 347 350 //telescope position … … 349 352 fCZdAz->Move(240+12+28, fMenu->GetDefaultHeight()+597); 350 353 AddFrame(fCZdAz); 351 fList->Add(fCZdAz);354 //fList->Add(fCZdAz); 352 355 353 356 //starguider position … … 355 358 fPZdAz->Move(240+12+28, fMenu->GetDefaultHeight()+640); 356 359 AddFrame(fPZdAz); 357 fList->Add(fPZdAz);360 //fList->Add(fPZdAz); 358 361 359 362 //mispointing … … 361 364 fDZdAz->Move(240+12+28, fMenu->GetDefaultHeight()+683); 362 365 AddFrame(fDZdAz); 363 fList->Add(fDZdAz);366 //fList->Add(fDZdAz); 364 367 365 368 fSZdAz = new MGCoordinates(this, kETypeZdAz, 2); 366 369 fSZdAz->Move(240+12+28, fMenu->GetDefaultHeight()+795); 367 370 AddFrame(fSZdAz); 368 fList->Add(fSZdAz);371 //fList->Add(fSZdAz); 369 372 370 373 fGNumStars = new MGNumStars(this, 235); … … 377 380 fTPoint->AllowStayDown(kTRUE); 378 381 AddFrame(fTPoint); 379 fList->Add(fTPoint);382 //fList->Add(fTPoint); 380 383 381 384 fStargTPoint = new TGTextButton(this, "StargTPoint"); … … 383 386 fStargTPoint->AllowStayDown(kTRUE); 384 387 AddFrame(fStargTPoint); 385 fList->Add(fStargTPoint);388 //fList->Add(fStargTPoint); 386 389 387 390 fFps = new TGLabel(this, "---fps"); … … 389 392 fFps->Move(650-495, fMenu->GetDefaultHeight()+714+23); 390 393 AddFrame(fFps); 391 fList->Add(fFps);394 //fList->Add(fFps); 392 395 393 396 fPosZoom = new TGLabel(this, "(----, ----) ----.--d/----.--d"); … … 395 398 fPosZoom->Move(4, fMenu->GetDefaultHeight()+765); 396 399 AddFrame(fPosZoom); 397 fList->Add(fPosZoom);400 //fList->Add(fPosZoom); 398 401 399 402 fSkyBright = new TGLabel(this, "Sky Brightness: --- "); … … 401 404 fSkyBright->Move(4, fMenu->GetDefaultHeight()+785); 402 405 AddFrame(fSkyBright); 403 fList->Add(fSkyBright);406 //fList->Add(fSkyBright); 404 407 405 408 TGLabel *l = new TGLabel(this, "deg"); … … 407 410 l->Move(606-412, fMenu->GetDefaultHeight()+669); 408 411 AddFrame(l); 409 fList->Add(l);412 //fList->Add(l); 410 413 411 414 l = new TGLabel(this, "arcsec/pix"); … … 413 416 l->Move(606-412, fMenu->GetDefaultHeight()+692); 414 417 AddFrame(l); 415 fList->Add(l);418 //fList->Add(l); 416 419 417 420 l = new TGLabel(this, "sigma"); … … 419 422 l->Move(606-412, fMenu->GetDefaultHeight()+715); 420 423 AddFrame(l); 421 fList->Add(l);424 //fList->Add(l); 422 425 423 426 fCZdAzText = new TGLabel(this, "Zd/Az telescope pointing at"); … … 425 428 fCZdAzText->Move(240+12+20+7, fMenu->GetDefaultHeight()+584-5); 426 429 AddFrame(fCZdAzText); 427 fList->Add(fCZdAzText);430 //fList->Add(fCZdAzText); 428 431 429 432 fPZdAzText = new TGLabel(this, "Zd/Az starguider pointing at"); … … 431 434 fPZdAzText->Move(240+12+20+7, fMenu->GetDefaultHeight()+630+20-5-23); 432 435 AddFrame(fPZdAzText); 433 fList->Add(fPZdAzText);436 //fList->Add(fPZdAzText); 434 437 435 438 fDZdAzText = new TGLabel(this, "Zd/Az mispointing"); … … 437 440 fDZdAzText->Move(240+12+20+7, fMenu->GetDefaultHeight()+676+2*20-5-46); 438 441 AddFrame(fDZdAzText); 439 fList->Add(fDZdAzText);442 //fList->Add(fDZdAzText); 440 443 441 444 #ifdef EXPERT … … 444 447 l->Move(240+12+20, fMenu->GetDefaultHeight()+722+3*20-5); 445 448 AddFrame(l); 446 fList->Add(l);449 //fList->Add(l); 447 450 #endif 448 451 … … 458 461 fAngle->Move(547-410, fMenu->GetDefaultHeight()+667); 459 462 AddFrame(fAngle); 460 fList->Add(fAngle);463 //fList->Add(fAngle); 461 464 462 465 // Set input box for pixel size … … 472 475 fPixSize->Move(547-410, fMenu->GetDefaultHeight()+690); 473 476 AddFrame(fPixSize); 474 fList->Add(fPixSize);477 //fList->Add(fPixSize); 475 478 476 479 // Set input box for cleaning cut … … 484 487 fCut->Move(547-410, fMenu->GetDefaultHeight()+713); 485 488 AddFrame(fCut); 486 fList->Add(fCut);489 //fList->Add(fCut); 487 490 488 491 // TGHorizontal3DLine *fLineSep = new TGHorizontal3DLine(this); … … 497 500 fZoomImage->Move(4, 700-kZOOM-2+85); 498 501 AddFrame(fZoomImage); 499 fList->Add(fZoomImage);502 //fList->Add(fZoomImage); 500 503 501 504 fImage = new MGImage(this, 768, 576); 502 505 fImage->Move(0, fMenu->GetDefaultHeight()); 503 506 AddFrame(fImage); 504 fList->Add(fImage);507 //fList->Add(fImage); 505 508 506 509 const Int_t w = 768; … … 542 545 MStarguider::MStarguider(MObservatory::LocationName_t obs, Int_t channel) 543 546 : TGMainFrame(gClient->GetRoot(), 768, 840), 544 fCosy(NULL), 545 fOutTp(0), 547 fNumStarsDetected(0), 548 fNumStarsCorrelated(0), 549 fCosy(NULL), 550 fOutTp(0), 546 551 fOutStargTp(0), 547 552 fOutRq(0), 548 fDx((768-kZOOM)/2), 549 fDy((512-kZOOM)/2), 553 fDx((768-kZOOM)/2), 554 fDy((512-kZOOM)/2), 550 555 fStatus(MDriveCom::kStandby) 551 556 { 552 557 cout << " #### FIXME: Make MCaos Thread safe!" << endl; 558 559 // This means that all objects added with AddFrame are deleted 560 // automatically, including all LayoutHints. 561 SetCleanup(); 553 562 554 563 fAmcSocket = new TSocket("amc", 7307); … … 609 618 delete fSao; 610 619 delete fRaDec; 611 delete fTPoint;//612 delete fStargTPoint;//613 620 614 621 if (fOutTp) … … 663 670 } 664 671 665 void MStarguider::SwitchOff( MGPopupMenu *p, UInt_t id)672 void MStarguider::SwitchOff(TGPopupMenu *p, UInt_t id) 666 673 { 667 674 p->UnCheckEntry(id); … … 669 676 } 670 677 671 void MStarguider::Toggle(MGPopupMenu *p, UInt_t id) 678 void MStarguider::SetChannel() 679 { 680 if (fChannel->IsEntryChecked(IDM_kChannel3)) 681 { 682 if (dynamic_cast<PngReader*>(fGetter)==0) 683 { 684 delete fGetter; 685 fGetter=new PngReader(*this); 686 } 687 } 688 else 689 { 690 const Int_t ch = fChannel->IsEntryChecked(IDM_kChannel1) ? 0 : 1; 691 if (dynamic_cast<Camera*>(fGetter)==0) 692 { 693 delete fGetter; 694 fGetter = new Camera(*this, ch); 695 } 696 else 697 fGetter->SetChannel(ch); 698 } 699 } 700 701 void MStarguider::Toggle(TGPopupMenu *p, UInt_t id) 672 702 { 673 703 if (p->IsEntryChecked(id)) … … 736 766 fGStarg->MapWindow(); 737 767 fGNumStars->MapWindow(); 738 739 const Int_t ch0 =740 fChannel->IsEntryChecked(IDM_kChannel1) ? 0 : 1;741 const Int_t ch1 = 0;742 743 if (ch0!=ch1)744 {745 // fGetter->ExitLoop();746 delete fGetter;747 usleep(150000); // FIX: Device or resource busy.748 if (fChannel->IsEntryChecked(IDM_kChannel3))749 fGetter=new PngReader(*this);750 else751 {752 fGetter = new Camera(*this, ch1);753 ((Camera*)fGetter)->Loop(0);754 }755 }756 768 757 769 SwitchOff(fChannel, IDM_kChannel2); … … 785 797 fOperations->DisableEntry(IDM_kStargAnalysis); 786 798 } 799 800 SetChannel(); 787 801 //gSystem->Unlink("tracking_error.txt"); 788 802 } … … 991 1005 992 1006 //switch camera 993 const Int_t ch0 =994 fChannel->IsEntryChecked(IDM_kChannel1) ? 0 : 1;995 const Int_t ch1 = 1;996 997 if (ch0!=ch1)998 {999 // fGetter->ExitLoop();1000 delete fGetter;1001 usleep(150000); // FIX: Device or resource busy.1002 fGetter = new Camera(*this, ch1);1003 ((Camera*)fGetter)->Loop(0);1004 }1005 1006 1007 SwitchOff(fChannel, IDM_kChannel1); 1007 1008 fChannel->CheckEntry(IDM_kChannel2); 1009 1010 SetChannel(); 1008 1011 1009 1012 //checking needed items … … 1182 1185 fChannel->CheckEntry (ch1==0?IDM_kChannel1:IDM_kChannel2); 1183 1186 fChannel->UnCheckEntry(ch1==1?IDM_kChannel1:IDM_kChannel2); 1184 // fGetter->ExitLoop(); 1185 delete fGetter; 1186 usleep(150000); // FIX: Device or resource busy. 1187 if (fChannel->IsEntryChecked(IDM_kChannel3)) 1188 fGetter=new PngReader(*this); 1189 else 1190 { 1191 fGetter = new Camera(*this, ch1); 1192 ((Camera*)fGetter)->Loop(0); 1193 } 1187 1188 SetChannel(); 1194 1189 } 1195 1190 return kTRUE; … … 1810 1805 FilterLed f(img, 768, 576, 2.5); // 2.5 1811 1806 FilterLed f2(cimg, 768, 576); // former color 0xb0 1812 1807 1813 1808 if (fDisplay->IsEntryChecked(IDM_kStretch)) 1814 1809 f.Stretch(); 1815 1810 1816 1811 if (!fWritePictures->IsEntryEnabled(IDM_kStart) && 1817 1812 (!(n%fWrtRate) || fWriteType->IsEntryChecked(IDM_kOnce))) 1818 1813 { 1819 1814 1820 1815 if (fFileType->IsEntryChecked(IDM_kPNG)) 1821 1816 Writer::Png("pix/file", img, tm, fCRaDec->GetCoordinates()); … … 1827 1822 ProcessMessage(MK_MSG(kC_COMMAND, kCM_MENU), IDM_kStop, 0); 1828 1823 } 1829 1824 1830 1825 // Visual Filter, whole FOV 1831 1826 if (fDisplay->IsEntryChecked(IDM_kFilter)) 1832 1827 f.Execute(); 1833 1828 1834 1829 // Find Center of Camera for Caos and Tpoints 1835 1830 Ring center(768/2, 576/2); -
trunk/MagicSoft/Cosy/main/MStarguider.h
r8377 r8821 4 4 #include "PixClient.h" 5 5 #include "MGImage.h" 6 #include "coord.h" 6 7 #include "MPointing.h" 7 8 8 9 #ifndef MARS_MObservatory … … 24 25 class TTimer; 25 26 26 class MGMenuBar;27 class MGPopupMenu;27 class TGMenuBar; 28 class TGPopupMenu; 28 29 class TGTextEntry; 29 30 … … 53 54 MGList *fList; 54 55 55 MGMenuBar *fMenu;56 TGMenuBar *fMenu; 56 57 MGImage *fImage; 57 58 MGImage *fZoomImage; … … 60 61 MGNumStars *fGNumStars; 61 62 62 MGPopupMenu *fDisplay;63 MGPopupMenu *fMode;64 MGPopupMenu *fWritePictures;65 MGPopupMenu *fFileType;66 MGPopupMenu *fWriteType;67 MGPopupMenu *fWriteRate; 68 MGPopupMenu *fInterpol;69 MGPopupMenu *fSetup;70 MGPopupMenu *fLimMag;71 MGPopupMenu *fChannel;72 73 MGPopupMenu *fOperations;74 75 MGPopupMenu *fCaosWrite;76 MGPopupMenu *fCaosPrint;77 MGPopupMenu *fCaosAnalyse;78 MGPopupMenu *fCaOs;63 TGPopupMenu *fDisplay; 64 TGPopupMenu *fMode; 65 TGPopupMenu *fWritePictures; 66 TGPopupMenu *fSetup; 67 TGPopupMenu *fOperations; 68 69 TGPopupMenu *fFileType; 70 TGPopupMenu *fWriteType; 71 TGPopupMenu *fWriteRate; 72 TGPopupMenu *fInterpol; 73 TGPopupMenu *fLimMag; 74 TGPopupMenu *fChannel; 75 76 TGPopupMenu *fCaosWrite; 77 TGPopupMenu *fCaosPrint; 78 TGPopupMenu *fCaosAnalyse; 79 TGPopupMenu *fCaOs; 79 80 80 81 MGCoordinates *fCRaDec; … … 133 134 134 135 void SetPixSize(const double pixsize); 135 void Toggle( MGPopupMenu *p, UInt_t id);136 void SwitchOff( MGPopupMenu *p, UInt_t id);136 void Toggle(TGPopupMenu *p, UInt_t id); 137 void SwitchOff(TGPopupMenu *p, UInt_t id); 137 138 void ToggleStargAnalysis(); 138 139 void ToggleFindStar(); 139 140 void ToggleStarguider(); 140 141 void ToggleCaosFilter(); 142 void SetChannel(); 141 143 //void GetCoordinates(); 142 144 Int_t CalcTrackingError(Leds &, MStarList &, ZdAz &, MTime &, double &bright, Int_t &num); … … 145 147 bool Interpolate(const unsigned long n, byte *img) const; 146 148 147 XY FindRoqueLamp(FilterLed &f, FilterLed &f2, Ring &CameraCenter, MTime &t, 148 149 XY FindRoqueLamp(FilterLed &f, FilterLed &f2, Ring &CameraCenter, MTime &t, 150 Double_t cut, Int_t box, XY SearchCenter); 149 151 150 152 ZdAz FindStar(FilterLed &f, FilterLed &f2, Ring ¢er, MTime &t,
Note:
See TracChangeset
for help on using the changeset viewer.