| 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 |
|
|---|
| 18 | class TArrayF;
|
|---|
| 19 | class TGLabel;
|
|---|
| 20 | class TGButton;
|
|---|
| 21 | class TString;
|
|---|
| 22 | class TSocket;
|
|---|
| 23 |
|
|---|
| 24 | class TTimer;
|
|---|
| 25 |
|
|---|
| 26 | class MGMenuBar;
|
|---|
| 27 | class MGPopupMenu;
|
|---|
| 28 | class TGTextEntry;
|
|---|
| 29 |
|
|---|
| 30 | class PixGetter;
|
|---|
| 31 |
|
|---|
| 32 | class MGImage;
|
|---|
| 33 | class MGCoordinates;
|
|---|
| 34 |
|
|---|
| 35 | class StarCatalog;
|
|---|
| 36 | class MStarList;
|
|---|
| 37 | class MCosy;
|
|---|
| 38 | class MCaos;
|
|---|
| 39 | // class MStargLeds;
|
|---|
| 40 | class MStargHistograms;
|
|---|
| 41 | class MGNumStars;
|
|---|
| 42 | class MGStarg;
|
|---|
| 43 | class FilterLed;
|
|---|
| 44 | class Ring;
|
|---|
| 45 |
|
|---|
| 46 | class Leds;
|
|---|
| 47 |
|
|---|
| 48 | class MStarguider : public PixClient, public TGMainFrame
|
|---|
| 49 | {
|
|---|
| 50 | private:
|
|---|
| 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 ¢er, 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 |
|
|---|
| 168 | public:
|
|---|
| 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 |
|
|---|