source: trunk/MagicSoft/Cosy/main/MStarguider.h@ 9435

Last change on this file since 9435 was 9435, checked in by tbretz, 16 years ago
*** empty log message ***
File size: 4.1 KB
Line 
1#ifndef COSY_MStarguider
2#define COSY_MStarguider
3
4#include "PixClient.h"
5#include "MGImage.h"
6
7#include "MPointing.h"
8
9#ifndef MARS_MObservatory
10#include "MObservatory.h"
11#endif
12#ifndef MARS_MTime
13#include "MTime.h"
14#endif
15#ifndef MARS_MGList
16#include "MGList.h"
17#endif
18
19class TArrayF;
20class TGLabel;
21class TGButton;
22class TString;
23//class TSocket;
24
25class TTimer;
26
27class TGMenuBar;
28class TGPopupMenu;
29class TGTextEntry;
30
31class PixGetter;
32
33class MGImage;
34class MGCoordinates;
35
36class StarCatalog;
37class MStarList;
38class MCosy;
39class MCaos;
40// class MStargLeds;
41class MStargHistograms;
42class MGNumStars;
43class MGStarg;
44class FilterLed;
45class Ring;
46
47class Leds;
48
49class MStarguider : public PixClient, public TGMainFrame
50{
51private:
52 PixGetter *fGetter;
53
54 MGList *fList;
55
56 TGMenuBar *fMenu;
57 MGImage *fImage;
58 MGImage *fZoomImage;
59
60 MGStarg *fGStarg;
61 MGNumStars *fGNumStars;
62
63 TGPopupMenu *fDisplay;
64 TGPopupMenu *fMode;
65 TGPopupMenu *fWritePictures;
66 TGPopupMenu *fSetup;
67 TGPopupMenu *fOperations;
68
69 TGPopupMenu *fFileType;
70 TGPopupMenu *fWriteType;
71 TGPopupMenu *fWriteRate;
72 TGPopupMenu *fInterpol;
73 TGPopupMenu *fLimMag;
74 TGPopupMenu *fChannel;
75
76 TGPopupMenu *fCaosWrite;
77 TGPopupMenu *fCaosPrint;
78 TGPopupMenu *fCaosAnalyse;
79 TGPopupMenu *fCaOs;
80
81 MGCoordinates *fCRaDec;
82 MGCoordinates *fCZdAz;
83
84 MGCoordinates *fPZdAz;
85 MGCoordinates *fDZdAz;
86 MGCoordinates *fSZdAz;
87
88 TGTextEntry *fPixSize;
89 TGTextEntry *fAngle;
90 TGTextEntry *fCut;
91
92 TGLabel *fFps;
93 TGLabel *fPosZoom;
94 TGLabel *fSkyBright;
95 TGLabel *fCZdAzText;
96 TGLabel *fPZdAzText;
97 TGLabel *fDZdAzText;
98
99 TGButton *fTPoint;
100 TGButton *fStargTPoint;
101
102 ZdAz fPos;
103 ZdAz fD;
104 AltAz fAltAzOffsetFromTp;
105
106 Int_t fNumStarsDetected;
107 Int_t fNumStarsCorrelated;
108
109 StarCatalog *fSao;
110 MCosy *fCosy;
111 MCaos *fCaos;
112 MCaos *fStargCaos;
113 MStargHistograms *fStargHistograms;
114
115 RaDec *fRaDec;
116
117 TTimer *fTimer;
118 MTime fTime;
119 MTime fTimeFromTp;
120
121 ofstream *fOutTp;
122 ofstream *fOutStargTp;
123 ofstream *fOutRq;
124
125 Int_t fDx;
126 Int_t fDy;
127
128 byte fIntRate;
129 int fWrtRate;
130
131 UInt_t fStatus;
132 Double_t fLastBright;
133
134 Double_t fRadius; // LED radius [cm]
135
136 Int_t fTPointFromCC;
137
138 void Toggle(TGPopupMenu *p, UInt_t id);
139 void SwitchOff(TGPopupMenu *p, UInt_t id);
140 void ToggleStargAnalysis();
141 void ToggleFindStar();
142 void ToggleStarguider();
143 void ToggleCaosFilter();
144 void SetChannel();
145 Int_t CalcTrackingError(Leds &, MStarList &, ZdAz &, MTime &, double &bright, Int_t &num);
146 ZdAz TrackingError(TArrayF &alt, TArrayF &az, TArrayF &mag, Int_t &num) const;
147 bool Interpolate(const unsigned long n, byte *img) const;
148 void FindStar(FilterLed &f, FilterLed &f2, Ring &center, MTime &t);
149
150 void InitGui(Int_t channel);
151
152 void UpdatePosZoom();
153 void DrawZoomImage(const byte *img);
154 void DrawCosyImage(const byte *img);
155
156 Bool_t HandleTimer(TTimer *t);
157
158 void SetRotationAngle(Double_t angle);
159 void SetPixSize(Double_t size);
160 void SetCut(Double_t cut);
161
162 Bool_t DoTPoint();
163
164public:
165 MStarguider(MObservatory::LocationName_t obs, Int_t channel);
166 virtual ~MStarguider();
167
168 void SetupEnv(TEnv &env);
169
170 void Layout();
171 void CloseWindow();
172
173 Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
174
175 Bool_t HandleDoubleClick(Event_t *event);
176
177 void SetPointingPosition(RaDec rd);
178 void SetCosy(MCosy *c) { fCosy = c; }
179
180 XY GetCoordinates() const;
181
182 //
183 // Execution of one frame - this function may be overloaded!
184 //
185 void ProcessFrame(const unsigned long n, byte *img, struct timeval *tm);
186
187 void Print(TString &str, Double_t deg) const;
188 void Print(Option_t *o) const { }
189
190 void StartTPoint() { if (fTPointFromCC<0) fTPointFromCC=0; }
191 void StartStarguider();
192
193 ClassDef(MStarguider, 0)
194};
195
196#endif
197
198
Note: See TracBrowser for help on using the repository browser.