Changeset 2278 for trunk/MagicSoft/Cosy/main
- Timestamp:
- 07/15/03 15:05:21 (22 years ago)
- Location:
- trunk/MagicSoft/Cosy/main
- Files:
-
- 4 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/main/MCosy.cc
r2019 r2278 18 18 19 19 #include "MGCosy.h" 20 #include "MStarguider.h" 20 21 #include "SlaStars.h" 21 22 … … 330 331 { 331 332 // FIXME, what when waiting times out (Zombie) 333 if (!fMac1 || !fMac2) 334 return; 332 335 333 336 while ((fMac1->IsPositioning() || fMac2->IsPositioning()) && … … 428 431 const ZdAz d = dst*kRad2Deg; 429 432 430 lout << "Target Position: " << d.Zd() << "deg, " << d.Az() << "deg (Zd/Az)" << endl; 433 Timer t; 434 t.Now(); 435 lout << t << " - Target Position: " << d.Zd() << "deg, " << d.Az() << "deg (Zd/Az)" << endl; 431 436 432 437 if (!CheckRange(d)) … … 504 509 if (!cdzd && !cdaz) 505 510 { 506 lout << "Positioning done in " << i << (i==1?" step.":" steps.") << endl; 511 t.Now(); 512 lout << t << " - Positioning done in " << i << (i==1?" step.":" steps.") << endl; 507 513 SetStatus(MCosy::kStopped); 508 514 return TRUE; … … 577 583 // repositioning (relative) 578 584 // 579 lout << "Do Relative Positioning Done" << endl; 585 586 lout << "Do Relative Positioning..." << endl; 580 587 DoRelPos(rd, cdzd, cdaz); 581 582 588 lout << "Relative Positioning Done" << endl; 583 589 } … … 588 594 SetStatus(MCosy::kStopped); 589 595 590 lout << "Warning: Requested position not reached (i=" << i << ")" << endl; 596 t.Now(); 597 lout << t << " - Warning: Requested position not reached (i=" << i << ")" << endl; 591 598 return FALSE; 592 599 } … … 692 699 // is 25% of the |v| 693 700 // 694 const Float_t limit = 0.25;701 //const Float_t limit = 0.25; 695 702 696 703 // … … 721 728 } 722 729 */ 723 730 /* 724 731 if (sgn(vt->Az()) != sgn(vcalc.Az()) 725 732 && fabs(vt->Az()) < limit*fabs(vcalc.Az()) … … 729 736 vt->Az(0); 730 737 } 731 else 738 else*/ 732 739 if (fabs(vt->Az()) > maxtrack*vraz) 733 740 { … … 735 742 vt->Az(maxtrack*vraz*sgn(vcalc.Az())); 736 743 } 737 744 /* 738 745 if (sgn(vt->Zd()) != sgn(vcalc.Zd()) 739 746 && fabs(vt->Zd()) < limit*fabs(vcalc.Zd()) … … 744 751 } 745 752 else 746 if (fabs(vt->Zd()) > maxtrack*vrzd)753 */ if (fabs(vt->Zd()) > maxtrack*vrzd) 747 754 { 748 755 lout << "Warning: Altitude speed limit (" << maxtrack*100 << "%) exceeded... limited." << endl; … … 880 887 XY xy(Rad2Deg(dst.Ra())*24/360, Rad2Deg(dst.Dec())); 881 888 882 lout << "Start tracking:"; 889 sla.Now(); 890 lout << sla << " - Start tracking:"; 883 891 lout << " Ra: " << xy.X() << "h " << "Dec: " << xy.Y() << "\xb0" << endl; 884 #ifdef EXPERT892 /*#ifdef EXPERT 885 893 ofstream fout("coordinates.txt"); 886 894 fout << xy; 887 895 fout.close(); 888 896 #endif 889 //897 */ // 890 898 // Initialize Tracker (slalib or starguider) 891 899 // … … 1014 1022 } 1015 1023 1024 sla.Now(); 1025 1016 1026 fBackground = kBgdNone; 1017 1027 StopMovement(); 1018 lout << "Tracking stopped." << endl; 1028 1029 lout << sla << " - Tracking stopped." << endl; 1019 1030 } 1020 1031 … … 1037 1048 // 1038 1049 cout << "Stopping movement (dec=30%)..." << endl; 1050 if (fMac1 && fMac2) 1051 { 1039 1052 #ifdef EXPERT 1040 fMac1->SetDeceleration(0.5*fMac1->GetVelRes());1041 fMac2->SetDeceleration(0.5*fMac2->GetVelRes());1053 fMac1->SetDeceleration(0.5*fMac1->GetVelRes()); 1054 fMac2->SetDeceleration(0.5*fMac2->GetVelRes()); 1042 1055 #else 1043 fMac1->SetDeceleration(0.3*fMac1->GetVelRes());1044 fMac2->SetDeceleration(0.3*fMac2->GetVelRes());1056 fMac1->SetDeceleration(0.3*fMac1->GetVelRes()); 1057 fMac2->SetDeceleration(0.3*fMac2->GetVelRes()); 1045 1058 #endif 1046 fMac1->SetRpmMode(FALSE); 1047 fMac2->SetRpmMode(FALSE); 1059 fMac1->SetRpmMode(FALSE); 1060 fMac2->SetRpmMode(FALSE); 1061 } 1048 1062 1049 1063 /* … … 1201 1215 return (void*)0xaffe; 1202 1216 */ 1203 #ifdef EXPERT1204 1217 case WM_TPOINT: 1205 1218 { … … 1222 1235 cout << " SE-Pos: " << za.Alt() << "° " << za.Az() << "°" << endl; 1223 1236 *tpout << fmod(za.Az()+360, 360) << " " << za.Alt() << " "; 1237 1238 if (fStarguider) 1239 { 1240 XY tp = fStarguider->GetCoordinates(); 1241 *tpout << 90-tp.X() << " " << tp.Y() << " "; 1242 } 1243 1224 1244 *tpout << rd.Ra()/15 << " " << rd.Dec() << " " << setprecision(11) << sla.GetMjd() << endl; 1225 1245 … … 1227 1247 } 1228 1248 return (void*)0xca1b; 1229 #endif1230 1249 1231 1250 case WM_TRACKPOS: … … 1283 1302 cout << "WM_Track: START" << endl; 1284 1303 { 1304 RaDec dest = ((RaDec*)mp)[0]; 1305 if (fStarguider) 1306 fStarguider->SetPointingPosition(((RaDec*)mp)[1]); 1285 1307 if (!CheckNetwork()) 1286 1308 return (void*)0xebb0; 1287 1288 RaDec dest = *((RaDec*)mp);1289 1309 TrackPosition(dest*kDeg2Rad); 1290 1310 } … … 1352 1372 RaDec rd(xy.X()*15., xy.Y()); // [deg] 1353 1373 1354 const ZdAz a0 = sla.CalcZdAz(rd*kDeg2Rad); 1355 1356 ZdAz a1; 1357 AlignTrackingPos(a0, a1); 1358 a1 *= 180/TMath::Pi(); 1359 1360 const ZdAz a2 = a1*16384/360; 1361 const ZdAz se = a0*16384/360; 1374 ZdAz a1 = sla.CalcZdAz(rd*kDeg2Rad); // [rad] 1375 const ZdAz a0 = a1*kRad2Deg; // [deg] 1362 1376 1363 1377 cout << "Ra/Dec source: " << xy.X() << "h " << xy.Y() << "°" << endl; 1364 1378 cout << "Zd/Az target: " << a0.Zd() << "° " << a0.Az() << "°" << endl; 1379 1380 if (fZd1 && fZd2 && fAz) 1381 AlignTrackingPos(a0, a1); 1382 1383 a1 = fBending(a1)*kRad2Deg; 1384 1385 const ZdAz a2 = a1*16384/360; 1386 1365 1387 cout << "Zd/Az bended: " << a1.Zd() << "° " << a1.Az() << "°" << endl; 1366 cout << "SE target: " << se.Zd() << " " << se.Az() << endl;1367 1388 cout << "SE bended: " << a2.Zd() << " " << a2.Az() << endl; 1368 1389 } … … 1781 1802 } 1782 1803 1804 ZdAz MCosy::GetPointingPos() const 1805 { 1806 // GetPointingPos [deg] 1807 const ZdAz seist = GetSePos()*2*TMath::Pi()/16384; // [se] 1808 return fBending.CorrectBack(seist)*180/TMath::Pi(); 1809 } 1810 1783 1811 Bool_t MCosy::HandleTimer(TTimer *t) 1784 1812 { … … 1793 1821 fAz->DisplayVal(); 1794 1822 1795 ZdAz seist = GetSePos()*2*TMath::Pi()/16384; // [se] 1796 ZdAz bendist = fBending.CorrectBack(seist); 1823 ZdAz bendist = GetPointingPos(); 1797 1824 1798 1825 Byte_t avail = 0; … … 1810 1837 lout.UpdateGui(); 1811 1838 1812 fWin->Update(bendist *(360.0/2/TMath::Pi()), fTrackingError,1813 f Velocity, fOffset, fRaDec, fZdAzSoll, fStatus, avail);1839 fWin->Update(bendist, fTrackingError, fVelocity, /*fOffset,*/ 1840 fRaDec, fZdAzSoll, fStatus, avail); 1814 1841 1815 1842 const Bool_t trigger = fTriggerDisplay; … … 2076 2103 2077 2104 MCosy::MCosy(int mode, const char *dev, const int baud, MLog &out) 2078 : Network(dev, baud, out), fObservatory(MObservatory::kMagic1), f Zd1(0), fZd2(0), fAz(0), fMac1(0), fMac2(0), fMac3(0), fBackground(kBgdNone)2105 : Network(dev, baud, out), fObservatory(MObservatory::kMagic1), fStarguider(NULL), fZd1(0), fZd2(0), fAz(0), fMac1(0), fMac2(0), fMac3(0), fBackground(kBgdNone), fStatus(kStopped) 2079 2106 { 2080 2107 TEnv env(".cosyrc"); … … 2109 2136 fZd2->SetDisplay(fWin->GetLabel3()); 2110 2137 fAz->SetDisplay(fWin->GetLabel1()); 2111 #ifdef EXPERT 2138 2112 2139 int i=0; 2113 2140 char name[100]; … … 2130 2157 *tpout << time.Year() << " " << time.Month() << " " << time.Day() << " "; 2131 2158 *tpout << /*"20 1013.25 300 0.5 0.55 0.0065" <<*/ endl; 2132 #endif2133 2159 // temp(°C) pressure(mB) height(m) humidity(1) wavelength(microm) troplapserate(K/m) 2134 2160 } … … 2156 2182 MCosy::~MCosy() 2157 2183 { 2158 #ifdef EXPERT2159 2184 *tpout << "END" << endl; 2185 //streampos size = tpout.tellp(); 2160 2186 delete tpout; 2161 #endif2162 2187 2163 2188 cout << "Deleting GUI timer." << endl; -
trunk/MagicSoft/Cosy/main/MCosy.h
r2019 r2278 36 36 class MCosy; 37 37 class TH1; 38 class MStarguider; 38 39 39 40 class MTTalk : public MThread … … 71 72 const MObservatory::LocationName_t fObservatory; 72 73 74 MStarguider *fStarguider; 75 73 76 ShaftEncoder *fZd1; 74 77 ShaftEncoder *fZd2; … … 187 190 Bool_t HandleTimer(TTimer *t); 188 191 192 ZdAz GetPointingPos(void) const; 193 void SetStarguider(MStarguider *s) { fStarguider = s; } 194 189 195 // static ZdAz CorrectTarget(const ZdAz &src, const ZdAz &dst); 190 196 // static ZdAz RaDec2ZdAz(const double mjd, const RaDec &pos, const RaDec &pm=RaDec(0,0)); -
trunk/MagicSoft/Cosy/main/MainLinkDef.h
r1393 r2278 6 6 7 7 #pragma link C++ class MCosy; 8 #pragma link C++ class MStarguider+; 8 9 9 10 #pragma link C++ class MBending; -
trunk/MagicSoft/Cosy/main/Makefile
r1758 r2278 21 21 22 22 INCLUDES = -I. -I../base -I.. -I../gui -I../catalog -I../devdrv \ 23 -I../candrv -I../incl -I../videodev 23 -I../candrv -I../incl -I../videodev -I../caos 24 24 25 25 # @code … … 32 32 .SUFFIXES: .c .cc .cxx .h .hxx .o 33 33 34 SRCFILES = MCosy.cc \ 35 MBending.cc 34 SRCFILES = MBending.cc \ 35 MStarguider.cc \ 36 MCaos.cc \ 37 MCosy.cc 36 38 37 39 SRCS = $(SRCFILES)
Note:
See TracChangeset
for help on using the changeset viewer.