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

Last change on this file since 9488 was 9439, checked in by tbretz, 16 years ago
*** empty log message ***
File size: 3.2 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
49class Dkc;
50
51class MGCosy;
52class MCosy;
53class MStarguider;
54class MDriveCom;
55class MEnv;
56
57class TTimer;
58
59class MCosy : public Network, public MsgQueue, public TObject
60{
61 friend class MSlewing;
62 friend class MTracking;
63
64private:
65 const MObservatory::LocationName_t fObservatory;
66
67 MStarguider *fStarguider;
68
69 Dkc *fMac1;
70 Dkc *fMac2;
71
72 MGCosy *fWin;
73 MDriveCom *fCom;
74
75 TTimer *fUpdateGui;
76
77 TMutex fMutexGui;
78
79 ZdAz fTrackingError; // [rad] Tracking Offset between SE and calc-pos
80 ZdAz fZdAzSoll; // [rad] Soll position when moving
81 RaDec fRaDec; // Position to track
82 ZdAz fAccuracy; // Actual accuracy of Tracking
83 ZdAz fMin;
84 ZdAz fMax;
85
86 MPointing fBending;
87
88 UInt_t fStatus;
89
90 ofstream *fOutTp;
91 MLog *fOutRep;
92
93 TString fFilePrepos;
94
95 ZdAz AlignTrackingPos(ZdAz pointing) const;
96 Bool_t CheckRange(const ZdAz &d) const;
97 Double_t Starguider(Double_t mjd, ZdAz &dest) const;
98
99 void SetStatus(UInt_t stat) { fStatus = stat; }
100 UInt_t GetStatus() const { return fStatus; }
101
102 int SetPosition(const ZdAz &dst, Bool_t track=kFALSE);
103 void TrackPosition(const RaDec &dst); // ra, dec [rad]
104 void TrackPositionGRB(const RaDec &dst); // ra, dec [rad]
105
106 void TerminateApp();
107
108 int StopWaitingForSDO() const;
109 void CheckForError();
110
111 void StopMovement();
112
113 void WaitForEndMovement();
114
115 void Constructor(Int_t id1, Int_t id2);
116 //void ConstructorSE(Int_t id1, Int_t id2, Int_t id3);
117 //void ConstructorDemo();
118
119 void ReadConfig(MEnv &env);
120
121 bool CheckNetwork();
122
123 void Start() { }
124
125public:
126 MCosy(MEnv &env, MDriveCom *com);
127 ~MCosy();
128
129 void Start(MEnv &env);
130 void Stop();
131
132 Int_t Proc(int msg, void *mp);
133
134 Bool_t HandleTimer(TTimer *t);
135
136 ZdAz GetPointingPos(void) const;
137 void SetStarguider(MStarguider *s) { fStarguider = s; }
138
139 static TString GetFileName(const char *path, const char *name, const char *ext);
140
141 MGCosy *GetWin() { return fWin; }
142
143 ZdAz GetSePos() const; // [revolutions]
144
145 MLog *GetOutRep() { return fOutRep; }
146
147 MDriveCom *GetDriveCom() { return fCom; }
148
149 ClassDef(MCosy, 0)
150};
151
152#endif
Note: See TracBrowser for help on using the repository browser.