|
Last change
on this file since 910 was 909, checked in by tbretz, 24 years ago |
|
*** empty log message ***
|
-
Property svn:executable
set to
*
|
|
File size:
1.8 KB
|
| Line | |
|---|
| 1 | #ifndef MCOSY_H
|
|---|
| 2 | #define MCOSY_H
|
|---|
| 3 |
|
|---|
| 4 | #include "coord.h"
|
|---|
| 5 | #include "msgqueue.h"
|
|---|
| 6 | #include "network.h"
|
|---|
| 7 | #include "MThread.h"
|
|---|
| 8 |
|
|---|
| 9 | #define kDEG ((char)0xb0) // Linux 'ø'
|
|---|
| 10 |
|
|---|
| 11 | #define WM_WAIT WM_NULL
|
|---|
| 12 | #define WM_PRESET 0x1000
|
|---|
| 13 | #define WM_POSITION 0x1001
|
|---|
| 14 | #define WM_TRACK 0x1002
|
|---|
| 15 | #define WM_STOP 0x1003
|
|---|
| 16 | #define WM_POLARIS 0x1004
|
|---|
| 17 |
|
|---|
| 18 | class ShaftEncoder;
|
|---|
| 19 | class Macs;
|
|---|
| 20 | class MGCosy;
|
|---|
| 21 | class MCosy;
|
|---|
| 22 |
|
|---|
| 23 | class MTGui : public MThread
|
|---|
| 24 | {
|
|---|
| 25 | private:
|
|---|
| 26 | MCosy *fCosy;
|
|---|
| 27 |
|
|---|
| 28 | void *Thread();
|
|---|
| 29 |
|
|---|
| 30 | public:
|
|---|
| 31 | MTGui(MCosy *cosy) : MThread(false), fCosy(cosy)
|
|---|
| 32 | {
|
|---|
| 33 | SetPriority(20);
|
|---|
| 34 | Start();
|
|---|
| 35 | }
|
|---|
| 36 | };
|
|---|
| 37 |
|
|---|
| 38 | class MTTalk : public MThread
|
|---|
| 39 | {
|
|---|
| 40 | private:
|
|---|
| 41 | MCosy *fCosy;
|
|---|
| 42 |
|
|---|
| 43 | void *Thread();
|
|---|
| 44 |
|
|---|
| 45 | public:
|
|---|
| 46 | MTTalk(MCosy *cosy) : MThread(false), fCosy(cosy)
|
|---|
| 47 | {
|
|---|
| 48 | SetPriority(10);
|
|---|
| 49 | Detach();
|
|---|
| 50 | Start();
|
|---|
| 51 | }
|
|---|
| 52 | };
|
|---|
| 53 |
|
|---|
| 54 | class MCosy : public Network, public MsgQueue
|
|---|
| 55 | {
|
|---|
| 56 | friend class MTGui;
|
|---|
| 57 | friend class MTTalk;
|
|---|
| 58 |
|
|---|
| 59 | private:
|
|---|
| 60 | ShaftEncoder *fAlt1;
|
|---|
| 61 | ShaftEncoder *fAlt2;
|
|---|
| 62 | ShaftEncoder *fAz;
|
|---|
| 63 |
|
|---|
| 64 | Macs *fMac1;
|
|---|
| 65 | Macs *fMac2;
|
|---|
| 66 | Macs *fMac3;
|
|---|
| 67 |
|
|---|
| 68 | MGCosy *fWin;
|
|---|
| 69 |
|
|---|
| 70 | MTGui *fTGui;
|
|---|
| 71 | MTTalk *fTTalk;
|
|---|
| 72 |
|
|---|
| 73 | ZdAz fOffset; // Tracking Offset between SE and calc-pos [re]
|
|---|
| 74 | RaDec fRaDec; // Position to track
|
|---|
| 75 | int fTracking; // Flag for present tracking action
|
|---|
| 76 |
|
|---|
| 77 | ZdAz GetRePos();
|
|---|
| 78 | ZdAz GetSePos(); // [se]
|
|---|
| 79 |
|
|---|
| 80 | void TalkThread();
|
|---|
| 81 | void GuiThread(MTGui *t);
|
|---|
| 82 |
|
|---|
| 83 | int SetPosition(const ZdAz &dst);
|
|---|
| 84 |
|
|---|
| 85 | void TerminateApp();
|
|---|
| 86 |
|
|---|
| 87 | void TrackPosition(const RaDec &dst); // ra, dec [rad]
|
|---|
| 88 |
|
|---|
| 89 | int StopWaitingForSDO() const;
|
|---|
| 90 |
|
|---|
| 91 | public:
|
|---|
| 92 | MCosy(const char *dev, const int baud, ostream &out=cout);
|
|---|
| 93 | ~MCosy();
|
|---|
| 94 |
|
|---|
| 95 | void Start();
|
|---|
| 96 | void Stop();
|
|---|
| 97 |
|
|---|
| 98 | void *Proc(int msg, void *mp);
|
|---|
| 99 |
|
|---|
| 100 | static ZdAz CorrectTarget(const ZdAz &src, const ZdAz &dst);
|
|---|
| 101 | // static ZdAz RaDec2ZdAz(const double mjd, const RaDec &pos, const RaDec &pm=RaDec(0,0));
|
|---|
| 102 |
|
|---|
| 103 | };
|
|---|
| 104 |
|
|---|
| 105 | #endif
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.