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

Last change on this file since 9195 was 8821, checked in by tbretz, 17 years ago
*** empty log message ***
File size: 4.3 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;
23class 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 TSocket *fAmcSocket;
114 MStargHistograms *fStargHistograms;
115
116 RaDec *fRaDec;
117
118 TTimer *fTimer;
119 MTime fTime;
120 MTime fTimeFromTp;
121
122 ofstream *fOutTp;
123 ofstream *fOutStargTp;
124 ofstream *fOutRq;
125
126 Int_t fDx;
127 Int_t fDy;
128
129 byte fIntRate;
130 int fWrtRate;
131
132 UInt_t fStatus;
133 Double_t fLastBright;
134
135 void SetPixSize(const double pixsize);
136 void Toggle(TGPopupMenu *p, UInt_t id);
137 void SwitchOff(TGPopupMenu *p, UInt_t id);
138 void ToggleStargAnalysis();
139 void ToggleFindStar();
140 void ToggleStarguider();
141 void ToggleCaosFilter();
142 void SetChannel();
143 //void GetCoordinates();
144 Int_t CalcTrackingError(Leds &, MStarList &, ZdAz &, MTime &, double &bright, Int_t &num);
145 //void CalcTrackingError(Leds &, MStarList &);
146 ZdAz TrackingError(TArrayF &alt, TArrayF &az, TArrayF &mag, Int_t &num) const;
147 bool Interpolate(const unsigned long n, byte *img) const;
148
149 XY FindRoqueLamp(FilterLed &f, FilterLed &f2, Ring &CameraCenter, MTime &t,
150 Double_t cut, Int_t box, XY SearchCenter);
151
152 ZdAz FindStar(FilterLed &f, FilterLed &f2, Ring &center, MTime &t,
153 Double_t cut, Int_t box, Double_t scalefactor);
154
155 //void InitHists();
156 //void InitGraphs();
157 void InitGui(Int_t channel);
158
159 bool SendAmcTrigger(const char *msg);
160
161 //void OpenFile();
162
163 //void ResetHists();
164 //void DisplayAnalysis();
165 void UpdatePosZoom();
166
167 Bool_t HandleTimer(TTimer *t);
168 //Bool_t HandleKey(Event_t* event);
169
170public:
171 MStarguider(MObservatory::LocationName_t obs, Int_t channel);
172 virtual ~MStarguider();
173
174 //void Update();
175
176 void Layout();
177 void CloseWindow();
178
179 Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
180
181 Bool_t HandleDoubleClick(Event_t *event);
182 //Bool_t HandleButton(Event_t *);
183
184 void SetPointingPosition(RaDec rd);
185 void SetCosy(MCosy *c) { fCosy = c; }
186
187 XY GetCoordinates() const;
188
189 //
190 // Execution of one frame - this function may be overloaded!
191 //
192 void ProcessFrame(const unsigned long n, byte *img, struct timeval *tm);
193
194 void Print(TString &str, Double_t deg) const;
195 void Print(Option_t *o) const { }
196
197 ClassDef(MStarguider, 0)
198};
199
200#endif
201
202
Note: See TracBrowser for help on using the repository browser.