Changeset 1109 for trunk/MagicSoft
- Timestamp:
- 12/12/01 13:09:24 (23 years ago)
- Location:
- trunk/MagicSoft
- Files:
-
- 35 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/base/coord.h
r921 r1109 4 4 #include <math.h> // floor 5 5 6 #include "slalib/slamac.h" // D2PI 6 /* pi/180: degrees to radians */ 7 const double kDeg2Rad = 0.017453292519943295769236907684886127134428718885417; 8 9 /* 180/pi: radians to degrees */ 10 const double kRad2Deg = 57.295779513082320876798154814105170332405472466564; 11 12 /* pi/2: 90 degrees in radians */ 13 const double kPiDiv2 = 1.5707963267948966192313216916397514420985846996876; 14 15 /* 2pi */ 16 const double k2Pi = 6.2831853071795864769252867665590057683943387987502; 7 17 8 18 class Deg … … 19 29 double operator()() { return fDeg; } 20 30 21 operator double() const { return fDeg* D2PI/360.0; }31 operator double() const { return fDeg*kDeg2Rad; } 22 32 }; 23 33 … … 118 128 inline double Rad2Deg(double rad) 119 129 { 120 return 360.0/D2PI*rad;130 return kRad2Deg*rad; 121 131 } 122 132 123 133 inline double Deg2Rad(double rad) 124 134 { 125 return D2PI/360.0*rad;135 return kDeg2Rad*rad; 126 136 } 127 137 #endif -
trunk/MagicSoft/Cosy/base/msgqueue.h
r909 r1109 2 2 #define MSGQUEUE_H 3 3 4 #include <pthread.h>4 #include "threads.h" 5 5 6 6 #define WM_NULL 0x0000 -
trunk/MagicSoft/Cosy/base/timer.h
r926 r1109 2 2 #define TIMER_H 3 3 4 #include <unistd.h> // gettimeofday 4 struct timeval; 5 5 6 6 class Timer -
trunk/MagicSoft/Cosy/candrv/CandrvLinkDef.h
r920 r1109 5 5 #pragma link off all functions; 6 6 7 #pragma link C++ class VmodIcan+; 8 #pragma link C++ class CanOpen+; 9 #pragma link C++ class Network+; 10 11 #pragma link C++ class NodeDrv+; 12 13 #pragma link C++ class PendingSDO+; 14 #pragma link C++ class PendingSDOList+; 15 7 16 #endif -
trunk/MagicSoft/Cosy/candrv/Makefile
r910 r1109 31 31 .SUFFIXES: .c .cc .cxx .h .hxx .o 32 32 33 SRCFILES = canopen.cc \ 34 network.cc \ 33 SRCFILES = vmodican.cc \ 34 sdolist.cc \ 35 canopen.cc \ 35 36 nodedrv.cc \ 36 sdolist.cc \ 37 vmodican.cc 37 network.cc 38 38 39 39 SRCS = $(SRCFILES) 40 40 HEADERS = $(SRCFILES:.cc=.h) 41 41 OBJS = $(SRCFILES:.cc=.o) 42 CINTHEADERS = $(HEADERS) 42 43 43 44 ############################################################ -
trunk/MagicSoft/Cosy/candrv/canopen.cc
r926 r1109 3 3 #include <iostream.h> // cout 4 4 #include <iomanip.h> // setw, setfill 5 6 ClassImp(CanOpen); 5 7 6 8 CanOpen::CanOpen(const char *dev, const int baud, MLog &out) : VmodIcan(dev, baud, out) -
trunk/MagicSoft/Cosy/candrv/network.cc
r920 r1109 3 3 #include <iostream.h> // cout 4 4 #include <iomanip.h> // setw, setfill 5 6 ClassImp(Network); 5 7 6 8 void Network::Start() -
trunk/MagicSoft/Cosy/candrv/network.h
r920 r1109 32 32 33 33 bool HasError() const; 34 35 ClassDef(Network, 0) 34 36 }; 35 37 -
trunk/MagicSoft/Cosy/candrv/nodedrv.cc
r926 r1109 6 6 #include "network.h" 7 7 #include "MLogManip.h" 8 9 ClassImp(NodeDrv); 8 10 9 11 NodeDrv::NodeDrv(BYTE_t nodeid, const char *name, MLog &out) : Log(out), fNetwork(NULL), fId(32), fError(0) -
trunk/MagicSoft/Cosy/candrv/nodedrv.h
r926 r1109 3 3 4 4 #include "log.h" 5 6 #ifdef __CINT__ 7 typedef Byte_t BYTE_t; 8 typedef UShort_t WORD_t; 9 typedef Short_t WORDS_t; 10 typedef UInt_t LWORD_t; 11 typedef Int_t LWORDS_t; 12 struct timeval; 13 #else 5 14 #include "gendef.h" 15 #endif 6 16 7 17 class Network; … … 72 82 73 83 void EnableCanMsg(BYTE_t fcode); 84 85 ClassDef(NodeDrv, 0) 74 86 }; 75 87 -
trunk/MagicSoft/Cosy/candrv/sdolist.cc
r909 r1109 2 2 3 3 #include <iostream.h> 4 5 ClassImp(PendingSDO); 6 ClassImp(PendingSDOList); 4 7 5 8 PendingSDOList::PendingSDOList() -
trunk/MagicSoft/Cosy/candrv/sdolist.h
r909 r1109 2 2 #define SDOLIST_H 3 3 4 #ifdef __CINT__ 5 struct pthread_mutex_t; 6 #else 4 7 #include <pthread.h> 8 #endif 5 9 10 #ifdef __CINT__ 11 typedef Byte_t BYTE_t; 12 typedef UShort_t WORD_t; 13 #else 14 #include <TROOT.h> 6 15 #include "gendef.h" 16 #endif 7 17 8 18 class PendingSDO … … 16 26 PendingSDO(BYTE_t n=0, WORD_t i=0, BYTE_t s=0) 17 27 : Node(n), Idx(i), Subidx(s), Next(NULL) {} 28 29 ClassDef(PendingSDO, 0) 18 30 }; 19 31 … … 28 40 public: 29 41 PendingSDOList(); 30 ~PendingSDOList();42 virtual ~PendingSDOList(); 31 43 32 44 void Add(BYTE_t node, WORD_t idx, BYTE_t subidx); … … 37 49 int IsPending(BYTE_t node); 38 50 int IsPending(BYTE_t node, WORD_t idx, BYTE_t subidx); 51 52 ClassDef(PendingSDOList, 0) 39 53 }; 40 54 -
trunk/MagicSoft/Cosy/candrv/vmodican.cc
r920 r1109 10 10 #include <sys/ioctl.h> // ioctl 11 11 #include <sys/resource.h> // PRIO_PROCESS 12 13 ClassImp(VmodIcan); 12 14 13 15 void VmodIcan::PrintMsg(Message *m) -
trunk/MagicSoft/Cosy/candrv/vmodican.h
r920 r1109 7 7 8 8 #include "log.h" 9 10 #ifdef __CINT__ 11 //#include <TROOT.h> 12 typedef UShort_t WORD_t; 13 typedef Byte_t BYTE_t; 14 #else 9 15 #include "gendef.h" 16 #endif 10 17 11 18 #include "MThread.h" 19 20 class Message; 21 class FastMessage; 12 22 13 23 class VmodIcan : public Log, protected MThread … … 65 75 BYTE_t m0=0, BYTE_t m1=0, BYTE_t m2=0, BYTE_t m3=0, 66 76 BYTE_t m4=0, BYTE_t m5=0, BYTE_t m6=0, BYTE_t m7=0); 77 78 ClassDef(VmodIcan, 0) 67 79 }; 68 80 -
trunk/MagicSoft/Cosy/catalog/CatalogIncl.h
r920 r1109 1 #if ndef __CINT__1 #ifdef __CINT__ 2 2 3 3 #endif // __CINT__ -
trunk/MagicSoft/Cosy/catalog/CatalogLinkDef.h
r920 r1109 5 5 #pragma link off all functions; 6 6 7 #pragma link C++ class Slalib+; 8 #pragma link C++ class SlaStars+; 9 #pragma link C++ class SlaPlanets+; 10 11 #pragma link C++ class SaoFile+; 12 #pragma link C++ class StarCatalog+; 13 7 14 #endif -
trunk/MagicSoft/Cosy/catalog/Makefile
r912 r1109 24 24 # @code 25 25 26 CINT 27 LIB 26 CINT = Catalog 27 LIB = catalog.a 28 28 29 29 #------------------------------------------------------------------------------ … … 37 37 StarCatalog.cc 38 38 39 SRCS = $(SRCFILES) 40 HEADERS = $(SRCFILES:.cc=.h) 41 OBJS = $(SRCFILES:.cc=.o) 39 SRCS = $(SRCFILES) 40 HEADERS = $(SRCFILES:.cc=.h) 41 OBJS = $(SRCFILES:.cc=.o) 42 CINTHEADERS = $(HEADERS) 42 43 43 44 ############################################################ -
trunk/MagicSoft/Cosy/catalog/SaoFile.cc
r748 r1109 10 10 #define FALSE 0 11 11 #define TRUE 1 12 13 ClassImp(SaoFile); 12 14 13 15 static int lt(sort_t *t1, sort_t *t2) -
trunk/MagicSoft/Cosy/catalog/SaoFile.h
r740 r1109 1 1 #ifndef SAOFILE_H 2 2 #define SAOFILE_H 3 4 #include <TROOT.h> 3 5 4 6 #include "coord.h" … … 43 45 public: 44 46 SaoFile(const char *name); 45 ~SaoFile();47 virtual ~SaoFile(); 46 48 47 49 void Compress(); … … 78 80 79 81 const char *String() const { return data; } 82 83 ClassDef(SaoFile, 0) 80 84 }; 81 85 -
trunk/MagicSoft/Cosy/catalog/SlaPlanets.cc
r912 r1109 4 4 5 5 #include "slalib.h" 6 7 ClassImp(SlaPlanets); 6 8 7 9 SlaPlanets::SlaPlanets() : Slalib(), fDt(slaDt(2000.0)/60./60./24.) -
trunk/MagicSoft/Cosy/catalog/SlaPlanets.h
r912 r1109 23 23 { 24 24 private: 25 const double fDt;25 double fDt; // const: rootcint/TMemberInspector 26 26 27 27 ZdAz fZdAz[10]; // [rad] … … 44 44 ZdAz GetPlanetPos(ePlanets_t planet) const { return fZdAz[planet]; } 45 45 46 ClassDef(SlaPlanets, 0) 47 46 48 }; 47 49 -
trunk/MagicSoft/Cosy/catalog/SlaStars.cc
r920 r1109 2 2 3 3 #include "slalib.h" 4 5 ClassImp(SlaStars); 4 6 5 7 SlaStars::SlaStars() : Slalib() … … 13 15 void SlaStars::Set(const AltAz &altaz) 14 16 { 15 fAltAz = altaz * D2PI/360.0;17 fAltAz = altaz * kDeg2Rad; 16 18 fRaDec = CalcRaDec(fAltAz); 17 19 } … … 19 21 void SlaStars::Set(const ZdAz &zdaz) 20 22 { 21 fAltAz = AltAz( DPI/2-zdaz.Zd(), zdaz.Az()) * D2PI/360.0;23 fAltAz = AltAz(kPiDiv2-zdaz.Zd(), zdaz.Az()) * kDeg2Rad; 22 24 fRaDec = CalcRaDec(fAltAz); 23 25 } … … 25 27 void SlaStars::Set(const RaDec &radec) 26 28 { 27 fRaDec = radec * D2PI/360.0;29 fRaDec = radec * kDeg2Rad; 28 30 fAltAz = CalcAltAz(fRaDec); 29 31 } … … 47 49 RaDec SlaStars::CalcRaDec(const AltAz &altaz) const 48 50 { 49 return CalcRaDec(ZdAz( DPI/2-altaz.Alt(), altaz.Az()));51 return CalcRaDec(ZdAz(kPiDiv2-altaz.Alt(), altaz.Az())); 50 52 } 51 53 … … 105 107 { 106 108 ZdAz zdaz = CalcZdAz(radec); 107 return AltAz( DPI/2-zdaz.Zd(), zdaz.Az());109 return AltAz(kPiDiv2-zdaz.Zd(), zdaz.Az()); 108 110 } 109 111 -
trunk/MagicSoft/Cosy/catalog/SlaStars.h
r920 r1109 3 3 4 4 #include "Slalib.h" 5 6 #include "coord.h" 5 7 6 8 class SlaStars : public Slalib … … 34 36 AltAz CalcAltAz(const RaDec &radec) const; 35 37 ZdAz CalcZdAz (const RaDec &radec) const; 38 39 ClassDef(SlaStars, 0) 36 40 }; 37 41 -
trunk/MagicSoft/Cosy/catalog/Slalib.cc
r921 r1109 4 4 #include <iostream.h> // cout 5 5 6 #include "coord.h" 7 6 8 #include "slalib.h" 9 10 ClassImp(Slalib); 7 11 8 12 Slalib::Slalib() : Timer() … … 17 21 slaDaf2r( 9, 56, 36.0, &fElong, &status); 18 22 19 cout << "Latitude: 51\x9c 38'48.0\" = " << 360.0/D2PI*fPhi << " ";20 cout << "Longitude: 9\x9c 56'36.0\" = " << 360.0/D2PI*fElong << endl;23 cout << "Latitude: 51\x9c 38'48.0\" = " << kRad2Deg*fPhi << " "; 24 cout << "Longitude: 9\x9c 56'36.0\" = " << kRad2Deg*fElong << endl; 21 25 } 22 26 … … 64 68 slaDe2h(ha, dec, fPhi, &az, &alt); 65 69 66 return ZdAz( DPI/2-alt, az);70 return ZdAz(kPiDiv2-alt, az); 67 71 } -
trunk/MagicSoft/Cosy/catalog/Slalib.h
r912 r1109 1 1 #ifndef SLALIB_H 2 2 #define SLALIB_H 3 4 #include <TROOT.h> 3 5 4 6 #include "coord.h" … … 34 36 35 37 ZdAz XYZ2ZdAz(double coord[3]) const; 38 39 ClassDef(Slalib, 0) 36 40 }; 37 41 -
trunk/MagicSoft/Cosy/catalog/StarCatalog.cc
r912 r1109 9 9 #include "slamac.h" 10 10 #include "File.h" 11 12 ClassImp(StarCatalog); 11 13 12 14 StarCatalog::StarCatalog() : SlaStars(), fEntries(0) -
trunk/MagicSoft/Cosy/devdrv/DevdrvLinkDef.h
r920 r1109 5 5 #pragma link off all functions; 6 6 7 #pragma link C++ class Macs+; 8 #pragma link C++ class ShaftEncoder+; 9 7 10 #endif -
trunk/MagicSoft/Cosy/devdrv/Makefile
r911 r1109 35 35 shaftencoder.cc 36 36 37 SRCS = $(SRCFILES) 38 HEADERS = $(SRCFILES:.cc=.h) 39 OBJS = $(SRCFILES:.cc=.o) 37 SRCS = $(SRCFILES) 38 HEADERS = $(SRCFILES:.cc=.h) 39 OBJS = $(SRCFILES:.cc=.o) 40 CINTHEADERS = $(HEADERS) 40 41 41 42 ############################################################ -
trunk/MagicSoft/Cosy/devdrv/macs.cc
r926 r1109 7 7 #include "network.h" 8 8 #include "MLogManip.h" 9 10 ClassImp(Macs); 9 11 10 12 Macs::Macs(const BYTE_t nodeid, const char *name, MLog &out) -
trunk/MagicSoft/Cosy/devdrv/macs.h
r926 r1109 43 43 void InitDevice(Network *); 44 44 45 void StartDevice();45 //void StartDevice(); 46 46 void StopDevice(); 47 47 … … 59 59 void ReqPos(); 60 60 void ReqVel(); 61 void ReqAxEnd();61 //void ReqAxEnd(); 62 62 void ReqVelRes(); 63 63 void SetHome(LWORDS_t pos=0, WORD_t maxtime=25); … … 102 102 103 103 void HandleError(); 104 105 ClassDef(Macs, 0) 104 106 }; 105 107 -
trunk/MagicSoft/Cosy/devdrv/shaftencoder.cc
r926 r1109 12 12 #include <pthread.h> 13 13 #include <sys/resource.h> // PRIO_PROCESS 14 15 ClassImp(ShaftEncoder); 14 16 15 17 ShaftEncoder::ShaftEncoder(const BYTE_t nodeid, const char *name, MLog &out) -
trunk/MagicSoft/Cosy/devdrv/shaftencoder.h
r926 r1109 38 38 void InitDevice(Network *); 39 39 40 void StartDevice();40 //void StartDevice(); 41 41 void StopDevice(); 42 42 … … 61 61 bool PosHasChanged() const { return fPosHasChanged; } 62 62 void ResetPosHasChanged() { fPosHasChanged = false; } 63 64 ClassDef(ShaftEncoder, 0) 63 65 }; 64 66 -
trunk/MagicSoft/Cosy/gui/GuiIncl.h
r920 r1109 1 1 #ifndef __CINT__ 2 2 3 #include "coord.h" 4 3 5 #endif // __CINT__ -
trunk/MagicSoft/Cosy/gui/GuiLinkDef.h
r920 r1109 5 5 #pragma link off all functions; 6 6 7 #pragma link C++ class MGAccuracy+; 8 9 #pragma link C++ class MGCoordinate+; 10 #pragma link C++ class MGCoordinates+; 11 12 #pragma link C++ class MGEmbeddedCanvas+; 13 14 #pragma link C++ class MGImage+; 15 16 #pragma link C++ class MGSkyPosition+; 17 #pragma link C++ class MGVelocity+; 18 19 #pragma link C++ class MGCosy+; 20 #pragma link C++ class MGStarguider+; 21 7 22 #endif -
trunk/MagicSoft/include-Classes/MMcFormat/McLinkDef.h
r1063 r1109 7 7 #pragma link C++ class MMcEvt; 8 8 #pragma link C++ class MMcTrig; 9 #pragma link C++ class MMcRunHeader ;9 #pragma link C++ class MMcRunHeader+; 10 10 #pragma link C++ class MMcTrigHeader; 11 11 #pragma link C++ class MMcFadcHeader;
Note:
See TracChangeset
for help on using the changeset viewer.