The VisAO Camera
VisAOIClient.h
1 
2 #ifndef __VisAOIClient_h__
3 #define __VisAOIClient_h__
4 
5 
6 #include "MagAO/MagAOIClient/MagAOIClient.h"
7 #include "VisAOApp_base.h"
8 
9 #define WOLL_FIFO 0
10 #define FOC_FIFO 1
11 #define GIMB_FIFO 2
12 
13 //#define _debug
14 
15 namespace VisAO
16 {
17 
18 class VisAOIClient : public MagAOIClient, public VisAOApp_base
19 {
20  public:
21  VisAOIClient(int argc, char **argv) throw(AOException);
22  VisAOIClient( std::string name, const std::string &conffile) throw (AOException);
23  protected:
24  void Create(void) throw (AOException);
25 
26  std::string fifo_path; ///<The path to the fifos, relative to VISAO_ROOT
27 
29 
30  /** @name Wollaston Remote Control
31  * VisAOIClient is the interface for "control" of the Wollaston
32  * from the supervisor.
33  */
34  //@{
35  std::string wollaston_process;
36  RTDBvar wollaston_status;
37  RTDBvar wollaston_cmode_cur;
38  RTDBvar wollaston_cmode_req;
39 
40  RTDBvar wollaston_state_cur;
41  RTDBvar wollaston_state_req;
42 
43  static int WollStateReqChanged(void *pt, Variable *msgb);
44  static int WollCModeReqChanged(void *pt, Variable *msgb);
45 
46  int send_wollaston_command(std::string com);
47  int update_wollaston();
48  //@}
49 
50  /** @name Focus Remote Control
51  * VisAOIClient is the interface for "control" of the Focus Stage
52  * from the supervisor.
53  */
54  //@{
55  std::string focus_process;
56  RTDBvar focus_cmode_cur;
57  RTDBvar focus_cmode_req;
58 
59  RTDBvar focus_pos_cur;
60  RTDBvar focus_pos_req;
61  RTDBvar focus_abort_req;
62 
63  RTDBvar focus_preset_req;
64 
65  RTDBvar focus_status;
66  RTDBvar focus_limsw_cur;
67 
68  static int FocusPosReqChanged(void *pt, Variable *msgb);
69  static int FocusAbortReqChanged(void *pt, Variable *msgb);
70  static int FocusCModeReqChanged(void *pt, Variable *msgb);
71  static int FocusPresetReqChanged(void *pt, Variable *msgb);
72 
73  int send_focus_command(std::string com);
74  int update_focus();
75  //@}
76 
77  /** @name Gimbal Remote Control
78  * VisAOIClient is the interface for control of the Gimbal
79  * from the supervisor.
80  */
81  //@{
82  std::string gimbal_process;
83  RTDBvar gimbal_status;
84  RTDBvar gimbal_xpos_cur;
85  RTDBvar gimbal_ypos_cur;
86  RTDBvar gimbal_cmode_cur;
87  RTDBvar gimbal_cmode_req;
88 
89  RTDBvar gimbal_center_req;
90  RTDBvar gimbal_dark_req;
91 
92  static int GimbalCModeReqChanged(void *pt, Variable *msgb);
93  static int GimbalCenterReqChanged(void *pt, Variable *msgb);
94  static int GimbalDarkReqChanged(void *pt, Variable *msgb);
95 
96  int send_gimbal_command(std::string com);
97  int update_gimbal();
98  //@}
99 
100  /** @name Master Remote Control
101  * VisAOIClient provides a master control over VisAO for supervisor
102  */
103  //@{
104  RTDBvar var_masterremote_req;
105  RTDBvar ccd47_cmode_req;
106  RTDBvar shutter_cmode_req;
107  RTDBvar fw2_cmode_req;
108  RTDBvar fw3_cmode_req;
109 
110  ///When notified, VisAOIClient changes the control mode of the entire VisAO Camera.
111  static int MasterRemoteReqChanged(void *pt, Variable *msgb);
112 
113  ///Change control of Gimbal, Focus, F/W2, F/W3, CCD47.
114  int setMasterRemote(int cmode);
115 
116  //@}
117 
118  ///Load the configuration details from the file
119  int LoadConfig();
120 
121  virtual void SetupVars();
122 
123  // VIRTUAL - Run
124  virtual void Run();
125 
126  virtual void post_update_DD_var(DD_RTDBVar &var);
127 
128  void update_loopon();
129 
130  void init_statusboard();
131  int update_statusboard();
132  void dump_statusboard();
133 
135  void update_recon();
136 
137  RTDBvar var_avgwfe;
138  RTDBvar var_stdwfe;
139  RTDBvar var_instwfe;
140 
141  int orient_useel;
142  int orient_usepa;
143 
144 
145 
146  public:
147  ///Log data at intervals
148  virtual void dataLogger(timeval tv);
149 
150 };
151 
152 
153 
154 
155 } //namespace VisAO
156 
157 #endif //__VisAOIClient_h__
int update_statusboard()
Update the status board.
virtual void dataLogger(timeval tv)
Log data at intervals.
The base class for VisAO applications.
Definition: VisAOApp_base.h:48
static int MasterRemoteReqChanged(void *pt, Variable *msgb)
When notified, VisAOIClient changes the control mode of the entire VisAO Camera.
Declarations for VisAOApp_base.
std::string fifo_path
The path to the fifos, relative to VISAO_ROOT.
Definition: VisAOIClient.h:26
int LoadConfig()
Load the configuration details from the file.
The namespace of VisAO software.
int setMasterRemote(int cmode)
Change control of Gimbal, Focus, F/W2, F/W3, CCD47.