Changeset 9550 for trunk/MagicSoft/Cosy/main
- Timestamp:
- 02/23/10 10:17:52 (15 years ago)
- Location:
- trunk/MagicSoft/Cosy/main
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/main/CosyMainLinkDef.h
r9418 r9550 11 11 #pragma link C++ class MSlewing+; 12 12 #pragma link C++ class MTracking+; 13 #pragma link C++ class MMoonPointing+; 13 14 14 15 #endif -
trunk/MagicSoft/Cosy/main/MCosy.cc
r9516 r9550 351 351 } 352 352 353 void MCosy::TrackPlanet( const Int_t &p) // ra, dec [rad]353 void MCosy::TrackPlanet(Int_t id, Double_t offset, Double_t angle) 354 354 { 355 355 MTracking track(this); … … 360 360 track.SetTrackAcc(0.01, 0.01); 361 361 362 track.TrackPlanet((ePlanets_t)p); 363 } 364 365 void MCosy::TrackPosition(const RaDec &dst) // ra, dec [rad] 362 track.SetWobble(offset, angle); 363 track.TrackPlanet((ePlanets_t)id); 364 } 365 366 void MCosy::TrackMoon(Double_t wobble, Double_t offset) 366 367 { 367 368 MTracking track(this); … … 372 373 track.SetTrackAcc(0.01, 0.01); 373 374 375 track.TrackMoon(wobble, offset); 376 } 377 378 void MCosy::TrackPosition(const RaDec &dst) // ra, dec [rad] 379 { 380 MTracking track(this); 381 track.SetOut(fOutRep); 382 383 track.SetPointAcc(0.03, 0.01); 384 track.SetPointVelocity(0.3); 385 track.SetTrackAcc(0.01, 0.01); 386 387 //track.SetWobbleOffset(offset, angle); 374 388 track.TrackPosition(dst); 375 389 } … … 386 400 track.SetTrackAcc(0.01, 0.01); 387 401 402 //track.SetWobbleOffset(offset, angle); 388 403 track.TrackPosition(dst); 389 404 } … … 530 545 //cout << "WM_TPoint: done. (return 0xaffe)" << endl; 531 546 } 532 return 0xca1b;547 break; 533 548 534 549 case WM_STARGTPOINT: 535 550 if (fStarguider) 536 551 fStarguider->StartTPoint((char*)mp); 537 return 0xca1c;552 break; 538 553 539 554 case WM_STARGMODE: 540 555 if (fStarguider) 541 556 fStarguider->StartStarguider(*((bool*)mp)); 542 return 0xca1c;557 break; 543 558 544 559 case WM_TRACKPOS: … … 559 574 } 560 575 //cout << "WM_TrackPosition: done. (return 0xabcd)" << endl; 561 return 0xabcd;576 break; 562 577 563 578 case WM_ARM: … … 580 595 } 581 596 //cout << "WM_Position: done. (return 0x7777)" << endl; 582 return 0x9999;597 break; 583 598 584 599 case WM_POSITION: … … 592 607 } 593 608 //cout << "WM_Position: done. (return 0x7777)" << endl; 594 return 0x7777;609 break; 595 610 596 611 case WM_POSITION1: … … 604 619 } 605 620 //cout << "WM_Position: done. (return 0x7777)" << endl; 606 return 0x7777;621 break; 607 622 608 623 case WM_PREPS: … … 644 659 } 645 660 //cout << "WM_Track: done. (return 0x8888)" << endl; 646 return 0x7878;661 break; 647 662 /* 648 663 case WM_TESTSE: … … 678 693 } 679 694 //cout << "WM_Track/GRB: done. (return 0x8888)" << endl; 680 return 0x8888;681 682 case WM_ PLANET:695 break; 696 697 case WM_CELEST: 683 698 //cout << "WM_PLANET: START" << endl; 684 699 { 685 const Int_t p = ((Int_t*)mp)[0];686 700 if (!CheckNetwork()) 687 701 return 0xebb1; 688 702 689 TrackPlanet(p); 703 const Double_t *d = (Double_t*)mp; 704 705 const Int_t id = TMath::Nint(d[0]); 706 const Double_t offset = d[1]; 707 const Double_t angle = d[2]; 708 709 TrackPlanet(id, offset, angle); 690 710 } 691 711 //cout << "WM_PLANET: done. (return 0x8889)" << endl; 692 return 0x8889; 712 break; 713 714 case WM_MOON: 715 //cout << "WM_PLANET: START" << endl; 716 { 717 if (!CheckNetwork()) 718 return 0xebb1; 719 720 const Double_t *d = (Double_t*)mp; 721 722 const Double_t wobble = d[0]; 723 const Double_t offset = d[1]; 724 725 TrackMoon(wobble, offset); 726 } 727 //cout << "WM_PLANET: done. (return 0x8889)" << endl; 728 break; 693 729 /* 694 730 case WM_NEWTRACK: … … 702 738 fBending.Load("bending.txt"); 703 739 //cout << "WM_LoadBending: done. (return 0xbe0d)" << endl; 704 return 0xbe0d;740 break; 705 741 706 742 case WM_RESETBENDING: … … 708 744 fBending.Reset(); 709 745 //cout << "WM_ResetBending: done. (return 0xbe0e)" << endl; 710 return 0xbe0e;746 break; 711 747 712 748 case WM_CALCALTAZ: … … 737 773 cout << "SE bended: " << a2.Zd() << " " << a2.Az() << endl; 738 774 } 739 return 0xa17a;775 break; 740 776 741 777 case WM_ENDSWITCH: … … 747 783 cout << pos.Az() << "°" << endl; 748 784 } 749 750 return 0x1010; 785 break; 751 786 752 787 case WM_QUIT: … … 759 794 TerminateApp(); 760 795 cout << "WM_Quit: done." << endl; 761 return 0xaaaa; 762 } 763 cout << "MCosy::Proc: Unknown message 0x" << msg << endl; 764 return 0xffffffff; 796 break; 797 798 default: 799 cout << "MCosy::Proc: Unknown message 0x" << msg << endl; 800 return 0xffffffff; 801 } 802 803 return msg; 765 804 } 766 805 -
trunk/MagicSoft/Cosy/main/MCosy.h
r9516 r9550 46 46 #define WM_STARGTPOINT 0x1014 47 47 #define WM_STARGMODE 0x1015 48 #define WM_PLANET 0x1016 48 #define WM_CELEST 0x1016 49 #define WM_MOON 0x1017 49 50 50 51 class Dkc; … … 103 104 104 105 int SetPosition(const ZdAz &dst, Bool_t track=kFALSE); 105 void TrackPlanet(const Int_t &p); 106 void TrackPlanet(Int_t id, Double_t offset, Double_t angle); 107 void TrackMoon(Double_t wobble, Double_t offset); 106 108 void TrackPosition(const RaDec &dst); // ra, dec [rad] 107 109 void TrackPositionGRB(const RaDec &dst); // ra, dec [rad] -
trunk/MagicSoft/Cosy/main/MTracking.cc
r9523 r9550 12 12 #include "MDriveCom.h" 13 13 14 #include "MMoonPointing.h" 15 14 16 ClassImp(MTracking); 15 17 … … 21 23 MTracking::MTracking(MCosy *cosy) 22 24 : MSlewing(cosy), MThread("MTracking"), fSlalib(fCosy->fObservatory), 23 fTrackAcc(0, 0), f Out(0)25 fTrackAcc(0, 0), fWobbleOffset(-1), fWobbleAngle(0), fOut(0) 24 26 { 25 27 } … … 221 223 sla.Set(fTrackPos/TMath::DegToRad()); 222 224 else 223 sla.SetPlanet((ePlanets_t)fTrackType); 224 225 // if (fCosy->fStarguider) 226 // fCosy->fStarguider->SetPointingPosition(sla.GetRaDec()); 225 sla.SetPlanet((ePlanets_t)(fTrackType&0xff)); 226 227 if (fTrackType==(kEMoon|0x100)) 228 { 229 MMoonPointing moon("MoonShadowOffsets.root"); 230 if (moon.IsZombie()) 231 { 232 gLog << warn << "WARNING - Calculation of moon shadow failed." << endl; 233 return; 234 } 235 236 moon.SetOffsetShadow(fWobbleAngle); 237 moon.SetOffsetWobble(fWobbleOffset); 238 239 ZdAz srcpos, pointpos; 240 241 const ZdAz za = sla.GetZdAzRad(); 242 const ZdAz offset = moon.CalcPosition(za, srcpos, pointpos); 243 sla.ApplyOffsetZdAz(pointpos-za); 244 245 // Ra/Dec, Zd/Az from pointpos 246 // NEW: Source pos from srcpos 247 } 248 /* 249 else 250 if (fWobbleOffset>0) 251 { 252 MPositionOffsetCalc calc(fWobbleOffset, fWobbleAngle); 253 const ZdAz offset = calc.GetOffset(sla.GetZdAzRad()); 254 //if (srcpos.Zd()==0) 255 // return kFALSE; 256 sla.ApplyOffsetAltAz(offset); 257 } 258 */ 259 // if (fCosy->fStarguider) 260 // fCosy->fStarguider->SetPointingPosition(sla.GetRaDec()); 227 261 } 228 262 … … 288 322 fTrackPos = RaDec(); 289 323 fTrackType = planet; 324 325 // Start tracking 326 Track(); 327 } 328 329 void MTracking::TrackMoon(Double_t wobble, Double_t offset) 330 { 331 fTrackPos = RaDec(); 332 fTrackType = kEMoon|0x100; 333 334 fWobbleOffset = wobble; 335 fWobbleAngle = offset; 290 336 291 337 // Start tracking -
trunk/MagicSoft/Cosy/main/MTracking.h
r9523 r9550 28 28 RaDec fTrackPos; 29 29 30 Double_t fWobbleOffset; 31 Double_t fWobbleAngle; 32 30 33 MLog *fOut; 31 34 … … 42 45 Int_t Thread(); 43 46 47 ZdAz GetZdAzRad(const Slalib &sla); 48 44 49 public: 45 50 MTracking(MCosy *cosy); … … 47 52 void TrackPosition(const RaDec &dst); // ra, dec [rad] 48 53 void TrackPlanet(ePlanets_t planet); // ra, dec [rad] 54 void TrackMoon(Double_t wobble, Double_t offset); 49 55 void SetTrackAcc(Float_t zd, Float_t az) { fTrackAcc.Zd(zd); fTrackAcc.Az(az); } 56 57 void SetWobble(Double_t offset, Double_t angle=0) { fWobbleOffset=offset; fWobbleAngle=angle; } 50 58 51 59 void SetOut(MLog *fout) { fOut = fout; } -
trunk/MagicSoft/Cosy/main/Makefile
r9421 r9550 18 18 #------------------------------------------------------------------------------ 19 19 20 SRCFILES = MStarguider.cc \ 21 MStargHistograms.cc \ 22 MSlewing.cc \ 20 SRCFILES = MSlewing.cc \ 23 21 MTracking.cc \ 22 MMoonPointing.cc \ 24 23 MCaos.cc \ 24 MStarguider.cc \ 25 MStargHistograms.cc \ 25 26 MCosy.cc 26 27
Note:
See TracChangeset
for help on using the changeset viewer.