Changeset 2615 for trunk/MagicSoft/Cosy
- Timestamp:
- 12/07/03 14:48:11 (21 years ago)
- Location:
- trunk/MagicSoft/Cosy
- Files:
-
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/Changelog
r2614 r2615 26 26 * Makefile: 27 27 - added 'install' 28 29 * bending_magic.txt: 30 - small chenges to correct AN, AW correction (new fit) 31 32 * cosy.cc, candrv/nodedrv.cc, devdrv/macs.[h,cc], 33 devdrv/shaftencoder.[h,cc], gui/MGCosy.cc, 34 gui/MGPngReader.cc, gui/MGTPoint.cc, main/MBending.cc, 35 main/MCaos.cc, main/MCosy.cc, main/MStarguider.[h,cc], 36 tcpip/MCeCoCom.[h,cc], tcpip/MDriveCom.cc, 37 videodev/Writer.cc: 38 - replaced Timer by MTime 39 40 * base/BaseLinkDef.h: 41 - added MTime 42 - added MAstro 43 44 * base/Makefile: 45 - added MTime 46 - added MAstro 47 48 * catalog/SlaStars.[h,cc], catalog/Slalib.[h,cc]: 49 - made independant of derivement from Timer 50 - added old Timer as new MTime fTime data member 51 52 * catalog/Slalib.h: 53 - removed conversion functions - use MAstro instead 54 55 * gui/MGCosy.cc, gui/MGSkyPosition.cc, tcpip/MDriveCom.cc: 56 - replaced static Slalib:: methody by MAstro 57 58 * main/MBending.[h,cc]: 59 - added corrected An/Aw algorithm 60 - removed 360deg ambiguity 28 61 29 62 -
trunk/MagicSoft/Cosy/Makefile
r2384 r2615 131 131 @ln -sf ../../Mars/mbase/MLogManip.h base/MLogManip.h 132 132 @ln -sf ../../Mars/mbase/MLogManip.cc base/MLogManip.cc 133 @ln -sf ../../Mars/mbase/MAstro.h base/MAstro.h 134 @ln -sf ../../Mars/mbase/MAstro.cc base/MAstro.cc 133 135 @ln -sf ../../Mars/mbase/MGList.h base/MGList.h 134 136 @ln -sf ../../Mars/mbase/MGList.cc base/MGList.cc 137 @ln -sf ../../Mars/mbase/MTime.h base/MTime.h 138 @ln -sf ../../Mars/mbase/MTime.cc base/MTime.cc 135 139 @ln -sf ../../Mars/mbase/MParContainer.h base/MParContainer.h 136 140 @ln -sf ../../Mars/mbase/MParContainer.cc base/MParContainer.cc -
trunk/MagicSoft/Cosy/base/BaseLinkDef.h
r1759 r2615 11 11 #pragma link C++ class MParContainer+; 12 12 #pragma link C++ class MObservatory+; 13 #pragma link C++ class MAstro+; 14 15 #pragma link C++ class MTime+; 16 #pragma link C++ function operator<<(ostream&, MTime&); 13 17 14 18 #endif -
trunk/MagicSoft/Cosy/base/Makefile
r1759 r2615 36 36 MThread.cc \ 37 37 MTimeout.cc \ 38 MTime.cc \ 39 MAstro.cc \ 38 40 MStar.cc \ 39 41 MStarList.cc \ … … 42 44 MLogManip.cc \ 43 45 MObservatory.cc \ 44 MGList.cc \ 45 timer.cc 46 MGList.cc 46 47 47 48 CINTHEADERS = MStar.h \ 48 49 MGList.h \ 50 MTime.h \ 51 MAstro.h \ 49 52 MLog.h \ 50 53 MLogManip.h \ -
trunk/MagicSoft/Cosy/bending_magic.txt
r2568 r2615 1 MAGIC1 2003/1 1/23 0:46:12.8805851 MAGIC1 2003/12/07 0:02:39.100594 2 2 S 00 000000 000000 0000000 3 IA 501.6639 0.0346183144 IE -9.0592 286 0.0200495373 IA 501.66388 0.034611014 4 IE -9.0592376 0.02005678 5 5 FLOP 0 0 6 6 AN 0 0 7 AW -1.55933 39 0.0222807078 NPAE 0.0737 56927 0.0393849527 AW -1.5593388 0.022279916 8 NPAE 0.073726654 0.039384899 9 9 CA 0 0 10 10 TF 0 0 -
trunk/MagicSoft/Cosy/candrv/nodedrv.cc
r2518 r2615 50 50 #include <TTimer.h> 51 51 52 #include " base/timer.h"52 #include "MTime.h" 53 53 #include "network.h" 54 54 #include "MLogManip.h" … … 489 489 class NodeGuard : public MThread 490 490 { 491 Double_t fTimeoutTime; 492 Double_t fGuardTime; 491 Double_t fTimeoutTime; //[s] 492 Double_t fGuardTime; //[s] 493 493 Int_t fLifeTimeFactor; 494 494 … … 503 503 void Reset(timeval_t *tv=NULL) 504 504 { 505 Timert;505 MTime t; 506 506 if (tv) 507 t.Set Timer(tv);507 t.Set(*tv); 508 508 else 509 509 t.Now(); … … 525 525 fDrv->SendNodeguard(); 526 526 527 Timert;527 MTime t; 528 528 t.Now(); 529 529 530 const Timert0 = t+fGuardTime;530 const Double_t t0 = t+fGuardTime; 531 531 532 532 while (!HasStopFlag() && t<t0 && t<fTimeoutTime) -
trunk/MagicSoft/Cosy/catalog/SlaStars.cc
r1758 r2615 31 31 } 32 32 33 void SlaStars::SetMjd( constdouble mjd)33 void SlaStars::SetMjd(double mjd) 34 34 { 35 35 Slalib::SetMjd(mjd); -
trunk/MagicSoft/Cosy/catalog/SlaStars.h
r1953 r2615 23 23 // const RaDec GetRaDec() const { return fRaDec*360/D2PI; } 24 24 25 virtual void SetMjd( constdouble mjd);25 virtual void SetMjd(double mjd); 26 26 27 27 void Set(const AltAz &altaz); -
trunk/MagicSoft/Cosy/catalog/Slalib.cc
r2280 r2615 10 10 ClassImp(Slalib); 11 11 12 Slalib::Slalib(MObservatory::LocationName_t key) : Timer(), MObservatory(key) 13 { 14 } 15 16 Slalib::~Slalib() 12 Slalib::Slalib(MObservatory::LocationName_t key) : MObservatory(key) 17 13 { 18 14 } … … 32 28 void Slalib::SetMjd(double mjd) 33 29 { 34 Timer::SetMjd(mjd);30 fTime.SetMjd(mjd); 35 31 fAlpha = slaGmst(mjd) + GetElong(); 36 32 } … … 57 53 return ZdAz(kPiDiv2-alt, az); 58 54 } 59 55 /* 60 56 Double_t Slalib::Hms2Sec(Int_t deg, UInt_t min, Double_t sec, Char_t sgn) 61 57 { … … 66 62 Double_t Slalib::Dms2Rad(Int_t deg, UInt_t min, Double_t sec, Char_t sgn) 67 63 { 68 / * pi/(180*3600): arcseconds to radians */64 // pi/(180*3600): arcseconds to radians 69 65 #define DAS2R 4.8481368110953599358991410235794797595635330237270e-6 70 66 return Hms2Sec(deg, min, sec, sgn)*DAS2R; … … 73 69 Double_t Slalib::Hms2Rad(Int_t hor, UInt_t min, Double_t sec, Char_t sgn) 74 70 { 75 / * pi/(12*3600): seconds of time to radians */71 // pi/(12*3600): seconds of time to radians 76 72 #define DS2R 7.2722052166430399038487115353692196393452995355905e-5 77 73 return Hms2Sec(hor, min, sec, sgn)*DS2R; … … 100 96 void Slalib::Day2Hms(Double_t day, Char_t &sgn, UShort_t &hor, UShort_t &min, UShort_t &sec) 101 97 { 102 / * Handle sign */98 // Handle sign 103 99 sgn = day<0?'-':'+'; 104 100 105 / * Round interval and express in smallest units required */101 // Round interval and express in smallest units required 106 102 Double_t a = Round(86400. * TMath::Abs(day)); // Days to seconds 107 103 108 / * Separate into fields */104 // Separate into fields 109 105 const Double_t ah = Trunc(a/3600.); 110 106 a -= ah * 3600.; … … 113 109 const Double_t as = Trunc(a); 114 110 115 / * Return results */111 // Return results 116 112 hor = (UShort_t)ah; 117 113 min = (UShort_t)am; … … 151 147 void Slalib::Day2Hm(Double_t day, Char_t &sgn, UShort_t &hor, Double_t &min) 152 148 { 153 / * Handle sign */149 // Handle sign 154 150 sgn = day<0?'-':'+'; 155 151 156 / * Round interval and express in smallest units required */152 // Round interval and express in smallest units required 157 153 Double_t a = Round(86400. * TMath::Abs(day)); // Days to seconds 158 154 159 / * Separate into fields */155 // Separate into fields 160 156 const Double_t ah = Trunc(a/3600.); 161 157 a -= ah * 3600.; 162 158 163 / * Return results */159 // Return results 164 160 hor = (UShort_t)ah; 165 161 min = a/60.; … … 196 192 } 197 193 194 */ -
trunk/MagicSoft/Cosy/catalog/Slalib.h
r2280 r2615 5 5 6 6 #include "coord.h" 7 #include " timer.h"7 #include "MTime.h" 8 8 #include "MObservatory.h" 9 9 10 class Slalib : public Timer, publicMObservatory10 class Slalib : public MObservatory 11 11 { 12 12 private: 13 MTime fTime; 14 13 15 double fAlpha; 14 16 … … 18 20 public: 19 21 Slalib(MObservatory::LocationName_t key); 20 virtual ~Slalib();21 22 static Double_t Hms2Sec(Int_t deg, UInt_t min, Double_t sec, char sgn='+');23 static Double_t Dms2Rad(Int_t deg, UInt_t min, Double_t sec, Char_t sgn='+');24 static Double_t Hms2Rad(Int_t hor, UInt_t min, Double_t sec, Char_t sgn='+');25 static Double_t Dms2Deg(Int_t deg, UInt_t min, Double_t sec, Char_t sgn='+');26 static Double_t Hms2Deg(Int_t hor, UInt_t min, Double_t sec, Char_t sgn='+');27 static Double_t Dms2Hor(Int_t deg, UInt_t min, Double_t sec, Char_t sgn='+');28 static Double_t Hms2Hor(Int_t hor, UInt_t min, Double_t sec, Char_t sgn='+');29 30 static void Day2Hms(Double_t rad, Char_t &sgn, UShort_t °, UShort_t &min, UShort_t &sec);31 static void Rad2Dms(Double_t rad, Char_t &sgn, UShort_t °, UShort_t &min, UShort_t &sec);32 static void Rad2Hms(Double_t rad, Char_t &sgn, UShort_t °, UShort_t &min, UShort_t &sec);33 static void Deg2Dms(Double_t rad, Char_t &sgn, UShort_t °, UShort_t &min, UShort_t &sec);34 static void Deg2Hms(Double_t rad, Char_t &sgn, UShort_t °, UShort_t &min, UShort_t &sec);35 static void Hor2Dms(Double_t rad, Char_t &sgn, UShort_t °, UShort_t &min, UShort_t &sec);36 static void Hor2Hms(Double_t rad, Char_t &sgn, UShort_t °, UShort_t &min, UShort_t &sec);37 38 static void Day2Hm(Double_t rad, Char_t &sgn, UShort_t °, Double_t &min);39 static void Rad2Dm(Double_t rad, Char_t &sgn, UShort_t °, Double_t &min);40 static void Rad2Hm(Double_t rad, Char_t &sgn, UShort_t °, Double_t &min);41 static void Deg2Dm(Double_t rad, Char_t &sgn, UShort_t °, Double_t &min);42 static void Deg2Hm(Double_t rad, Char_t &sgn, UShort_t °, Double_t &min);43 static void Hor2Dm(Double_t rad, Char_t &sgn, UShort_t °, Double_t &min);44 static void Hor2Hm(Double_t rad, Char_t &sgn, UShort_t °, Double_t &min);45 22 46 23 virtual void SetMjd(double mjd); 24 Double_t GetMjd() const { return fTime.GetMjd(); } 25 void Now() { fTime.Now(); } 26 const MTime &GetTime() const { return fTime; } 47 27 48 28 double GetAlpha() const { return fAlpha; } -
trunk/MagicSoft/Cosy/cosy.cc
r2568 r2615 7 7 8 8 #include "MCosy.h" 9 #include "MTime.h" 9 10 #include "MLogManip.h" 10 #include "base/timer.h"11 11 12 12 #include "Camera.h" … … 36 36 gLog << endl; 37 37 38 Timer time;39 time.Now();40 41 38 // 42 // this must move to MGCosy !!!! (or MApplication)39 // this must move to MGCosy !!!! 43 40 // 44 int i=0;45 char name[100];41 MTime time; 42 TString name; 46 43 while (1) 47 44 { 48 sprintf(name, "log/cosy%03d.log", i++); 45 time.Now(); 46 name = Form("log/cosy_%s.log", (const char*)time.GetFileName()); 47 cout << "Test: " << time.GetFileName() << " " << name << endl; 49 48 if (gSystem->AccessPathName(name, kFileExists)) 50 49 break; … … 70 69 // 71 70 clog("- Constructing MCosy."); 72 71 /* 73 72 // 74 73 // check for the right usage of the program … … 88 87 break; 89 88 } 90 91 MCosy *cosy = new MCosy( mode,"/dev/dpm_00", 125, lout);89 */ 90 MCosy *cosy = new MCosy("/dev/dpm_00", 125, lout); 92 91 93 92 clog("- Starting MCosy."); … … 134 133 135 134 cout << "The End." << endl; 136 137 135 } -
trunk/MagicSoft/Cosy/devdrv/macs.cc
r2613 r2615 4 4 #include <sys/time.h> // timeval->tv_sec 5 5 6 #include "timer.h"7 6 #include "network.h" 8 7 #include "MLogManip.h" … … 32 31 Macs::Macs(const BYTE_t nodeid, const char *name, MLog &out) 33 32 : NodeDrv(nodeid, name, out), fMacId(2*nodeid+1), 34 fPos(0), fP osTime(0.0), fPdoPos(0), fPdoTime(0.0),35 f PosActive(0), fRpmActive(0), fStatusPdo3(0xff)33 fPos(0), fPdoPos(0), fPosActive(0), fRpmActive(0), 34 fStatusPdo3(0xff) 36 35 { 37 36 // fTimeout = new TTimer(this, 100); //, kFALSE); // 100ms, asynchronous … … 87 86 // lout << "Actual Position: " << dec << (signed long)val << endl; 88 87 fPos = (LWORDS_t)val; 89 fPosTime.Set Timer(tv);88 fPosTime.Set(*tv); 90 89 return; 91 90 /* … … 576 575 fStatus = data[3]; 577 576 578 fPdoTime.Set Timer(tv);577 fPdoTime.Set(*tv); 579 578 } 580 579 … … 735 734 return; 736 735 737 Timertime;736 MTime time; 738 737 time.Now(); 739 738 … … 811 810 } 812 811 813 double Macs::GetTime()814 {815 return fPosTime.Now();816 }817 818 double Macs::GetMjd()819 {820 return fPosTime.GetMjd();821 }822 823 double Macs::GetPdoTime()824 {825 return fPdoTime.Now();826 }827 828 double Macs::GetPdoMjd()829 {830 return fPdoTime.GetMjd();831 }832 833 812 /* 0x2000 0 rw Maximum positioning error */ 834 813 /* 1 rw Negative Software Endswitch */ -
trunk/MagicSoft/Cosy/devdrv/macs.h
r2280 r2615 3 3 4 4 #include "nodedrv.h" 5 #include " base/timer.h"5 #include "MTime.h" 6 6 7 7 class Macs : public NodeDrv … … 16 16 17 17 LWORDS_t fPos; 18 TimerfPosTime;18 MTime fPosTime; 19 19 20 20 LWORD_t fRes; // Encoder resolution 21 21 22 22 LWORDS_t fPdoPos; 23 TimerfPdoTime;23 MTime fPdoTime; 24 24 25 25 BYTE_t fPosActive; … … 106 106 BYTE_t GetStatus() const { return fStatus; } 107 107 108 double GetTime();109 double GetMjd();110 111 double GetPdoTime();112 double GetPdoMjd();113 114 108 LWORDS_t GetPdoPos() const { return fPdoPos; } 115 109 -
trunk/MagicSoft/Cosy/devdrv/shaftencoder.cc
r2518 r2615 1 1 #include "shaftencoder.h" 2 2 3 #include "base/timer.h"4 3 #include "network.h" 5 4 … … 182 181 183 182 fPos = pos; 184 fTime.Set Timer(tv);183 fTime.Set(*tv); 185 184 fPosHasChanged = true; 186 185 } … … 198 197 199 198 fPos=pos; 200 fTime.Set Timer(tv);199 fTime.Set(*tv); 201 200 fPosHasChanged=true; 202 201 … … 234 233 fTurn = turn; 235 234 236 fTime.Set Timer(tv);235 fTime.Set(*tv); 237 236 fPosHasChanged=true; 238 }239 240 double ShaftEncoder::GetTime()241 {242 return fTime.Now();243 237 } 244 238 -
trunk/MagicSoft/Cosy/devdrv/shaftencoder.h
r2518 r2615 2 2 #define SHAFTENCODER_H 3 3 4 #include "base/timer.h"5 4 #include "nodedrv.h" 5 #include "MTime.h" 6 6 7 7 class TGLabel; … … 24 24 bool fPosHasChanged; //! 25 25 26 TimerfTime;26 MTime fTime; 27 27 28 28 void HandlePDOType0(BYTE_t *data, timeval_t *tv); … … 54 54 LWORD_t GetPhysRes() { return fTicks; } 55 55 56 double GetTime();57 56 double GetMjd(); 58 57 -
trunk/MagicSoft/Cosy/gui/MGCosy.cc
r2518 r2615 22 22 #include <TApplication.h> // gApplication 23 23 24 //#include "timer.h" // Timer25 26 24 #include "MCosy.h" 25 #include "MTime.h" 26 #include "MAstro.h" 27 27 #include "MGList.h" 28 28 #include "MDriveCom.h" … … 365 365 box->AddEntry(str, i++); 366 366 367 fStarList.Add( Slalib::Hms2Hor(h, m, s), Slalib::Dms2Deg(d, am, as));367 fStarList.Add(MAstro::Hms2Hor(h, m, s), MAstro::Dms2Deg(d, am, as)); 368 368 } 369 369 } … … 889 889 890 890 // Calculate Display values 891 Slalib::Rad2Hm(rd.Ra(), sh, h, hm);892 Slalib::Rad2Dm(rd.Dec(), sd, d, dm);891 MAstro::Rad2Hm(rd.Ra(), sh, h, hm); 892 MAstro::Rad2Dm(rd.Dec(), sd, d, dm); 893 893 894 894 rd.Ra(rd.Ra() * 12/TMath::Pi()); … … 922 922 923 923 // Calculate display values 924 Slalib::Hor2Hm(radec.Ra(), sh, h, hm);925 Slalib::Deg2Dm(radec.Dec(), sd, d, dm);924 MAstro::Hor2Hm(radec.Ra(), sh, h, hm); 925 MAstro::Deg2Dm(radec.Dec(), sd, d, dm); 926 926 927 927 test = radec*600; … … 974 974 Char_t sz, sa; 975 975 976 Slalib::Rad2Dm(soll.Zd(), sz, z, zm);977 Slalib::Rad2Dm(soll.Az(), sa, a, am);976 MAstro::Rad2Dm(soll.Zd(), sz, z, zm); 977 MAstro::Rad2Dm(soll.Az(), sa, a, am); 978 978 979 979 const ZdAz test = soll*kRad2Deg*600; … … 994 994 double MGCosy::UpdateTime() 995 995 { 996 Timertime;996 MTime time; 997 997 time.Now(); 998 998 999 static char oldtxt[256]; 1000 1001 char text[256]; 1002 1003 strcpy(text, time.GetTimeStr()); 1004 1005 char *dot = strrchr(text, '.'); 1006 1007 if (dot) 1008 dot[2] = 0; 1009 1010 if (strcmp(oldtxt, text)) 999 static TString oldtxt; 1000 1001 TString text(time.GetString()); 1002 text.Remove(text.Last('.')+2); 1003 1004 if (text!=oldtxt) 1011 1005 { 1012 1006 fUtc->SetText(new TGString(text)); 1013 strcpy(oldtxt, text); 1014 } 1015 1016 static long oldmjd; 1017 double mjd = time.GetMjd(); 1018 1019 if (oldmjd != 1000000*mjd) 1020 { 1021 sprintf(text, "%12.6f", mjd); 1022 fMjd->SetText(new TGString(text)); 1023 1024 oldmjd = (long)(1000000*mjd); 1007 oldtxt = text; 1008 } 1009 1010 static ULong_t oldmjd=0; 1011 const double mjd = time.GetMjd(); 1012 1013 if (oldmjd != (ULong_t)(1000000*mjd)) 1014 { 1015 fMjd->SetText(new TGString(Form("%12.6f", mjd))); 1016 oldmjd = (ULong_t)(1000000*mjd); 1025 1017 } 1026 1018 … … 1034 1026 acc *= kRad2Deg; // [deg] 1035 1027 1036 double mjd = UpdateTime();1028 const double mjd = UpdateTime(); 1037 1029 fSkyPosition->Update(pos, mjd); 1038 1030 //UpdateOffset(off); … … 1205 1197 while (i-->0) 1206 1198 { 1207 Timer tm;1208 tm.Now();1199 //Timer tm; 1200 //tm.Now(); 1209 1201 1210 1202 if (!Move(75, -80, 1000000, 13)) … … 1386 1378 UShort_t d, m, s; 1387 1379 Char_t sgn; 1388 Slalib::Deg2Dms(za.X(), sgn, d, m, s);1380 MAstro::Deg2Dms(za.X(), sgn, d, m, s); 1389 1381 if (sgn=='-') fout << sgn; 1390 1382 fout << d << " " << m << " " << s << " \t"; 1391 Slalib::Deg2Dms(za.Y(), sgn, d, m, s);1383 MAstro::Deg2Dms(za.Y(), sgn, d, m, s); 1392 1384 if (sgn=='-') fout << sgn; 1393 1385 fout << d << " " << m << " " << s << " \t"; -
trunk/MagicSoft/Cosy/gui/MGPngReader.cc
r1816 r2615 25 25 #include "CaosFilter.h" 26 26 #include "Writer.h" 27 #include " base/timer.h"27 #include "MTime.h" 28 28 29 29 #include "MStarList.h" … … 1022 1022 // Double_t kConv = 0.502; // [pix/mm] 1023 1023 1024 static Timer t0(tm);1025 Timer t(tm);1026 1027 fTime = (t.GetMjd()-t0.GetMjd())*24*60*60;1024 static MTime t0(*tm); 1025 MTime t(*tm); 1026 1027 fTime = t-t0; 1028 1028 1029 1029 Leds leds; … … 1098 1098 if (fDisplay->IsEntryChecked(IDM_kCatalog)) 1099 1099 { 1100 Timer time(tm);1100 MTime time(*tm); 1101 1101 1102 1102 GetCoordinates(); -
trunk/MagicSoft/Cosy/gui/MGSkyPosition.cc
r2280 r2615 16 16 17 17 #include "coord.h" 18 #include "MAstro.h" 18 19 #include "SlaStars.h" 19 20 #include "SlaPlanets.h" … … 113 114 { 114 115 // 32349 Sirius -1.44 1.45 2.64 0.009 A0m 115 (RaDec( Slalib::Hms2Rad( 6, 45, 0), Slalib::Dms2Rad(-16, 42, 0))),116 (RaDec(MAstro::Hms2Rad( 6, 45, 0), MAstro::Dms2Rad(-16, 42, 0))), 116 117 // 30438 Canopus -0.62 -5.53 95.88 0.164 F0Ib 117 (RaDec( Slalib::Hms2Rad( 6, 23, 0), Slalib::Dms2Rad(-52, 41, 0))),118 (RaDec(MAstro::Hms2Rad( 6, 23, 0), MAstro::Dms2Rad(-52, 41, 0))), 118 119 // 69673 Arcturus -0.05 -0.31 11.25 1.239 K2IIIp 119 (RaDec( Slalib::Hms2Rad( 14, 15, 0), Slalib::Dms2Rad( 19, 10, 0))),120 (RaDec(MAstro::Hms2Rad( 14, 15, 0), MAstro::Dms2Rad( 19, 10, 0))), 120 121 // Vega 0.03 121 (RaDec( Slalib::Hms2Rad( 18, 37, 0), Slalib::Dms2Rad( 38, 47, 0))),122 (RaDec(MAstro::Hms2Rad( 18, 37, 0), MAstro::Dms2Rad( 38, 47, 0))), 122 123 // Altair 0.77 123 (RaDec( Slalib::Hms2Rad( 19, 50, 0), Slalib::Dms2Rad( 8, 52, 6))),124 (RaDec(MAstro::Hms2Rad( 19, 50, 0), MAstro::Dms2Rad( 8, 52, 6))), 124 125 // Antares 0.96 125 (RaDec( Slalib::Hms2Rad( 16, 29, 25), Slalib::Dms2Rad(-26, 25, 55))),126 (RaDec(MAstro::Hms2Rad( 16, 29, 25), MAstro::Dms2Rad(-26, 25, 55))), 126 127 // Spica 0.98 127 (RaDec( Slalib::Hms2Rad( 13, 25, 13), Slalib::Dms2Rad(-11, 9, 41))),128 (RaDec(MAstro::Hms2Rad( 13, 25, 13), MAstro::Dms2Rad(-11, 9, 41))), 128 129 // Deneb 1.25 129 (RaDec( Slalib::Hms2Rad( 20, 41, 26), Slalib::Dms2Rad( 45, 16, 49))),130 (RaDec( Slalib::Hms2Rad( 1, 37, 6), Slalib::Dms2Rad(-57, 14, 0))),131 (RaDec( Slalib::Hms2Rad( 12, 26, 6), Slalib::Dms2Rad(-63, 06, 0))),132 (RaDec( Slalib::Hms2Rad( 5, 14, 0), Slalib::Dms2Rad(- 8, 12, 5))),133 (RaDec( Slalib::Hms2Rad( 5, 16, 0), Slalib::Dms2Rad( 46, 00, 0))),134 (RaDec( Slalib::Hms2Rad( 7, 39, 0), Slalib::Dms2Rad( 5, 14, 0))),135 (RaDec( Slalib::Hms2Rad( 5, 55, 0), Slalib::Dms2Rad( 7, 24, 0)))130 (RaDec(MAstro::Hms2Rad( 20, 41, 26), MAstro::Dms2Rad( 45, 16, 49))), 131 (RaDec(MAstro::Hms2Rad( 1, 37, 6), MAstro::Dms2Rad(-57, 14, 0))), 132 (RaDec(MAstro::Hms2Rad( 12, 26, 6), MAstro::Dms2Rad(-63, 06, 0))), 133 (RaDec(MAstro::Hms2Rad( 5, 14, 0), MAstro::Dms2Rad(- 8, 12, 5))), 134 (RaDec(MAstro::Hms2Rad( 5, 16, 0), MAstro::Dms2Rad( 46, 00, 0))), 135 (RaDec(MAstro::Hms2Rad( 7, 39, 0), MAstro::Dms2Rad( 5, 14, 0))), 136 (RaDec(MAstro::Hms2Rad( 5, 55, 0), MAstro::Dms2Rad( 7, 24, 0))) 136 137 }; 137 138 … … 334 335 Char_t sx, sy; 335 336 Double_t xm, ym; 336 Slalib::Deg2Dm(x, sx, xd, xm);337 Slalib::Deg2Dm(y, sy, yd, ym);337 MAstro::Deg2Dm(x, sx, xd, xm); 338 MAstro::Deg2Dm(y, sy, yd, ym); 338 339 339 340 const int fx = (int)(x*600); -
trunk/MagicSoft/Cosy/gui/MGTPoint.cc
r1692 r2615 18 18 #include "Filter.h" 19 19 #include "Writer.h" 20 #include " base/timer.h"20 #include "MTime.h" 21 21 22 22 ClassImp(MGStarguider); … … 397 397 GetCoordinates(); 398 398 399 Timer time(tm);399 MTime time(*tm); 400 400 fSao->GetImg(myimg, cimg, time.CalcMjd(), *fRaDec); 401 401 fImage->DrawColImg(myimg, cimg); -
trunk/MagicSoft/Cosy/main/MBending.cc
r2568 r2615 65 65 #include <TMinuit.h> 66 66 67 #include " timer.h"67 #include "MTime.h" 68 68 69 69 ClassImp(MBending); … … 262 262 } 263 263 264 Timert;264 MTime t; 265 265 t.Now(); 266 266 267 fout << "MAGIC1 " << t .GetTimeStr()<< endl;267 fout << "MAGIC1 " << t << endl; 268 268 fout << "S 00 000000 000000 0000000" << endl; 269 269 fout << setprecision(8); … … 285 285 } 286 286 287 AltAz MBending::AddOffsets(const AltAz &aa) const 288 { 289 // Correct [rad] 290 // zdaz [rad] 291 AltAz p = aa; 292 293 const AltAz I(fIe, fIa); 294 p += I; 295 296 return p; 297 } 298 299 AltAz MBending::SubtractOffsets(const AltAz &aa) const 300 { 301 // Correct [rad] 302 // zdaz [rad] 303 AltAz p = aa; 304 305 const AltAz I(fIe, fIa); 306 p -= I; 307 308 return p; 309 } 310 311 AltAz MBending::CalcAnAw(const AltAz &p, Int_t sign) const 312 { 313 // Corrections for AN and AW without approximations 314 // as done by Patrick Wallace. The approximation cannot 315 // be used for MAGIC because the correctioon angle 316 // AW (~1.5deg) is not small enough. 317 318 // Vector in cartesian coordinates 319 TVector3 v(1., 1., 1.); 320 321 // Set Azimuth and Elevation 322 v.SetPhi(p.Az()); 323 v.SetTheta(TMath::Pi()/2-p.Alt()); 324 325 // Rotate around the x- and y-axis 326 v.RotateY(sign*fAn); 327 v.RotateX(sign*fAw); 328 329 // Calculate Delta Azimuth and Delta Elevation 330 AltAz d(TMath::Pi()/2-v.Theta(), v.Phi()); 331 d -= p; 332 d *= sign; 333 334 // Fix 'direction' of output depending on input vector 335 if (sign*p.Alt()>TMath::Pi()/2) 336 d.Alt(d.Alt()-TMath::Pi()); 337 338 // Align correction into [-180,180] 339 while (d.Az()>TMath::Pi()) 340 d.Az(d.Az()-TMath::Pi()*2); 341 while (d.Az()<-TMath::Pi()) 342 d.Az(d.Az()+TMath::Pi()*2); 343 344 return d; 345 } 346 347 287 348 AltAz MBending::Correct(const AltAz &aa) const 288 349 { … … 350 411 DEBUG(cout << "Bend2: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl); 351 412 352 // New Corrections for AW and AN: 353 TVector3 v2(1.,1.,1.); // Vector in cartesian coordinates 354 // Set Azimuth and Elevation 355 v2.SetPhi(p.Az()); 356 v2.SetTheta(TMath::Pi()/2-p.Alt()); 357 // Rotate around the x- and y-axis 358 v2.RotateX(fAw); 359 v2.RotateY(fAn); 360 // Get Azimuth and Elevation 361 p.Az(v2.Phi()); 362 p.Alt(TMath::Pi()/2-v2.Theta()); 363 364 /* 365 // Old correction terms for An and Aw: 366 cout << fAw << " " << cos(p.Az()) << " " << tan(p.Alt()) << endl; 367 cout << fAw* cos(p.Az())*tan(p.Alt())*180/3.1415 << endl; 368 369 const AltAz AW( fAw*sin(p.Az()), -fAw*cos(p.Az())*tan(p.Alt())); 370 const AltAz AN(-fAn*cos(p.Az()), -fAn*sin(p.Az())*tan(p.Alt())); 371 p += AW; 372 p += AN; 413 const AltAz ANAW(CalcAnAw(p, -1)); 414 p += ANAW; 415 416 /* Old correction terms for An and Aw: 417 const AltAz AW( fAw*sin(p.Az()), -fAw*cos(p.Az())*tan(p.Alt())); 418 const AltAz AN(-fAn*cos(p.Az()), -fAn*sin(p.Az())*tan(p.Alt())); 419 p += AW; 420 p += AN; 373 421 */ 374 375 376 377 422 378 423 DEBUG(cout << "Bend1: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl); … … 389 434 } 390 435 391 AltAz MBending:: AddOffsets(const AltAz &aa) const436 AltAz MBending::CorrectBack(const AltAz &aa) const 392 437 { 393 438 // Correct [rad] … … 395 440 AltAz p = aa; 396 441 397 const AltAz I(fIe, fIa);398 p += I;399 400 return p;401 }402 403 AltAz MBending::CorrectBack(const AltAz &aa) const404 {405 // Correct [rad]406 // zdaz [rad]407 AltAz p = aa;408 409 442 DEBUG(cout << setprecision(16)); 410 443 DEBUG(cout << "Back0: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl); … … 418 451 DEBUG(cout << "Back1: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl); 419 452 420 /* 421 //Old correction terms for An and Aw: 453 /* Old correction terms for An and Aw: 422 454 const AltAz AN(-fAn*cos(p.Az()), -fAn*sin(p.Az())*tan(p.Alt())); 423 455 const AltAz AW( fAw*sin(p.Az()), -fAw*cos(p.Az())*tan(p.Alt())); … … 426 458 */ 427 459 428 // New Corrections for AN and AW: 429 TVector3 v(1.,1.,1.); // Vector in cartesian coordinates 430 // Set Azimuth and Elevation 431 v.SetPhi(p.Az()); 432 v.SetTheta(TMath::Pi()/2-p.Alt()); 433 // Rotate around the x- and y-axis 434 v.RotateY(-fAn); 435 v.RotateX(-fAw); 436 // Get Azimuth and Elevation 437 p.Az(v.Phi()); 438 p.Alt(TMath::Pi()/2-v.Theta()); 439 460 const AltAz ANAW(CalcAnAw(p, -1)); 461 p -= ANAW; 440 462 441 463 DEBUG(cout << "Back2: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl); … … 498 520 } 499 521 500 AltAz MBending::SubtractOffsets(const AltAz &aa) const501 {502 // Correct [rad]503 // zdaz [rad]504 AltAz p = aa;505 506 const AltAz I(fIe, fIa);507 p -= I;508 509 return p;510 }511 512 513 522 ZdAz MBending::Correct(const ZdAz &zdaz) const 514 523 { -
trunk/MagicSoft/Cosy/main/MBending.h
r2518 r2615 53 53 54 54 static Double_t Sign(Double_t val, Double_t alt); 55 AltAz CalcAnAw(const AltAz &p, Int_t sign) const; 55 56 56 57 public: -
trunk/MagicSoft/Cosy/main/MCaos.cc
r2280 r2615 12 12 #include <TCanvas.h> 13 13 14 #include "MTime.h" 15 14 16 #include "Led.h" 15 17 #include "Ring.h" … … 18 20 19 21 #include "coord.h" 20 #include "base/timer.h"21 22 22 23 void MCaos::ReadResources(const char *name="leds.txt") … … 306 307 } 307 308 308 void MCaos::Run(byte *img, bool printl, bool printr, const ZdAz &pos, const Timer&t)309 void MCaos::Run(byte *img, bool printl, bool printr, const ZdAz &pos, const MTime &t) 309 310 { 310 311 Leds &leds = *fLeds; … … 354 355 355 356 // FIXME! 356 static const Timert0(t);357 fEvtTime = (double)t-(double)t0;357 static const MTime t0(t); 358 fEvtTime = t-t0; 358 359 359 360 if (fHistpr) -
trunk/MagicSoft/Cosy/main/MCaos.h
r2278 r2615 15 15 class TGraph; 16 16 17 class Timer;17 class MTime; 18 18 class ZdAz; 19 19 … … 68 68 void ResetHistograms(); 69 69 70 void Run(byte *img, bool printl, bool printr, const ZdAz &pos, const Timer&t);70 void Run(byte *img, bool printl, bool printr, const ZdAz &pos, const MTime &t); 71 71 }; 72 72 -
trunk/MagicSoft/Cosy/main/MCosy.cc
r2613 r2615 18 18 19 19 #include "MGCosy.h" 20 #include "MTime.h" 20 21 #include "MDriveCom.h" 21 22 #include "MStarguider.h" … … 25 26 26 27 #include "macs.h" 27 #include "base/timer.h"28 28 #include "shaftencoder.h" 29 29 … … 341 341 return; 342 342 343 Timert;343 MTime t; 344 344 t.Now(); 345 345 lout << t << " - MCosy::WaitForEndMovement aborted..."; … … 449 449 const ZdAz d = dst*kRad2Deg; 450 450 451 Timert;451 MTime t; 452 452 t.Now(); 453 453 lout << t << " - Target Position: " << d.Zd() << "deg, " << d.Az() << "deg (Zd/Az)" << endl; … … 958 958 959 959 sla.Now(); 960 lout << sla << " - Start tracking:";960 lout << sla.GetTime() << " - Start tracking:"; 961 961 lout << " Ra: " << xy.X() << "h " << "Dec: " << xy.Y() << "\xb0" << endl; 962 962 /*#ifdef EXPERT … … 1105 1105 StopMovement(); 1106 1106 1107 lout << sla << " - Tracking stopped." << endl;1107 lout << sla.GetTime() << " - Tracking stopped." << endl; 1108 1108 } 1109 1109 … … 2184 2184 fWin=new MGCosy(fObservatory, this, gClient->GetRoot(), 1, 1); 2185 2185 } 2186 2186 /* 2187 2187 void MCosy::ConstructorSE(Int_t id4, Int_t id5, Int_t id6) 2188 2188 { … … 2231 2231 fWin=new MGCosy(fObservatory, this, gClient->GetRoot(), 1, 1); 2232 2232 } 2233 2234 MCosy::MCosy( int mode,const char *dev, const int baud, MLog &out)2233 */ 2234 MCosy::MCosy(/*int mode,*/ const char *dev, const int baud, MLog &out) 2235 2235 : Network(dev, baud, out), fObservatory(MObservatory::kMagic1), fStarguider(NULL), fZd1(0), fZd2(0), fAz(0), fMac1(0), fMac2(0), fMac3(0), fBackground(kBgdNone), fStatus(MDriveCom::kStopped) 2236 2236 { … … 2242 2242 const Int_t id5 = env.GetValue("Zd_Id-SE2", 5); //5 2243 2243 const Int_t id6 = env.GetValue("Az_Id-SE", 6); //6 2244 2244 /* 2245 2245 lout << "- Program in "; 2246 2246 switch (mode) 2247 2247 { 2248 2248 case 0: 2249 lout << "<<Standard mode>>" << endl; 2249 lout << "<<Standard mode>>" << endl;*/ 2250 2250 fBending.Load("bending.txt"); 2251 Constructor(id1, id2, id3, id4, id5, id6); 2251 Constructor(id1, id2, id3, id4, id5, id6);/* 2252 2252 break; 2253 2253 case 1: … … 2260 2260 ConstructorDemo(); 2261 2261 } 2262 2262 */ 2263 2263 lout.SetOutputGui(fWin->GetLog(), kTRUE); 2264 2264 … … 2267 2267 fAz->SetDisplay(fWin->GetLabel1()); 2268 2268 2269 int i=0; 2270 char name[100]; 2269 // 2270 // open tpoint file 2271 // 2272 MTime time; 2273 TString name; 2271 2274 while (1) 2272 2275 { 2273 sprintf(name, "tpoint/tpoint%03d.txt", i++); 2276 time.Now(); 2277 name = Form("tpoint/tpoint_%s.txt", (const char*)time.GetFileName()); 2274 2278 if (gSystem->AccessPathName(name, kFileExists)) 2275 2279 break; 2276 2280 } 2277 2278 Timer time;2279 time.Now();2280 2281 2281 2282 cout << "TPoint File ********* " << name << " ********** " << endl; -
trunk/MagicSoft/Cosy/main/MCosy.h
r2518 r2615 168 168 169 169 void Constructor(Int_t id1, Int_t id2, Int_t id3, Int_t id4, Int_t id5, Int_t id6); 170 void ConstructorSE(Int_t id1, Int_t id2, Int_t id3);171 void ConstructorDemo();170 //void ConstructorSE(Int_t id1, Int_t id2, Int_t id3); 171 //void ConstructorDemo(); 172 172 173 173 void ReadConfig(); … … 176 176 177 177 public: 178 MCosy( int mode,const char *dev, const int baud, MLog &out=gLog);178 MCosy(/*int mode,*/ const char *dev, const int baud, MLog &out=gLog); 179 179 ~MCosy(); 180 180 -
trunk/MagicSoft/Cosy/main/MStarguider.cc
r2613 r2615 839 839 static unsigned long n0 = n; 840 840 841 Timer t(tm);841 MTime t(*tm); 842 842 843 843 const Double_t d = t-fTime; … … 894 894 if (fDisplay->IsEntryChecked(IDM_kCatalog)) 895 895 { 896 Timer time(tm);896 MTime time(*tm); 897 897 898 898 XY xy = fCRaDec->GetCoordinates(); … … 934 934 if (fDisplay->IsEntryChecked(IDM_kCatalog)) 935 935 { 936 // FIXME: Necessary? 936 937 fSao->Now(); 937 938 AltAz aa = fSao->CalcAltAzFromPix(fDx, fDy)*kRad2Deg; -
trunk/MagicSoft/Cosy/main/MStarguider.h
r2278 r2615 5 5 #include <TGFrame.h> 6 6 #endif 7 7 8 #include "PixClient.h" 9 8 10 #ifndef MARS_MObservatory 9 11 #include "MObservatory.h" 12 #endif 13 14 #ifndef MARS_MTime 15 #include "MTime.h" 10 16 #endif 11 17 … … 14 20 15 21 #include "coord.h" 16 #include "timer.h"17 22 18 23 class TArrayF; … … 76 81 77 82 TTimer *fTimer; 78 TimerfTime;83 MTime fTime; 79 84 80 85 Int_t fDx; -
trunk/MagicSoft/Cosy/tcpip/MCeCoCom.cc
r2517 r2615 26 26 str.Remove(0, len); 27 27 28 fT.Set Timer(y, m, d, h, min, s, ms/1000.);28 fT.Set(y, m, d, h, min, s, ms); 29 29 30 30 // Remove the 30 tokens of the subsystem status … … 88 88 bool MCeCoCom::Send(const char *str) 89 89 { 90 Timert;90 MTime t; 91 91 t.Now(); 92 93 UShort_t y1, y2, ms1, ms2; 94 Byte_t mon1, mon2, d1, d2, h1, h2, m1, m2, s1, s2; 95 96 t.GetDate(y1, mon1, d1); 97 t.GetTime(h1, m1, s1, ms1); 98 99 fT.GetDate(y2, mon2, d2); 100 fT.GetTime(h2, m2, s2, ms2); 92 101 93 102 const char *msg = … … 96 105 "%02d %04d %02d %02d %02d %02d %02d %03d " 97 106 "%s\n", (const char*)fCommand, 98 fStatus, t.Year(), t.Month(), t.Day(), t.H(), t.M(), t.S(), t.MilliSec(),99 fComStat, fT.Year(), fT.Month(), fT.Day(), fT.H(), fT.M(), fT.S(), fT.MilliSec(),107 fStatus, y1, mon1, d1, h1, m1, s1, ms1, 108 fComStat, y2, mon2, d2, h2, m2, s2, ms2, 100 109 str); 101 110 -
trunk/MagicSoft/Cosy/tcpip/MCeCoCom.h
r2517 r2615 10 10 #endif 11 11 12 #ifndef COSY_Timer13 #include " timer.h"12 #ifndef MARS_MTime 13 #include "MTime.h" 14 14 #endif 15 15 … … 25 25 26 26 TString fCommand; // report string of the current system 27 TimerfT; // time of last report received27 MTime fT; // time of last report received 28 28 char fStatus; // current status of this system 29 29 int fCCStatus; // global status of CC -
trunk/MagicSoft/Cosy/tcpip/MDriveCom.cc
r2613 r2615 4 4 5 5 #include "coord.h" 6 #include " Slalib.h"6 #include "MAstro.h" 7 7 #include "MCosy.h" 8 8 … … 24 24 str.Remove(0, len); 25 25 26 ret = Slalib::Dms2Deg(d, m, s, sgn);26 ret = MAstro::Dms2Deg(d, m, s, sgn); 27 27 return true; 28 28 } … … 137 137 UShort_t d, m, s; 138 138 139 Slalib::Deg2Dms(deg, sgn, d, m, s);139 MAstro::Deg2Dms(deg, sgn, d, m, s); 140 140 141 141 str += Form("%c %03d %02d %03d ", sgn, d, m, s); … … 161 161 SetStatus(4); 162 162 163 Timert;163 MTime t; 164 164 t.Now(); 165 165 -
trunk/MagicSoft/Cosy/videodev/Writer.cc
r1953 r2615 7 7 #include <png.h> 8 8 9 #include " base/timer.h"9 #include "MTime.h" 10 10 11 11 ClassImp(Writer); … … 14 14 struct timeval *date) 15 15 { 16 Timer t(date);16 MTime t(*date); 17 17 TString mjd; 18 18 mjd += t.GetMjd()-52000; … … 129 129 TString name = fname; 130 130 131 Timer t(date);131 MTime t(*date); 132 132 133 133 name += "_";
Note:
See TracChangeset
for help on using the changeset viewer.