source: trunk/MagicSoft/Cosy/main/MCosy.h@ 9522

Last change on this file since 9522 was 9516, checked in by tbretz, 15 years ago
*** empty log message ***
File size: 3.4 KB
Line 
1#ifndef COSY_MCosy
2#define COSY_MCosy
3
4//#include "coord.h"
5#include "msgqueue.h"
6#include "MPointing.h"
7
8#ifndef MARS_MThread
9#define COSY_MThread
10#include "MThread.h"
11#endif
12
13#ifndef COSY_Network
14#include "network.h"
15#endif
16#ifndef MARS_MObservatory
17#include "MObservatory.h"
18#endif
19#ifndef ROOT_TMutex
20#include <TMutex.h>
21#endif
22
23#define kDEG ((char)0x9c) // Linux 'ø'
24
25#define WM_WAIT WM_NULL
26//#define WM_PRESET 0x1000
27#define WM_POSITION 0x1001
28#define WM_TRACK 0x1002
29#define WM_STOP 0x1003
30//#define WM_CALIB 0x1004
31#define WM_TPOINT 0x1005
32//#define WM_NEWTRACK 0x1006
33#define WM_LOADBENDING 0x1007
34#define WM_RESETBENDING 0x1008
35#define WM_CALCALTAZ 0x1009
36#define WM_HOME 0x100a
37#define WM_TESTSE 0x100b
38#define WM_GEAR 0x100c
39#define WM_DISPLAY 0x100d
40#define WM_TRACKPOS 0x100e
41#define WM_POSITION1 0x100f
42#define WM_ENDSWITCH 0x1010
43#define WM_GRB 0x1011
44#define WM_PREPS 0x1012
45#define WM_ARM 0x1013
46#define WM_STARGTPOINT 0x1014
47#define WM_STARGMODE 0x1015
48#define WM_PLANET 0x1016
49
50class Dkc;
51
52class MGCosy;
53class MCosy;
54class MStarguider;
55class MDriveCom;
56class MEnv;
57
58class TTimer;
59
60class MCosy : public Network, public MsgQueue, public TObject
61{
62 friend class MSlewing;
63 friend class MTracking;
64
65private:
66 const MObservatory::LocationName_t fObservatory;
67
68 MStarguider *fStarguider;
69
70 Dkc *fMac1;
71 Dkc *fMac2;
72
73 MGCosy *fWin;
74 MDriveCom *fCom;
75
76 TTimer *fUpdateGui;
77
78 TMutex fMutexGui;
79
80 ZdAz fTrackingError; // [rad] Tracking Offset between SE and calc-pos
81 ZdAz fZdAzSoll; // [rad] Soll position when moving
82 RaDec fRaDec; // Position to track
83 Double_t fHourAngle; // Hour Angle of Position to track
84 ZdAz fAccuracy; // Actual accuracy of Tracking
85 ZdAz fMin;
86 ZdAz fMax;
87
88 MPointing fBending;
89
90 UInt_t fStatus;
91
92 ofstream *fOutTp;
93 MLog *fOutRep;
94
95 TString fFilePrepos;
96
97 ZdAz AlignTrackingPos(ZdAz pointing) const;
98 Bool_t CheckRange(const ZdAz &d) const;
99 Double_t Starguider(Double_t mjd, ZdAz &dest) const;
100
101 void SetStatus(UInt_t stat) { fStatus = stat; }
102 UInt_t GetStatus() const { return fStatus; }
103
104 int SetPosition(const ZdAz &dst, Bool_t track=kFALSE);
105 void TrackPlanet(const Int_t &p);
106 void TrackPosition(const RaDec &dst); // ra, dec [rad]
107 void TrackPositionGRB(const RaDec &dst); // ra, dec [rad]
108
109 void TerminateApp();
110
111 int StopWaitingForSDO() const;
112 void CheckForError();
113
114 void StopMovement();
115
116 void WaitForEndMovement();
117
118 void Constructor(Int_t id1, Int_t id2);
119 //void ConstructorSE(Int_t id1, Int_t id2, Int_t id3);
120 //void ConstructorDemo();
121
122 void ReadConfig(MEnv &env);
123
124 bool CheckNetwork();
125
126 void Start() { }
127
128public:
129 MCosy(MEnv &env, MDriveCom *com);
130 ~MCosy();
131
132 void Start(MEnv &env);
133 void Stop();
134
135 Int_t Proc(int msg, void *mp);
136
137 Bool_t HandleTimer(TTimer *t);
138
139 ZdAz GetPointingPos(void) const;
140 void SetStarguider(MStarguider *s) { fStarguider = s; }
141
142 static TString GetFileName(const char *path, const char *name, const char *ext);
143
144 MGCosy *GetWin() { return fWin; }
145
146 ZdAz GetSePos() const; // [revolutions]
147
148 MLog *GetOutRep() { return fOutRep; }
149
150 MDriveCom *GetDriveCom() { return fCom; }
151
152 ClassDef(MCosy, 0)
153};
154
155#endif
Note: See TracBrowser for help on using the repository browser.