Changeset View
Changeset View
Standalone View
Standalone View
kstars/ekos/guide/externalguide/phd2.h
Show First 20 Lines • Show All 85 Lines • ▼ Show 20 Line(s) | 83 | { | |||
---|---|---|---|---|---|
86 | PHD2_EVENT, | 86 | PHD2_EVENT, | ||
87 | PHD2_ERROR, | 87 | PHD2_ERROR, | ||
88 | }; | 88 | }; | ||
89 | 89 | | |||
90 | // These are the PHD2 Results and the commands they are associated with | 90 | // These are the PHD2 Results and the commands they are associated with | ||
91 | enum PHD2ResultType | 91 | enum PHD2ResultType | ||
92 | { | 92 | { | ||
93 | NO_RESULT, | 93 | NO_RESULT, | ||
94 | //capture_single_frame | 94 | CAPTURE_SINGLE_FRAME, //capture_single_frame | ||
95 | CLEAR_CALIBRATION_COMMAND_RECEIVED, //clear_calibration | 95 | CLEAR_CALIBRATION_COMMAND_RECEIVED, //clear_calibration | ||
96 | DITHER_COMMAND_RECEIVED, //dither | 96 | DITHER_COMMAND_RECEIVED, //dither | ||
97 | //find_star | 97 | //find_star | ||
98 | //flip_calibration | 98 | //flip_calibration | ||
99 | //get_algo_param_names | 99 | //get_algo_param_names | ||
100 | //get_algo_param | 100 | //get_algo_param | ||
101 | //get_app_state | 101 | //get_app_state | ||
102 | //get_calibrated | 102 | //get_calibrated | ||
103 | //get_calibration_data | 103 | //get_calibration_data | ||
104 | IS_EQUIPMENT_CONNECTED, //get_connected | 104 | IS_EQUIPMENT_CONNECTED, //get_connected | ||
105 | //get_cooler_status | 105 | //get_cooler_status | ||
106 | //get_current_equipment | 106 | GET_CURRENT_EQUIPMENT, //get_current_equipment | ||
107 | DEC_GUIDE_MODE, //get_dec_guide_mode | 107 | DEC_GUIDE_MODE, //get_dec_guide_mode | ||
108 | EXPOSURE_TIME, //get_exposure | 108 | EXPOSURE_TIME, //get_exposure | ||
109 | EXPOSURE_DURATIONS, //get_exposure_durations | 109 | EXPOSURE_DURATIONS, //get_exposure_durations | ||
110 | //get_lock_position | 110 | LOCK_POSITION, //get_lock_position | ||
111 | //get_lock_shift_enabled | 111 | //get_lock_shift_enabled | ||
112 | //get_lock_shift_params | 112 | //get_lock_shift_params | ||
113 | //get_paused | 113 | //get_paused | ||
114 | PIXEL_SCALE, //get_pixel_scale | 114 | PIXEL_SCALE, //get_pixel_scale | ||
115 | //get_profile | 115 | //get_profile | ||
116 | //get_profiles | 116 | //get_profiles | ||
117 | //get_search_region | 117 | //get_search_region | ||
118 | //get_sensor_temperature | 118 | //get_sensor_temperature | ||
119 | STAR_IMAGE, //get_star_image | 119 | STAR_IMAGE, //get_star_image | ||
120 | //get_use_subframes | 120 | //get_use_subframes | ||
121 | GUIDE_COMMAND_RECEIVED, //guide | 121 | GUIDE_COMMAND_RECEIVED, //guide | ||
122 | //guide_pulse | 122 | //guide_pulse | ||
123 | //loop | 123 | LOOP, //loop | ||
124 | //save_image | 124 | //save_image | ||
125 | //set_algo_param | 125 | //set_algo_param | ||
126 | CONNECTION_RESULT, //set_connected | 126 | CONNECTION_RESULT, //set_connected | ||
127 | SET_DEC_GUIDE_MODE_COMMAND_RECEIVED, //set_dec_guide_mode | 127 | SET_DEC_GUIDE_MODE_COMMAND_RECEIVED, //set_dec_guide_mode | ||
128 | SET_EXPOSURE_COMMAND_RECEIVED, //set_exposure | 128 | SET_EXPOSURE_COMMAND_RECEIVED, //set_exposure | ||
129 | //set_lock_position | 129 | SET_LOCK_POSITION, //set_lock_position | ||
130 | //set_lock_shift_enabled | 130 | //set_lock_shift_enabled | ||
131 | //set_lock_shift_params | 131 | //set_lock_shift_params | ||
132 | SET_PAUSED_COMMAND_RECEIVED, //set_paused | 132 | SET_PAUSED_COMMAND_RECEIVED, //set_paused | ||
133 | //set_profile | 133 | //set_profile | ||
134 | //shutdown | 134 | //shutdown | ||
135 | STOP_CAPTURE_COMMAND_RECEIVED //stop_capture | 135 | STOP_CAPTURE_COMMAND_RECEIVED //stop_capture | ||
136 | }; | 136 | }; | ||
137 | 137 | | |||
138 | PHD2(); | 138 | PHD2(); | ||
139 | ~PHD2(); | 139 | ~PHD2(); | ||
140 | 140 | | |||
141 | //These are the connection methods to connect the external guide program PHD2 | 141 | //These are the connection methods to connect the external guide program PHD2 | ||
142 | bool Connect() override; | 142 | bool Connect() override; | ||
143 | bool Disconnect() override; | 143 | bool Disconnect() override; | ||
144 | bool isConnected() override | 144 | bool isConnected() override | ||
145 | { | 145 | { | ||
146 | return (connection == CONNECTED || connection == EQUIPMENT_CONNECTED); | 146 | return (connection == CONNECTED || connection == EQUIPMENT_CONNECTED); | ||
147 | } | 147 | } | ||
148 | 148 | | |||
149 | //These are the PHD2 Methods. Only some are implemented in Ekos. | 149 | //These are the PHD2 Methods. Only some are implemented in Ekos. | ||
150 | 150 | | |||
151 | //capture_single_frame | 151 | void captureSingleFrame(); //capture_single_frame | ||
152 | bool clearCalibration() override; //clear_calibration | 152 | bool clearCalibration() override; //clear_calibration | ||
153 | bool dither(double pixels) override; //dither | 153 | bool dither(double pixels) override; //dither | ||
154 | //find_star | 154 | //find_star | ||
155 | //flip_calibration | 155 | //flip_calibration | ||
156 | //get_algo_param_names | 156 | //get_algo_param_names | ||
157 | //get_algo_param | 157 | //get_algo_param | ||
158 | //get_app_state | 158 | //get_app_state | ||
159 | //get_calibrated | 159 | //get_calibrated | ||
160 | //get_calibration_data | 160 | //get_calibration_data | ||
161 | void checkIfEquipmentConnected(); //get_connected | 161 | void checkIfEquipmentConnected(); //get_connected | ||
162 | //get_cooler_status | 162 | //get_cooler_status | ||
163 | //get_current_equipment | 163 | void requestCurrentEquipmentUpdate(); //get_current_equipment | ||
164 | void checkDEGuideMode(); //get_dec_guide_mode | 164 | void checkDEGuideMode(); //get_dec_guide_mode | ||
165 | void requestExposureTime(); //get_exposure | 165 | void requestExposureTime(); //get_exposure | ||
166 | void requestExposureDurations(); //get_exposure_durations | 166 | void requestExposureDurations(); //get_exposure_durations | ||
167 | //get_lock_position | 167 | void requestLockPosition(); //get_lock_position | ||
168 | //get_lock_shift_enabled | 168 | //get_lock_shift_enabled | ||
169 | //get_lock_shift_params | 169 | //get_lock_shift_params | ||
170 | //get_paused | 170 | //get_paused | ||
171 | void requestPixelScale(); //get_pixel_scale | 171 | void requestPixelScale(); //get_pixel_scale | ||
172 | //get_profile | 172 | //get_profile | ||
173 | //get_profiles | 173 | //get_profiles | ||
174 | //get_search_region | 174 | //get_search_region | ||
175 | //get_sensor_temperature | 175 | //get_sensor_temperature | ||
176 | void requestStarImage(int size); //get_star_image | 176 | void requestStarImage(int size); //get_star_image | ||
177 | //get_use_subframes | 177 | //get_use_subframes | ||
178 | bool guide() override; //guide | 178 | bool guide() override; //guide | ||
179 | //guide_pulse | 179 | //guide_pulse | ||
180 | //loop | 180 | void loop(); //loop | ||
181 | //save_image | 181 | //save_image | ||
182 | //set_algo_param | 182 | //set_algo_param | ||
183 | void connectEquipment(bool enable);//set_connected | 183 | void connectEquipment(bool enable);//set_connected | ||
184 | void requestSetDEGuideMode(bool deEnabled, bool nEnabled, bool sEnabled); //set_dec_guide_mode | 184 | void requestSetDEGuideMode(bool deEnabled, bool nEnabled, bool sEnabled); //set_dec_guide_mode | ||
185 | void requestSetExposureTime(int time); //set_exposure | 185 | void requestSetExposureTime(int time); //set_exposure | ||
186 | //set_lock_position | 186 | void setLockPosition(double x, double y); //set_lock_position | ||
187 | //set_lock_shift_enabled | 187 | //set_lock_shift_enabled | ||
188 | //set_lock_shift_params | 188 | //set_lock_shift_params | ||
189 | bool suspend() override; //set_paused | 189 | bool suspend() override; //set_paused | ||
190 | bool resume() override; //set_paused | 190 | bool resume() override; //set_paused | ||
191 | //set_profile | 191 | //set_profile | ||
192 | //shutdown | 192 | //shutdown | ||
193 | bool abort() override; //stop_capture | 193 | bool abort() override; //stop_capture | ||
194 | 194 | | |||
195 | bool calibrate() override; //Note PHD2 does not have a separate calibrate command. This is unused. | 195 | bool calibrate() override; //Note PHD2 does not have a separate calibrate command. This is unused. | ||
196 | void setGuideView(FITSView *guideView); | 196 | void setGuideView(FITSView *guideView); | ||
197 | 197 | | |||
198 | QString getCurrentCamera(){ return currentCamera; } | ||||
199 | QString getCurrentMount(){ return currentMount; } | ||||
200 | QString getCurrentAuxMount(){ return currentAuxMount; } | ||||
201 | | ||||
198 | private slots: | 202 | private slots: | ||
199 | 203 | | |||
200 | void readPHD2(); | 204 | void readPHD2(); | ||
201 | void displayError(QAbstractSocket::SocketError socketError); | 205 | void displayError(QAbstractSocket::SocketError socketError); | ||
202 | 206 | | |||
203 | private: | 207 | private: | ||
204 | QPointer<FITSView> guideFrame; | 208 | QPointer<FITSView> guideFrame; | ||
205 | 209 | | |||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | |||||
248 | void ResetConnectionState(); | 252 | void ResetConnectionState(); | ||
249 | 253 | | |||
250 | QTimer *abortTimer; | 254 | QTimer *abortTimer; | ||
251 | QTimer *ditherTimer; | 255 | QTimer *ditherTimer; | ||
252 | 256 | | |||
253 | double pixelScale = 0; | 257 | double pixelScale = 0; | ||
254 | 258 | | |||
255 | QString logValidExposureTimes; | 259 | QString logValidExposureTimes; | ||
260 | | ||||
261 | QString currentCamera; | ||||
262 | QString currentMount; | ||||
263 | QString currentAuxMount; | ||||
264 | | ||||
256 | }; | 265 | }; | ||
257 | 266 | | |||
258 | } | 267 | } |