12#include <ekos_mount_debug.h>
15#include "indi/indistd.h"
16#include "indi/indimount.h"
43class MeridianFlipState :
public QObject
66 } MeridianFlipMountState;
81 typedef struct MountPosition {
83 ISD::Mount::PierSide pierSide;
89 bool resumeAlignmentAfterFlip() {
return m_resumeAlignmentAfterFlip; }
90 void setResumeAlignmentAfterFlip(
bool resume);
93 bool resumeGuidingAfterFlip() {
return m_resumeGuidingAfterFlip; }
94 void setResumeGuidingAfterFlip(
bool resume) { m_resumeGuidingAfterFlip = resume; }
99 static QString MFStageString(MFStage stage);
102 bool isEnabled()
const {
return m_enabled; }
103 void setEnabled(
bool value);
105 double getOffset()
const {
return m_offset; }
106 void setOffset(
double newOffset) { m_offset = newOffset; }
111 void connectMount(Mount *mount);
113 MeridianFlipState::MFStage getMeridianFlipStage()
const {
return meridianFlipStage; };
114 const QString &getMeridianStatusText()
116 return m_lastStatusText;
122 void updateMeridianFlipStage(
const MFStage &stage);
128 bool resetMeridianFlip();
133 void processFlipCompleted();
139 inline bool checkMeridianFlipRunning()
141 return meridianFlipStage == MF_INITIATED || meridianFlipStage == MF_FLIPPING;
147 inline bool checkMeridianFlipActive()
149 return meridianFlipStage != MF_NONE && meridianFlipStage != MF_REQUESTED;
156 void setTargetPosition(
SkyPoint *pos);
161 void clearTargetPosition() { targetPosition.valid =
false; }
168 double initialPositionHA()
const;
173 MeridianFlipMountState getMeridianFlipMountState()
const {
return meridianFlipMountState; }
175 double getFlipDelayHrs()
const {
return flipDelayHrs; }
176 void setFlipDelayHrs(
double value) { flipDelayHrs = value; }
181 void updateMFMountState(MeridianFlipState::MeridianFlipMountState status);
186 static QString meridianFlipStatusString(MeridianFlipMountState status);
189 void setMountConnected(
bool connected) { m_hasMount = connected; }
192 void setHasCaptureInterface(
bool present) { m_hasCaptureInterface = present; }
198 void setCaptureState(CaptureState state) { m_CaptureState = state; }
202 void setMountStatus(ISD::Mount::Status status);
206 void setMountParkStatus(ISD::ParkStatus status);
213 void updateTelescopeCoord(
const SkyPoint &position, ISD::Mount::PierSide pierSide,
const dms &ha);
217 void newMountMFStatus(MeridianFlipMountState status);
219 void newMeridianFlipMountStatusText(
const QString &text);
221 void slewTelescope(
SkyPoint &target);
223 void newLog(
const QString &text);
227 bool m_enabled =
false;
231 bool m_resumeAlignmentAfterFlip {
false };
233 bool m_resumeGuidingAfterFlip {
false };
236 bool m_hasMount {
false };
238 bool m_hasCaptureInterface {
false };
242 ISD::Mount::Status m_MountStatus = ISD::Mount::MOUNT_IDLE;
244 ISD::Mount::Status m_PrevMountStatus = ISD::Mount::MOUNT_IDLE;
246 ISD::ParkStatus m_MountParkStatus = ISD::PARK_UNKNOWN;
248 MFStage meridianFlipStage { MF_NONE };
251 MeridianFlipMountState meridianFlipMountState { MOUNT_FLIP_NONE };
258 MountPosition currentPosition;
260 MountPosition targetPosition;
262 static void updatePosition(MountPosition &pos,
const SkyPoint &position, ISD::Mount::PierSide pierSide,
const dms &ha,
const bool isValid);
268 double flipDelayHrs = 0.0;
273 void setMeridianFlipMountState(MeridianFlipMountState newMeridianFlipMountState);
279 bool checkMeridianFlip(
dms lst);
285 void startMeridianFlip();
290 void updateMinMeridianFlipEndTime();
295 void publishMFMountStatus(MeridianFlipMountState status);
300 void publishMFMountStatusText(
QString text);
305 void appendLogText(
QString message);
The sky coordinates of a point in the sky.
An angle, stored as degrees, but expressible in many ways.
Ekos is an advanced Astrophotography tool for Linux.
QObject * parent() const const