46 CalibrationDataFlipped,
48 LoopingExposuresStopped,
79 EQUIPMENT_DISCONNECTED,
97 CLEAR_CALIBRATION_COMMAND_RECEIVED,
98 DITHER_COMMAND_RECEIVED,
106 IS_EQUIPMENT_CONNECTED,
108 GET_CURRENT_EQUIPMENT,
123 GUIDE_COMMAND_RECEIVED,
129 SET_DEC_GUIDE_MODE_COMMAND_RECEIVED,
130 SET_EXPOSURE_COMMAND_RECEIVED,
134 SET_PAUSED_COMMAND_RECEIVED,
137 STOP_CAPTURE_COMMAND_RECEIVED
144 bool Connect()
override;
145 bool Disconnect()
override;
146 bool isConnected()
override
148 return (connection == CONNECTED || connection == EQUIPMENT_CONNECTED);
153 void captureSingleFrame();
154 bool clearCalibration()
override;
155 bool dither(
double pixels)
override;
160 void requestAppState();
163 void checkIfEquipmentConnected();
165 void requestCurrentEquipmentUpdate();
166 void checkDEGuideMode();
167 void requestExposureTime();
168 void requestExposureDurations();
169 void requestLockPosition();
173 void requestPixelScale();
178 void requestStarImage(
int size);
180 bool guide()
override;
185 void connectEquipment(
bool enable);
186 void requestSetDEGuideMode(
bool deEnabled,
bool nEnabled,
bool sEnabled);
187 void requestSetExposureTime(
int time);
188 void setLockPosition(
double x,
double y);
191 bool suspend()
override;
192 bool resume()
override;
195 bool abort()
override;
197 bool calibrate()
override;
202 return currentCamera;
210 return currentAuxMount;
213 bool isCurrentCameraNotInEkos()
215 return currentCameraIsNotInEkos;
217 void setCurrentCameraIsNotInEkos(
bool enable)
219 currentCameraIsNotInEkos = enable;
233 void sendRpcCall(
QJsonObject &call, PHD2ResultType resultType);
234 void sendNextRpcCall();
238 void processStarImage(
const QJsonObject &jsonStarFrame);
239 void processPHD2State(
const QString &phd2State);
240 void handlePHD2AppState(PHD2State state);
243 PHD2ResultType takeRequestFromList(
const QJsonObject &response);
252 PHD2ResultType pendingRpcResultType { NO_RESULT };
253 bool starImageRequested {
false };
258 PHD2ResultType resultType;
260 RpcCall(
const QJsonObject &call_, PHD2ResultType resultType_) : call(call_), resultType(resultType_) { }
264 PHD2State state { STOPPED };
265 bool isDitherActive {
false };
266 bool isSettling {
false };
267 PHD2Connection connection { DISCONNECTED };
268 PHD2Event
event { Alert };
269 uint8_t setConnectedRetries { 0 };
271 void setEquipmentConnected();
272 void updateGuideParameters();
273 void ResetConnectionState();
279 double pixelScale = 0;
286 bool currentCameraIsNotInEkos;
288 uint8_t m_PHD2ReconnectCounter {0};
291 static const uint32_t PHD2_RECONNECT_TIMEOUT {3000};
293 static const uint8_t PHD2_RECONNECT_THRESHOLD {10};