Changeset 1109 for trunk


Ignore:
Timestamp:
12/12/01 13:09:24 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft
Files:
35 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Cosy/base/coord.h

    r921 r1109  
    44#include <math.h>          // floor
    55
    6 #include "slalib/slamac.h" // D2PI
     6/* pi/180:  degrees to radians */
     7const double kDeg2Rad = 0.017453292519943295769236907684886127134428718885417;
     8
     9/* 180/pi:  radians to degrees */
     10const double kRad2Deg = 57.295779513082320876798154814105170332405472466564;
     11
     12/* pi/2:  90 degrees in radians */
     13const double kPiDiv2 = 1.5707963267948966192313216916397514420985846996876;
     14
     15/* 2pi */
     16const double k2Pi = 6.2831853071795864769252867665590057683943387987502;
    717
    818class Deg
     
    1929    double operator()() { return fDeg; }
    2030
    21     operator double() const { return fDeg*D2PI/360.0; }
     31    operator double() const { return fDeg*kDeg2Rad; }
    2232};
    2333
     
    118128inline double Rad2Deg(double rad)
    119129{
    120     return 360.0/D2PI*rad;
     130    return kRad2Deg*rad;
    121131}
    122132
    123133inline double Deg2Rad(double rad)
    124134{
    125     return D2PI/360.0*rad;
     135    return kDeg2Rad*rad;
    126136}
    127137#endif
  • trunk/MagicSoft/Cosy/base/msgqueue.h

    r909 r1109  
    22#define MSGQUEUE_H
    33
    4 #include <pthread.h>
     4#include "threads.h"
    55
    66#define WM_NULL 0x0000
  • trunk/MagicSoft/Cosy/base/timer.h

    r926 r1109  
    22#define TIMER_H
    33
    4 #include <unistd.h> // gettimeofday
     4struct timeval;
    55
    66class Timer
  • trunk/MagicSoft/Cosy/candrv/CandrvLinkDef.h

    r920 r1109  
    55#pragma link off all functions;
    66
     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
    716#endif
  • trunk/MagicSoft/Cosy/candrv/Makefile

    r910 r1109  
    3131.SUFFIXES: .c .cc .cxx .h .hxx .o
    3232
    33 SRCFILES = canopen.cc \
    34            network.cc \
     33SRCFILES = vmodican.cc \
     34           sdolist.cc \
     35           canopen.cc \
    3536           nodedrv.cc \
    36            sdolist.cc \
    37            vmodican.cc
     37           network.cc
    3838
    3939SRCS    = $(SRCFILES)
    4040HEADERS = $(SRCFILES:.cc=.h)
    4141OBJS    = $(SRCFILES:.cc=.o)
     42CINTHEADERS = $(HEADERS)
    4243
    4344############################################################
  • trunk/MagicSoft/Cosy/candrv/canopen.cc

    r926 r1109  
    33#include <iostream.h> // cout
    44#include <iomanip.h>  // setw, setfill
     5
     6ClassImp(CanOpen);
    57
    68CanOpen::CanOpen(const char *dev, const int baud, MLog &out) : VmodIcan(dev, baud, out)
  • trunk/MagicSoft/Cosy/candrv/network.cc

    r920 r1109  
    33#include <iostream.h> // cout
    44#include <iomanip.h>  // setw, setfill
     5
     6ClassImp(Network);
    57
    68void Network::Start()
  • trunk/MagicSoft/Cosy/candrv/network.h

    r920 r1109  
    3232
    3333    bool HasError() const;
     34
     35    ClassDef(Network, 0)
    3436};
    3537
  • trunk/MagicSoft/Cosy/candrv/nodedrv.cc

    r926 r1109  
    66#include "network.h"
    77#include "MLogManip.h"
     8
     9ClassImp(NodeDrv);
    810
    911NodeDrv::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  
    33
    44#include "log.h"
     5
     6#ifdef __CINT__
     7typedef Byte_t   BYTE_t;
     8typedef UShort_t WORD_t;
     9typedef Short_t  WORDS_t;
     10typedef UInt_t   LWORD_t;
     11typedef Int_t    LWORDS_t;
     12struct timeval;
     13#else
    514#include "gendef.h"
     15#endif
    616
    717class Network;
     
    7282
    7383    void EnableCanMsg(BYTE_t fcode);
     84
     85    ClassDef(NodeDrv, 0)
    7486};
    7587
  • trunk/MagicSoft/Cosy/candrv/sdolist.cc

    r909 r1109  
    22
    33#include <iostream.h>
     4
     5ClassImp(PendingSDO);
     6ClassImp(PendingSDOList);
    47
    58PendingSDOList::PendingSDOList()
  • trunk/MagicSoft/Cosy/candrv/sdolist.h

    r909 r1109  
    22#define SDOLIST_H
    33
     4#ifdef __CINT__
     5struct pthread_mutex_t;
     6#else
    47#include <pthread.h>
     8#endif
    59
     10#ifdef __CINT__
     11typedef Byte_t   BYTE_t;
     12typedef UShort_t WORD_t;
     13#else
     14#include <TROOT.h>
    615#include "gendef.h"
     16#endif
    717
    818class PendingSDO
     
    1626    PendingSDO(BYTE_t n=0, WORD_t i=0, BYTE_t s=0)
    1727        : Node(n), Idx(i), Subidx(s), Next(NULL) {}
     28
     29    ClassDef(PendingSDO, 0)
    1830};
    1931
     
    2840public:
    2941    PendingSDOList();
    30     ~PendingSDOList();
     42    virtual ~PendingSDOList();
    3143
    3244    void Add(BYTE_t node, WORD_t idx, BYTE_t subidx);
     
    3749    int IsPending(BYTE_t node);
    3850    int IsPending(BYTE_t node, WORD_t idx, BYTE_t subidx);
     51
     52    ClassDef(PendingSDOList, 0)
    3953};
    4054
  • trunk/MagicSoft/Cosy/candrv/vmodican.cc

    r920 r1109  
    1010#include <sys/ioctl.h>     // ioctl
    1111#include <sys/resource.h>  // PRIO_PROCESS
     12
     13ClassImp(VmodIcan);
    1214
    1315void VmodIcan::PrintMsg(Message *m)
  • trunk/MagicSoft/Cosy/candrv/vmodican.h

    r920 r1109  
    77
    88#include "log.h"
     9
     10#ifdef __CINT__
     11//#include <TROOT.h>
     12typedef UShort_t WORD_t;
     13typedef Byte_t   BYTE_t;
     14#else
    915#include "gendef.h"
     16#endif
    1017
    1118#include "MThread.h"
     19
     20class Message;
     21class FastMessage;
    1222
    1323class VmodIcan : public Log, protected MThread
     
    6575                      BYTE_t m0=0, BYTE_t m1=0, BYTE_t m2=0, BYTE_t m3=0,
    6676                      BYTE_t m4=0, BYTE_t m5=0, BYTE_t m6=0, BYTE_t m7=0);
     77
     78    ClassDef(VmodIcan, 0)
    6779};
    6880
  • trunk/MagicSoft/Cosy/catalog/CatalogIncl.h

    r920 r1109  
    1 #ifndef __CINT__
     1#ifdef __CINT__
    22
    33#endif // __CINT__
  • trunk/MagicSoft/Cosy/catalog/CatalogLinkDef.h

    r920 r1109  
    55#pragma link off all functions;
    66
     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
    714#endif
  • trunk/MagicSoft/Cosy/catalog/Makefile

    r912 r1109  
    2424# @code
    2525
    26 CINT     = Catalog
    27 LIB      = catalog.a
     26CINT = Catalog
     27LIB  = catalog.a
    2828
    2929#------------------------------------------------------------------------------
     
    3737           StarCatalog.cc
    3838
    39 SRCS    = $(SRCFILES)
    40 HEADERS = $(SRCFILES:.cc=.h)
    41 OBJS    = $(SRCFILES:.cc=.o)
     39SRCS        = $(SRCFILES)
     40HEADERS     = $(SRCFILES:.cc=.h)
     41OBJS        = $(SRCFILES:.cc=.o)
     42CINTHEADERS = $(HEADERS)
    4243
    4344############################################################
  • trunk/MagicSoft/Cosy/catalog/SaoFile.cc

    r748 r1109  
    1010#define FALSE 0
    1111#define TRUE  1
     12
     13ClassImp(SaoFile);
    1214
    1315static int lt(sort_t *t1, sort_t *t2)
  • trunk/MagicSoft/Cosy/catalog/SaoFile.h

    r740 r1109  
    11#ifndef SAOFILE_H
    22#define SAOFILE_H
     3
     4#include <TROOT.h>
    35
    46#include "coord.h"
     
    4345public:
    4446    SaoFile(const char *name);
    45     ~SaoFile();
     47    virtual ~SaoFile();
    4648
    4749    void  Compress();
     
    7880
    7981    const char *String() const { return data; }
     82
     83    ClassDef(SaoFile, 0)
    8084};
    8185
  • trunk/MagicSoft/Cosy/catalog/SlaPlanets.cc

    r912 r1109  
    44
    55#include "slalib.h"
     6
     7ClassImp(SlaPlanets);
    68
    79SlaPlanets::SlaPlanets() : Slalib(), fDt(slaDt(2000.0)/60./60./24.)
  • trunk/MagicSoft/Cosy/catalog/SlaPlanets.h

    r912 r1109  
    2323{
    2424private:
    25     const double fDt;
     25    double fDt; // const: rootcint/TMemberInspector
    2626
    2727    ZdAz fZdAz[10];    // [rad]
     
    4444    ZdAz GetPlanetPos(ePlanets_t planet) const { return fZdAz[planet]; }
    4545
     46    ClassDef(SlaPlanets, 0)
     47
    4648};
    4749
  • trunk/MagicSoft/Cosy/catalog/SlaStars.cc

    r920 r1109  
    22
    33#include "slalib.h"
     4
     5ClassImp(SlaStars);
    46
    57SlaStars::SlaStars() : Slalib()
     
    1315void SlaStars::Set(const AltAz &altaz)
    1416{
    15     fAltAz = altaz * D2PI/360.0;
     17    fAltAz = altaz * kDeg2Rad;
    1618    fRaDec = CalcRaDec(fAltAz);
    1719}
     
    1921void SlaStars::Set(const ZdAz &zdaz)
    2022{
    21     fAltAz = AltAz(DPI/2-zdaz.Zd(), zdaz.Az()) * D2PI/360.0;
     23    fAltAz = AltAz(kPiDiv2-zdaz.Zd(), zdaz.Az()) * kDeg2Rad;
    2224    fRaDec = CalcRaDec(fAltAz);
    2325}
     
    2527void SlaStars::Set(const RaDec &radec)
    2628{
    27     fRaDec = radec * D2PI/360.0;
     29    fRaDec = radec * kDeg2Rad;
    2830    fAltAz = CalcAltAz(fRaDec);
    2931}
     
    4749RaDec SlaStars::CalcRaDec(const AltAz &altaz) const
    4850{
    49     return CalcRaDec(ZdAz(DPI/2-altaz.Alt(), altaz.Az()));
     51    return CalcRaDec(ZdAz(kPiDiv2-altaz.Alt(), altaz.Az()));
    5052}
    5153
     
    105107{
    106108    ZdAz zdaz = CalcZdAz(radec);
    107     return AltAz(DPI/2-zdaz.Zd(), zdaz.Az());
     109    return AltAz(kPiDiv2-zdaz.Zd(), zdaz.Az());
    108110}
    109111
  • trunk/MagicSoft/Cosy/catalog/SlaStars.h

    r920 r1109  
    33
    44#include "Slalib.h"
     5
     6#include "coord.h"
    57
    68class SlaStars : public Slalib
     
    3436    AltAz  CalcAltAz(const RaDec &radec) const;
    3537    ZdAz   CalcZdAz (const RaDec &radec) const;
     38
     39    ClassDef(SlaStars, 0)
    3640};
    3741
  • trunk/MagicSoft/Cosy/catalog/Slalib.cc

    r921 r1109  
    44#include <iostream.h>  // cout
    55
     6#include "coord.h"
     7
    68#include "slalib.h"
     9
     10ClassImp(Slalib);
    711
    812Slalib::Slalib() : Timer()
     
    1721    slaDaf2r( 9, 56, 36.0, &fElong, &status);
    1822
    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;
    2125}
    2226
     
    6468    slaDe2h(ha, dec, fPhi, &az, &alt);
    6569
    66     return ZdAz(DPI/2-alt, az);
     70    return ZdAz(kPiDiv2-alt, az);
    6771}
  • trunk/MagicSoft/Cosy/catalog/Slalib.h

    r912 r1109  
    11#ifndef SLALIB_H
    22#define SLALIB_H
     3
     4#include <TROOT.h>
    35
    46#include "coord.h"
     
    3436
    3537    ZdAz   XYZ2ZdAz(double coord[3]) const;
     38
     39    ClassDef(Slalib, 0)
    3640};
    3741
  • trunk/MagicSoft/Cosy/catalog/StarCatalog.cc

    r912 r1109  
    99#include "slamac.h"
    1010#include "File.h"
     11
     12ClassImp(StarCatalog);
    1113
    1214StarCatalog::StarCatalog() : SlaStars(), fEntries(0)
  • trunk/MagicSoft/Cosy/devdrv/DevdrvLinkDef.h

    r920 r1109  
    55#pragma link off all functions;
    66
     7#pragma link C++ class Macs+;
     8#pragma link C++ class ShaftEncoder+;
     9
    710#endif
  • trunk/MagicSoft/Cosy/devdrv/Makefile

    r911 r1109  
    3535           shaftencoder.cc
    3636
    37 SRCS    = $(SRCFILES)
    38 HEADERS = $(SRCFILES:.cc=.h)
    39 OBJS    = $(SRCFILES:.cc=.o)
     37SRCS        = $(SRCFILES)
     38HEADERS     = $(SRCFILES:.cc=.h)
     39OBJS        = $(SRCFILES:.cc=.o)
     40CINTHEADERS = $(HEADERS)
    4041
    4142############################################################
  • trunk/MagicSoft/Cosy/devdrv/macs.cc

    r926 r1109  
    77#include "network.h"
    88#include "MLogManip.h"
     9
     10ClassImp(Macs);
    911
    1012Macs::Macs(const BYTE_t nodeid, const char *name, MLog &out)
  • trunk/MagicSoft/Cosy/devdrv/macs.h

    r926 r1109  
    4343    void InitDevice(Network *);
    4444
    45     void StartDevice();
     45    //void StartDevice();
    4646    void StopDevice();
    4747
     
    5959    void ReqPos();
    6060    void ReqVel();
    61     void ReqAxEnd();
     61    //void ReqAxEnd();
    6262    void ReqVelRes();
    6363    void SetHome(LWORDS_t pos=0, WORD_t maxtime=25);
     
    102102
    103103    void HandleError();
     104
     105    ClassDef(Macs, 0)
    104106};
    105107
  • trunk/MagicSoft/Cosy/devdrv/shaftencoder.cc

    r926 r1109  
    1212#include <pthread.h>
    1313#include <sys/resource.h>  // PRIO_PROCESS
     14
     15ClassImp(ShaftEncoder);
    1416
    1517ShaftEncoder::ShaftEncoder(const BYTE_t nodeid, const char *name, MLog &out)
  • trunk/MagicSoft/Cosy/devdrv/shaftencoder.h

    r926 r1109  
    3838    void InitDevice(Network *);
    3939
    40     void StartDevice();
     40    //void StartDevice();
    4141    void StopDevice();
    4242
     
    6161    bool PosHasChanged() const { return fPosHasChanged; }
    6262    void ResetPosHasChanged() { fPosHasChanged = false; }
     63
     64    ClassDef(ShaftEncoder, 0)
    6365};
    6466
  • trunk/MagicSoft/Cosy/gui/GuiIncl.h

    r920 r1109  
    11#ifndef __CINT__
    22
     3#include "coord.h"
     4
    35#endif // __CINT__
  • trunk/MagicSoft/Cosy/gui/GuiLinkDef.h

    r920 r1109  
    55#pragma link off all functions;
    66
     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
    722#endif
  • trunk/MagicSoft/include-Classes/MMcFormat/McLinkDef.h

    r1063 r1109  
    77#pragma link C++ class MMcEvt;
    88#pragma link C++ class MMcTrig;
    9 #pragma link C++ class MMcRunHeader;
     9#pragma link C++ class MMcRunHeader+;
    1010#pragma link C++ class MMcTrigHeader;
    1111#pragma link C++ class MMcFadcHeader;
Note: See TracChangeset for help on using the changeset viewer.