Changeset 8824
- Timestamp:
- 01/24/08 09:20:59 (17 years ago)
- Location:
- trunk/MagicSoft/Cosy
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/gui/MGCosy.cc
r8376 r8824 37 37 #include "SlaStars.h" 38 38 39 #undef DEBUG 39 #define DEBUG 40 //#undef DEBUG 40 41 //#define EXPERT 41 42 //#define HAS_DEMO … … 84 85 void MGCosy::CreateMenu() 85 86 { 86 TGLayoutHints *laymenubar = new TGLayoutHints (kLHintsNormal | kLHintsExpandX); 87 TGLayoutHints *laymenuitem = new TGLayoutHints (kLHintsNormal, 0, 4, 0, 0); 88 fList->Add(laymenubar); 89 fList->Add(laymenuitem); 87 // 88 // the button messages are handled by main frame (this) 89 // 90 TGMenuBar *menubar = new TGMenuBar(this, 1, 1, kHorizontalFrame); 91 TGPopupMenu *filemenu = menubar->AddPopup("&File"); 92 TGPopupMenu *logmenu = menubar->AddPopup("&Log"); 90 93 91 94 // 92 95 // crate the menu bar 93 96 // 94 TGPopupMenu *filemenu = new TGPopupMenu(gClient->GetRoot());95 97 filemenu->AddEntry("Set Aspect", IDM_ASPECT); 96 98 filemenu->AddEntry("Exit", IDM_EXIT); 97 99 filemenu->Associate(this); 98 fList->Add(filemenu);99 100 100 101 // 101 102 // Log Menu 102 103 // 103 TGPopupMenu *logmenu = new TGPopupMenu(gClient->GetRoot());104 104 logmenu->AddEntry("&Copy Selected", kLogCopy); 105 105 logmenu->AddEntry("&Select All", kLogSelect); 106 106 logmenu->AddSeparator(); 107 107 logmenu->AddEntry("Clear &all", kLogClear); 108 /* 109 logmenu->AddSeparator(); 110 logmenu->AddEntry("Search", kLogSearch); 111 */ 108 //logmenu->AddSeparator(); 109 //logmenu->AddEntry("Search", kLogSearch); 112 110 logmenu->AddSeparator(); 113 111 logmenu->AddEntry("Sa&ve", kLogSave); … … 116 114 117 115 // 118 // the button messages are handled by main frame (this)119 //120 TGMenuBar *menubar = new TGMenuBar(this, 1, 1, kHorizontalFrame);121 menubar->AddPopup("File", filemenu, laymenuitem);122 menubar->AddPopup("Lo&g", logmenu, laymenuitem);123 AddFrame(menubar, laymenubar);124 fList->Add(menubar);125 126 //127 116 // Seperator beyond menubar 128 117 // 129 118 TGHorizontal3DLine *linesep = new TGHorizontal3DLine(this); 130 AddFrame(linesep, laymenubar); 131 fList->Add(linesep); 119 120 // 121 // Setup Frames 122 // 123 TGLayoutHints *laymenubar = new TGLayoutHints (kLHintsNormal | kLHintsExpandX); 124 125 AddFrame(menubar, (TGLayoutHints*)laymenubar->Clone()); 126 AddFrame(linesep, (TGLayoutHints*)laymenubar->Clone()); 127 128 delete laymenubar; 132 129 } 133 130 … … 449 446 l2->Move(x, y+h); 450 447 l3->Move(x, y+2*h); 451 l4->Move(x, y+3*h);448 //l4->Move(x, y+3*h); 452 449 fList->Add(l1); 453 450 fList->Add(l2); 454 451 fList->Add(l3); 455 fList->Add(l4);452 //fList->Add(l4); 456 453 457 454 #ifdef EXPERT … … 713 710 : TGMainFrame(p, w, h), fObservatory(key), fQueue(q) 714 711 { 712 // This means that all objects added with AddFrame are deleted 713 // automatically, including all LayoutHints. 714 SetCleanup(); 715 715 716 fList = new MGList; 717 fList->SetOwner(); 716 718 717 719 fFont = gVirtualX->LoadQueryFont("7x13bold"); 718 720 719 #ifdef DEBUG720 cout << "MGCosy: Creating Menu" << endl;721 #endif722 721 CreateMenu(); 723 722 724 #ifdef DEBUG725 cout << "MGCosy: Creating TGCompositeFrame" << endl;726 #endif727 723 TGHorizontalFrame *f1 = new TGHorizontalFrame(this, 0, 0); 728 724 TGHorizontalFrame *f2 = new TGHorizontalFrame(this, 0, 0); 729 fList->Add(f1); 730 fList->Add(f2); 731 732 #ifdef DEBUG 733 cout << "MGCosy: Creating TGTab" << endl; 734 #endif 725 f1->SetCleanup(); 726 f2->SetCleanup(); 727 //fList->Add(f1); 728 //fList->Add(f2); 729 735 730 fTab = new TGTab(f1, 300, 300); 736 fList->Add(fTab); 737 738 #ifdef DEBUG 739 cout << "MGCosy: Creating MGSkyPosition" << endl; 740 #endif 731 //fList->Add(fTab); 732 741 733 fSkyPosition = new MGSkyPosition(fObservatory, f1, 300); 742 #ifdef DEBUG 743 cout << "MGCosy: Creating MGAccuracy" << endl; 744 #endif 734 745 735 fAccuracy = new MGAccuracy(f1, 300); 746 736 fAccuracy->DrawText("0.5se", "1.0se", "2.0se", "Ctrl Deviation [min]"); 747 737 fAccuracy->DrawCircles(); 748 #ifdef DEBUG749 cout << "MGCosy: Creating MGVelocity" << endl;750 #endif751 738 752 739 fImage = new MGImage(f2, 768/2-1, 576/2-1, kRaisedFrame); 753 740 //fVelocity = new MGVelocity(f2, "Velocity [U_{mot}/min]", 300); 754 741 // fOffset = new MGVelocity (f, "Offset se-re [']", 300); 755 #ifdef DEBUG756 cout << "MGCosy: Creating MGVelocityTime" << endl;757 #endif758 742 // fAccuracyTime = new MGAccuracyTime(f2, 300); 759 743 760 fList->Add(fSkyPosition);761 fList->Add(fAccuracy);744 //fList->Add(fSkyPosition); 745 //fList->Add(fAccuracy); 762 746 // fList->Add(fAccuracyTime); 763 747 // fList->Add(fVelocity); 764 748 // fList->Add(fOffset); 765 fList->Add(fImage); 766 767 #ifdef DEBUG 768 cout << "MGCosy: Creating TGGroupFrame" << endl; 769 #endif 749 //fList->Add(fImage); 750 770 751 TGGroupFrame *frame = new TGGroupFrame(f2, "Status"); 771 fList->Add(frame); 772 773 #ifdef DEBUG 774 cout << "MGCosy: Creating TGTextView" << endl; 775 #endif 752 // frame->SetCleanup(); 753 //fList->Add(frame); 754 776 755 fLog = new TGTextView(f2, 300, 300); 777 756 if (fFont) 778 757 fLog->SetFont(fFont); 779 fList->Add(fLog);758 //fList->Add(fLog); 780 759 781 760 TGLayoutHints *hints1 = new TGLayoutHints(kLHintsNormal | kLHintsExpandX|kLHintsExpandY, 6, 6, 6, 3); … … 789 768 TGLayoutHints *hints3b = new TGLayoutHints(kLHintsRight | kLHintsCenterY|kLHintsExpandX|kLHintsExpandY); 790 769 770 /* 791 771 fList->Add(hints1); 792 772 fList->Add(hints2); … … 797 777 fList->Add(hints2b); 798 778 fList->Add(hints3b); 799 779 */ 800 780 // Layout upper frame 801 781 f1->AddFrame(fTab, hints1a); … … 814 794 AddFrame(f2, hints2); 815 795 816 #ifdef DEBUG817 cout << "MGCosy: Creating Tabs" << endl;818 #endif819 796 CreateTabs(); 820 #ifdef DEBUG821 cout << "MGCosy: Creating Label" << endl;822 #endif823 797 CreateLabel(frame); 824 798 … … 826 800 // Map the window, set up the layout, etc. 827 801 // 828 #ifdef DEBUG829 cout << "MGCosy: Setting Size" << endl;830 #endif831 802 const Int_t ww = 1010; 832 803 const Int_t hh = 700; … … 848 819 MGCosy::~MGCosy() 849 820 { 821 /* 822 TIter Next(fList); 823 TObject *o=0; 824 while((o=Next())) 825 { 826 cout << o << " " << flush; 827 cout << o->ClassName() << " " << flush; 828 cout << o->GetName() << " " << endl; 829 delete o; 830 } 831 */ 850 832 #ifdef DEBUG 851 833 cout << "MGCosy::~MGCosy called." << endl; … … 1466 1448 { 1467 1449 case kPB_RAp: 1468 xy. X(xy.X()+1./60);1450 xy.Set(xy.X()+1./60, xy.Y()); 1469 1451 break; 1470 1452 case kPB_RAm: 1471 xy. X(xy.X()-1./60);1453 xy.Set(xy.X()-1./60, xy.Y()); 1472 1454 break; 1473 1455 case kPB_DECp: 1474 xy. Y(xy.Y()+1./60);1456 xy.Set(xy.X(), xy.Y()+1./60); 1475 1457 break; 1476 1458 case kPB_DECm: 1477 xy. Y(xy.Y()-1./60);1459 xy.Set(xy.X(), xy.Y()-1./60); 1478 1460 break; 1479 1461 } -
trunk/MagicSoft/Cosy/main/MSlewing.cc
r8815 r8824 1 1 #include "MSlewing.h" 2 3 #include "MLogManip.h" 2 4 3 5 #include "MCosy.h" … … 103 105 104 106 MTime t(-1); 105 gLog << t << " - Target Position: " << d.Zd() << "deg, " << d.Az() << "deg (Zd/Az)" << endl;107 gLog << all << t << " - Target Position: " << d.Zd() << "deg, " << d.Az() << "deg (Zd/Az)" << endl; 106 108 107 109 // … … 150 152 { 151 153 152 gLog << "- Step #" << i << endl;154 gLog << inf2 << "- Step #" << i << endl; 153 155 154 156 // Get Shaft Encoder Positions … … 173 175 { 174 176 t.Now(); 175 gLog << t << " - Positioning done in " << i << (i==1?" step.":" steps.") << endl;177 gLog << all << t << " - Positioning done in " << i << (i==1?" step.":" steps.") << endl; 176 178 fCosy->SetStatus(MDriveCom::kStopped); 177 179 fCosy->fCom->SendStatus("Target position reached."); … … 191 193 192 194 // change units from se to re 193 rd *= fCosy->kGearTot/fCosy->kResSE; // [re] 195 // rd *= fCosy->kGearTot/fCosy->kResSE; // [re] 196 rd *= Div(fCosy->kGearTot,fCosy->kResSE); // [re] 194 197 rd.Zd(f2-f1); 195 198 … … 245 248 246 249 // repositioning (relative) 247 gLog << "- Do Relative Positioning..." << endl;250 gLog << inf2 << "- Do Relative Positioning..." << endl; 248 251 DoRelPos(rd, cdzd, cdaz); 249 gLog << "- Relative Positioning Done" << endl;252 gLog << inf2 << "- Relative Positioning Done" << endl; 250 253 } 251 254 if (i==1 && track && !Break()/*(fCosy->Break() || fCosy->HasError() || fCosy->HasZombie())*/) 252 255 { 253 256 t.Now(); 254 gLog << t << " - Positioning done." << endl;257 gLog << all << t << " - Positioning done." << endl; 255 258 fCosy->SetStatus(MDriveCom::kStopped); 256 259 fCosy->fCom->SendStatus("Tracking preposition reached."); … … 264 267 265 268 t.Now(); 266 gLog << t << " - Warning: Requested position not reached (i=" << dec << i << ")" << endl;269 gLog << warn << t << " - Warning: Requested position not reached (i=" << dec << i << ")" << endl; 267 270 268 271 fCosy->fCom->SendStatus("Target position missed!"); -
trunk/MagicSoft/Cosy/main/MStarguider.cc
r8821 r8824 248 248 fCaosAnalyse->AddEntry("St&op Analysis", IDM_kCaosAnalStop); 249 249 fCaosAnalyse->DisableEntry(IDM_kCaosAnalStop); 250 // fCaosAnalyse->AddEntry("&Reset Histograms", IDM_kResetHistograms);251 // fCaosAnalyse->AddEntry("Reset &Graph", IDM_kResetGraph);252 250 fCaosAnalyse->Associate(this); 253 251 fList->Add(fCaosAnalyse); 254 252 255 253 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 254 fDisplay = fMenu->AddPopup("&Display"); 263 255 fMode = fMenu->AddPopup("&Mode"); … … 266 258 fOperations = fMenu->AddPopup("&Operations"); 267 259 fMenu->Resize(fMenu->GetDefaultSize()); 268 //fMenu->BindKeys(this);269 260 AddFrame(fMenu); 270 //fList->Add(fMenu);271 261 272 262 // … … 290 280 fDisplay->CheckEntry(IDM_kStretch); 291 281 fDisplay->Associate(this); 292 //fList->Add(fDisplay); 293 294 //fMode = new MGPopupMenu(p); 282 295 283 fMode->AddEntry("Starguider", IDM_kStarguiderMode); 296 284 fMode->AddEntry("Tpoint", IDM_kTpointMode); 297 285 fMode->Associate(this); 298 //fList->Add(fMode); 299 300 //fWritePictures = new MGPopupMenu(p); 286 301 287 fWritePictures->AddEntry("&Start", IDM_kStart); 302 288 fWritePictures->AddEntry("Sto&p", IDM_kStop); … … 307 293 fWritePictures->DisableEntry(IDM_kStop); 308 294 fWritePictures->Associate(this); 309 //fList->Add(fWritePictures); 310 311 //fSetup = new MGPopupMenu(p); 295 312 296 fSetup->AddPopup("Lim. &Magnitude", fLimMag); 313 297 fSetup->AddPopup("Disp. &Interpolation", fInterpol); 314 //fSetup->AddEntry("Use Ra/Dec from file", IDM_kUseFileRaDec);315 298 fSetup->Associate(this); 316 //fList->Add(fSetup); 317 318 //fOperations = new MGPopupMenu(p); 299 319 300 fOperations->AddEntry("Roque Lamp Analysis", IDM_kRoqueLampAna); 320 301 fOperations->AddEntry("Starguider Analysis", IDM_kStargAnalysis); 321 302 fOperations->DisableEntry(IDM_kStargAnalysis); 322 303 fOperations->Associate(this); 323 //fList->Add(fOperations);324 304 325 305 fCaOs = new TGPopupMenu(p); … … 328 308 fCaOs->AddPopup("&Analyse", fCaosAnalyse); 329 309 fCaOs->Associate(this); 330 //fCaOs->BindKeys(fMenu, this);331 310 fList->Add(fCaOs); 332 /* 333 TGLayoutHints *hints2a = 334 new TGLayoutHints(kLHintsCenterX|kLHintsCenterY| 335 kLHintsExpandX|kLHintsExpandY,1,1); 336 fList->Add(hints2a); 337 */ 311 338 312 fGStarg = new MGStarg(this, 235); 339 313 fGStarg->DrawText("0.75'", "1.50'", "3.00'", "Mispointing [min]"); … … 346 320 fCRaDec->Move(4, fMenu->GetDefaultHeight()+584); 347 321 AddFrame(fCRaDec); 348 //fList->Add(fCRaDec);349 322 350 323 //telescope position … … 352 325 fCZdAz->Move(240+12+28, fMenu->GetDefaultHeight()+597); 353 326 AddFrame(fCZdAz); 354 //fList->Add(fCZdAz);355 327 356 328 //starguider position … … 358 330 fPZdAz->Move(240+12+28, fMenu->GetDefaultHeight()+640); 359 331 AddFrame(fPZdAz); 360 //fList->Add(fPZdAz);361 332 362 333 //mispointing … … 364 335 fDZdAz->Move(240+12+28, fMenu->GetDefaultHeight()+683); 365 336 AddFrame(fDZdAz); 366 //fList->Add(fDZdAz);367 337 368 338 fSZdAz = new MGCoordinates(this, kETypeZdAz, 2); 369 339 fSZdAz->Move(240+12+28, fMenu->GetDefaultHeight()+795); 370 340 AddFrame(fSZdAz); 371 //fList->Add(fSZdAz);372 341 373 342 fGNumStars = new MGNumStars(this, 235); … … 380 349 fTPoint->AllowStayDown(kTRUE); 381 350 AddFrame(fTPoint); 382 //fList->Add(fTPoint);383 351 384 352 fStargTPoint = new TGTextButton(this, "StargTPoint"); … … 386 354 fStargTPoint->AllowStayDown(kTRUE); 387 355 AddFrame(fStargTPoint); 388 //fList->Add(fStargTPoint);389 356 390 357 fFps = new TGLabel(this, "---fps"); … … 392 359 fFps->Move(650-495, fMenu->GetDefaultHeight()+714+23); 393 360 AddFrame(fFps); 394 //fList->Add(fFps);395 361 396 362 fPosZoom = new TGLabel(this, "(----, ----) ----.--d/----.--d"); … … 398 364 fPosZoom->Move(4, fMenu->GetDefaultHeight()+765); 399 365 AddFrame(fPosZoom); 400 //fList->Add(fPosZoom);401 366 402 367 fSkyBright = new TGLabel(this, "Sky Brightness: --- "); … … 404 369 fSkyBright->Move(4, fMenu->GetDefaultHeight()+785); 405 370 AddFrame(fSkyBright); 406 //fList->Add(fSkyBright);407 371 408 372 TGLabel *l = new TGLabel(this, "deg"); … … 410 374 l->Move(606-412, fMenu->GetDefaultHeight()+669); 411 375 AddFrame(l); 412 //fList->Add(l);413 376 414 377 l = new TGLabel(this, "arcsec/pix"); … … 416 379 l->Move(606-412, fMenu->GetDefaultHeight()+692); 417 380 AddFrame(l); 418 //fList->Add(l);419 381 420 382 l = new TGLabel(this, "sigma"); … … 422 384 l->Move(606-412, fMenu->GetDefaultHeight()+715); 423 385 AddFrame(l); 424 //fList->Add(l);425 386 426 387 fCZdAzText = new TGLabel(this, "Zd/Az telescope pointing at"); … … 428 389 fCZdAzText->Move(240+12+20+7, fMenu->GetDefaultHeight()+584-5); 429 390 AddFrame(fCZdAzText); 430 //fList->Add(fCZdAzText);431 391 432 392 fPZdAzText = new TGLabel(this, "Zd/Az starguider pointing at"); … … 434 394 fPZdAzText->Move(240+12+20+7, fMenu->GetDefaultHeight()+630+20-5-23); 435 395 AddFrame(fPZdAzText); 436 //fList->Add(fPZdAzText);437 396 438 397 fDZdAzText = new TGLabel(this, "Zd/Az mispointing"); … … 440 399 fDZdAzText->Move(240+12+20+7, fMenu->GetDefaultHeight()+676+2*20-5-46); 441 400 AddFrame(fDZdAzText); 442 //fList->Add(fDZdAzText);443 401 444 402 #ifdef EXPERT … … 447 405 l->Move(240+12+20, fMenu->GetDefaultHeight()+722+3*20-5); 448 406 AddFrame(l); 449 //fList->Add(l);450 407 #endif 451 408 … … 453 410 const Double_t angle = -0.2; 454 411 fSao->SetRotationAngle(angle); 455 412 456 413 TString txt; 457 414 txt += angle; … … 461 418 fAngle->Move(547-410, fMenu->GetDefaultHeight()+667); 462 419 AddFrame(fAngle); 463 //fList->Add(fAngle);464 420 465 421 // Set input box for pixel size … … 475 431 fPixSize->Move(547-410, fMenu->GetDefaultHeight()+690); 476 432 AddFrame(fPixSize); 477 //fList->Add(fPixSize);478 433 479 434 // Set input box for cleaning cut … … 487 442 fCut->Move(547-410, fMenu->GetDefaultHeight()+713); 488 443 AddFrame(fCut); 489 //fList->Add(fCut);490 444 491 445 // TGHorizontal3DLine *fLineSep = new TGHorizontal3DLine(this); … … 500 454 fZoomImage->Move(4, 700-kZOOM-2+85); 501 455 AddFrame(fZoomImage); 502 //fList->Add(fZoomImage);503 456 504 457 fImage = new MGImage(this, 768, 576); 505 458 fImage->Move(0, fMenu->GetDefaultHeight()); 506 459 AddFrame(fImage); 507 //fList->Add(fImage);508 460 509 461 const Int_t w = 768; … … 1863 1815 for (int x=0; x<768/2-1; x++) 1864 1816 simg[x+y*(768/2-1)] = ((unsigned int)img[2*x+2*y*768]+img[2*x+2*y*768+1]+img[2*x+2*(y+1)*768]+img[2*x+2*(y+1)*768+1])/4; 1865 1817 1866 1818 fCosy->GetWin()->GetImage()->DrawImg(simg); 1867 1819 }
Note:
See TracChangeset
for help on using the changeset viewer.