Changeset View
Changeset View
Standalone View
Standalone View
kstars/ekos/guide/externalguide/linguider.cpp
Context not available. | |||||
44 | } | 44 | } | ||
---|---|---|---|---|---|
45 | // Already connected, let's connect equipment | 45 | // Already connected, let's connect equipment | ||
46 | else | 46 | else | ||
47 | emit newStatus(GUIDE_CONNECTED); | 47 | emit newStatus(Ekos::GuideState::GUIDE_CONNECTED); | ||
48 | 48 | | |||
49 | return true; | 49 | return true; | ||
50 | } | 50 | } | ||
Context not available. | |||||
55 | connection = DISCONNECTED; | 55 | connection = DISCONNECTED; | ||
56 | tcpSocket->disconnectFromHost(); | 56 | tcpSocket->disconnectFromHost(); | ||
57 | 57 | | |||
58 | emit newStatus(GUIDE_DISCONNECTED); | 58 | emit newStatus(Ekos::GuideState::GUIDE_DISCONNECTED); | ||
59 | 59 | | |||
60 | return true; | 60 | return true; | ||
61 | } | 61 | } | ||
Context not available. | |||||
68 | break; | 68 | break; | ||
69 | case QAbstractSocket::HostNotFoundError: | 69 | case QAbstractSocket::HostNotFoundError: | ||
70 | emit newLog(i18n("The host was not found. Please check the host name and port settings in Guide options.")); | 70 | emit newLog(i18n("The host was not found. Please check the host name and port settings in Guide options.")); | ||
71 | emit newStatus(GUIDE_DISCONNECTED); | 71 | emit newStatus(Ekos::GuideState::GUIDE_DISCONNECTED); | ||
72 | break; | 72 | break; | ||
73 | case QAbstractSocket::ConnectionRefusedError: | 73 | case QAbstractSocket::ConnectionRefusedError: | ||
74 | emit newLog(i18n("The connection was refused by the peer. Make sure the LinGuider is running, and check " | 74 | emit newLog(i18n("The connection was refused by the peer. Make sure the LinGuider is running, and check " | ||
75 | "that the host name and port settings are correct.")); | 75 | "that the host name and port settings are correct.")); | ||
76 | emit newStatus(GUIDE_DISCONNECTED); | 76 | emit newStatus(Ekos::GuideState::GUIDE_DISCONNECTED); | ||
77 | break; | 77 | break; | ||
78 | default: | 78 | default: | ||
79 | emit newLog(i18n("The following error occurred: %1.", tcpSocket->errorString())); | 79 | emit newLog(i18n("The following error occurred: %1.", tcpSocket->errorString())); | ||
Context not available. | |||||
128 | if (reply == "Error: Guiding not started.") | 128 | if (reply == "Error: Guiding not started.") | ||
129 | { | 129 | { | ||
130 | state = IDLE; | 130 | state = IDLE; | ||
131 | emit newStatus(GUIDE_ABORTED); | 131 | emit newStatus(Ekos::GuideState::GUIDE_ABORTED); | ||
132 | deviationTimer.stop(); | 132 | deviationTimer.stop(); | ||
133 | return; | 133 | return; | ||
134 | } | 134 | } | ||
Context not available. | |||||
151 | if (reply == "GUIDING") | 151 | if (reply == "GUIDING") | ||
152 | { | 152 | { | ||
153 | state = GUIDING; | 153 | state = GUIDING; | ||
154 | emit newStatus(GUIDE_GUIDING); | 154 | emit newStatus(Ekos::GuideState::GUIDE_GUIDING); | ||
155 | deviationTimer.start(); | 155 | deviationTimer.start(); | ||
156 | } | 156 | } | ||
157 | else | 157 | else | ||
Context not available. | |||||
173 | else | 173 | else | ||
174 | { | 174 | { | ||
175 | emit newLog(i18n("Failed to process star position.")); | 175 | emit newLog(i18n("Failed to process star position.")); | ||
176 | emit newStatus(GUIDE_CALIBRATION_ERROR); | 176 | emit newStatus(Ekos::GuideState::GUIDE_CALIBRATION_ERROR); | ||
177 | } | 177 | } | ||
178 | } | 178 | } | ||
179 | break; | 179 | break; | ||
Context not available. | |||||
186 | else | 186 | else | ||
187 | { | 187 | { | ||
188 | emit newLog(i18n("Failed to set guider reticle position.")); | 188 | emit newLog(i18n("Failed to set guider reticle position.")); | ||
189 | emit newStatus(GUIDE_CALIBRATION_ERROR); | 189 | emit newStatus(Ekos::GuideState::GUIDE_CALIBRATION_ERROR); | ||
190 | } | 190 | } | ||
191 | break; | 191 | break; | ||
192 | 192 | | |||
193 | case SET_GUIDER_SQUARE_POS: | 193 | case SET_GUIDER_SQUARE_POS: | ||
194 | if (reply == "OK") | 194 | if (reply == "OK") | ||
195 | { | 195 | { | ||
196 | emit newStatus(GUIDE_CALIBRATION_SUCESS); | 196 | emit newStatus(Ekos::GuideState::GUIDE_CALIBRATION_SUCESS); | ||
197 | } | 197 | } | ||
198 | else | 198 | else | ||
199 | { | 199 | { | ||
200 | emit newLog(i18n("Failed to set guider square position.")); | 200 | emit newLog(i18n("Failed to set guider square position.")); | ||
201 | emit newStatus(GUIDE_CALIBRATION_ERROR); | 201 | emit newStatus(Ekos::GuideState::GUIDE_CALIBRATION_ERROR); | ||
202 | } | 202 | } | ||
203 | break; | 203 | break; | ||
204 | 204 | | |||
Context not available. | |||||
207 | { | 207 | { | ||
208 | if (state == IDLE) | 208 | if (state == IDLE) | ||
209 | { | 209 | { | ||
210 | emit newStatus(GUIDE_GUIDING); | 210 | emit newStatus(Ekos::GuideState::GUIDE_GUIDING); | ||
211 | state = GUIDING; | 211 | state = GUIDING; | ||
212 | 212 | | |||
213 | deviationTimer.start(); | 213 | deviationTimer.start(); | ||
214 | } | 214 | } | ||
215 | else | 215 | else | ||
216 | { | 216 | { | ||
217 | emit newStatus(GUIDE_IDLE); | 217 | emit newStatus(Ekos::GuideState::GUIDE_IDLE); | ||
218 | state = IDLE; | 218 | state = IDLE; | ||
219 | 219 | | |||
220 | deviationTimer.stop(); | 220 | deviationTimer.stop(); | ||
Context not available. | |||||
234 | if (state != GUIDING) | 234 | if (state != GUIDING) | ||
235 | { | 235 | { | ||
236 | state = GUIDING; | 236 | state = GUIDING; | ||
237 | emit newStatus(GUIDE_GUIDING); | 237 | emit newStatus(Ekos::GuideState::GUIDE_GUIDING); | ||
238 | } | 238 | } | ||
239 | 239 | | |||
240 | QStringList pos = reply.split(' '); | 240 | QStringList pos = reply.split(' '); | ||
Context not available. | |||||
270 | 270 | | |||
271 | case DITHER: | 271 | case DITHER: | ||
272 | if (reply == "Long time cmd finished") | 272 | if (reply == "Long time cmd finished") | ||
273 | emit newStatus(GUIDE_DITHERING_SUCCESS); | 273 | emit newStatus(Ekos::GuideState::GUIDE_DITHERING_SUCCESS); | ||
274 | else | 274 | else | ||
275 | emit newStatus(GUIDE_DITHERING_ERROR); | 275 | emit newStatus(Ekos::GuideState::GUIDE_DITHERING_ERROR); | ||
276 | 276 | | |||
277 | state = GUIDING; | 277 | state = GUIDING; | ||
278 | deviationTimer.start(); | 278 | deviationTimer.start(); | ||
Context not available. | |||||
287 | { | 287 | { | ||
288 | connection = CONNECTED; | 288 | connection = CONNECTED; | ||
289 | 289 | | |||
290 | emit newStatus(GUIDE_CONNECTED); | 290 | emit newStatus(Ekos::GuideState::GUIDE_CONNECTED); | ||
291 | // Get version | 291 | // Get version | ||
292 | 292 | | |||
293 | sendCommand(GET_VER); | 293 | sendCommand(GET_VER); | ||
Context not available. | |||||
323 | bool LinGuider::calibrate() | 323 | bool LinGuider::calibrate() | ||
324 | { | 324 | { | ||
325 | // Let's start calibraiton. It is already calibrated but in this step we auto-select and star and set the square | 325 | // Let's start calibraiton. It is already calibrated but in this step we auto-select and star and set the square | ||
326 | emit newStatus(Ekos::GUIDE_CALIBRATING); | 326 | emit newStatus(Ekos::GuideState::GUIDE_CALIBRATING); | ||
327 | 327 | | |||
328 | sendCommand(FIND_STAR); | 328 | sendCommand(FIND_STAR); | ||
329 | 329 | | |||
Context not available. |