- Timestamp:
- 02/23/10 10:17:52 (15 years ago)
- Location:
- trunk/MagicSoft/Cosy
- Files:
-
- 2 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/Changelog
r9523 r9550 1 1 -*-*- END -*-*- 2 2010/02/23 Thomas Bretz 3 4 * catalog/SlaStars.[h,cc]: 5 - added ApplayOffsetAltAz 6 - added ApplayOffsetZdAz 7 8 * main/CosyMainLinkDef.h, main/Makefile: 9 - added MMoonPointing 10 11 * main/MMoonPointing.[h,cc]: 12 - added 13 14 * main/MCosy.[h,cc]: 15 - added TrackMoon 16 - added more options to TrackPlanet 17 - in msg-queue use break in switch-statement and return 18 message id by default 19 20 * main/MTracking.[h,cc]: 21 - implemented adding of moon shadow offset into UpdateSlalib 22 - added data members for fWobbleOffset wnd fWobbleAngle 23 - added setter for new data members 24 - added new function TrackMoon 25 26 * tcpip/MDriveCom.[h,cc]: 27 - added new arguments to CELEST command 28 - added new MOON command 29 30 31 2 32 2009/12/01 Thomas Bretz 3 33 -
trunk/MagicSoft/Cosy/catalog/SlaStars.cc
r9523 r9550 21 21 { 22 22 fAltAz = AltAz(TMath::Pi()/2-zdaz.Zd(), zdaz.Az()) * TMath::DegToRad(); 23 fRaDec = CalcRaDec(fAltAz); 24 } 25 26 void SlaStars::ApplyOffsetAltAz(const AltAz &offset) 27 { 28 fAltAz += offset; 23 29 fRaDec = CalcRaDec(fAltAz); 24 30 } -
trunk/MagicSoft/Cosy/catalog/SlaStars.h
r9523 r9550 61 61 ZdAz CalcZdAzFast (const RaDec &radec) const; 62 62 63 void ApplyOffsetAltAz(const AltAz &offset); 64 void ApplyOffsetZdAz(const ZdAz &offset) { ApplyOffsetAltAz(AltAz(-offset.Zd(), offset.Az())); } 65 63 66 ClassDef(SlaStars, 0) 64 67 }; -
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 -
trunk/MagicSoft/Cosy/tcpip/MDriveCom.cc
r9522 r9550 135 135 } 136 136 137 Int_t id, len; // Starguider switched on or not138 Float_t dra, ddec;139 Int_t n=sscanf(str.Data(), "%d %f %f %n", &id, & dra, &ddec, &len);137 Int_t id, len; 138 Float_t offset, angle; 139 Int_t n=sscanf(str.Data(), "%d %f %f %n", &id, &offset, &angle, &len); 140 140 if (n!=3) 141 141 { … … 153 153 } 154 154 155 gLog << all << "CC-COMMAND " << MTime(-1) << " CELEST ID=" << id << " dRa=" << dra << "deg dDec=" << ddec<< "deg" << endl;155 gLog << all << "CC-COMMAND " << MTime(-1) << " CELEST ID=" << id << " WobbleOffset=" << offset << "deg WobbleAngle=" << angle << "deg" << endl; 156 156 157 157 if (id==0) … … 167 167 } 168 168 169 // Moon; 170 id = 3; 171 172 gLog << warn << "WARNING - Tracking the moon's center forced." << endl; 173 174 //cout << "MDriveCom - POSITION... start." << endl; 175 if (fQueue) 176 fQueue->PostMsg(WM_PLANET, &id, sizeof(id)); 177 //cout << "MDriveCom - POSITION... done." << endl; 169 Double_t data[3] = { id, offset, angle }; 170 171 //cout << "MDriveCom - CELEST... start." << endl; 172 if (fQueue) 173 fQueue->PostMsg(WM_CELEST, data, sizeof(Double_t)*3); 174 //cout << "MDriveCom - CELEST... done." << endl; 175 return true; 176 } 177 178 bool MDriveCom::CommandMOON(TString &str) 179 { 180 str = str.Strip(TString::kBoth); 181 if (str.IsNull()) 182 { 183 gLog << err << "ERROR - MOON command empty." << endl; 184 return false; 185 } 186 187 Int_t len; 188 Float_t wobble, offset; 189 Int_t n=sscanf(str.Data(), "%f %f %n", &wobble, &offset, &len); 190 if (n!=2) 191 { 192 gLog << warn << "WARNING - Not enough argmuents (MOON)." << endl; 193 return kCONTINUE; 194 } 195 196 str.Remove(0, len); 197 str = str.Strip(TString::kBoth); 198 199 if (!str.IsNull()) 200 { 201 gLog << err << "ERROR - Too many bytes in command MOON" << endl; 202 return false; 203 } 204 205 gLog << all << "CC-COMMAND " << MTime(-1) << " MOON WobbleOffset=" << wobble << "deg ShadowOffset=" << offset << "deg" << endl; 206 207 Double_t data[2] = { wobble, offset }; 208 209 //cout << "MDriveCom - MOON... start." << endl; 210 if (fQueue) 211 fQueue->PostMsg(WM_MOON, data, sizeof(Double_t)*2); 212 //cout << "MDriveCom - MOON... done." << endl; 178 213 return true; 179 214 } … … 300 335 if (cmd==(TString)"CELEST") 301 336 return CommandCELEST(str); 337 338 if (cmd==(TString)"MOON") 339 return CommandMOON(str); 302 340 303 341 if (cmd==(TString)"PREPS") -
trunk/MagicSoft/Cosy/tcpip/MDriveCom.h
r9516 r9550 31 31 bool CommandZDAZ(TString &str); 32 32 bool CommandCELEST(TString &str); 33 bool CommandMOON(TString &str); 33 34 bool CommandPREPS(TString &str); 34 35 bool CommandARM(TString &str);
Note:
See TracChangeset
for help on using the changeset viewer.