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

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