Kstars

calibrationprocess.h
1/* Ekos Internal Guider Class
2 Copyright (C) 2016 Jasem Mutlaq <mutlaqja@ikarustech.com>.
3
4 Based on lin_guider
5
6 SPDX-License-Identifier: GPL-2.0-or-later
7*/
8
9#pragma once
10
11#include "indi/indicommon.h"
12#include "../guideinterface.h"
13#include "calibration.h"
14
15#include <QFile>
16#include <QPointer>
17#include <QQueue>
18#include <QTime>
19
20#include <memory>
21
22class QVector3D;
23class GuideView;
24class Edge;
25class GuideLog;
26
27namespace Ekos
28{
29class CalibrationProcess
30{
31 public:
32 enum CalibrationStage
33 {
34 CAL_IDLE,
35 CAL_ERROR,
36 CAL_CAPTURE_IMAGE,
37 CAL_SELECT_STAR,
38 CAL_START,
39 CAL_RA_INC,
40 CAL_RA_DEC,
41 CAL_DEC_INC,
42 CAL_DEC_DEC,
43 CAL_BACKLASH
44 };
45 enum CalibrationType
46 {
47 CAL_NONE,
48 CAL_RA_AUTO,
49 CAL_RA_DEC_AUTO
50 };
51
52 CalibrationProcess(double startX, double startY, bool raOnly);
53 ~CalibrationProcess() {}
54
55 void useCalibration(Calibration *calibrationPtr);
56 bool inProgress() const;
57
58 void startup();
59 void setGuideLog(GuideLog *guideLogPtr);
60
61 void iterate(double x, double y);
62
63 // Return values from each iteration.
64 void getCalibrationUpdate(
65 GuideInterface::CalibrationUpdateType *type,
66 QString *message, double *x, double *y) const;
67 void getPulse(GuideDirection *dir, int *msecs) const;
68 QString getLogStatus() const;
69 Ekos::GuideState getStatus() const;
70
71 private:
72 void initializeIteration();
73
74 // Methods corresponding to each calibration state.
75 void startState();
76 void raOutState(double cur_x, double cur_y);
77 void raInState(double cur_x, double cur_y);
78 void decBacklashState(double cur_x, double cur_y);
79 void decOutState(double cur_x, double cur_y);
80 void decInState(double cur_x, double cur_y);
81
82 // Setup the return values from each iteration.
83 void addCalibrationUpdate(GuideInterface::CalibrationUpdateType type,
84 QString message, double x = 0, double y = 0);
85
86 void addPulse(GuideDirection dir, int msecs);
87 void addLogStatus(const QString &status);
88 void addStatus(Ekos::GuideState s);
89
90 // calibration parameters
91 int maximumSteps { 5 };
92 int turn_back_time { 0 };
93 int ra_iterations { 0 };
94 int dec_iterations { 0 };
95 int backlash_iterations { 0 };
96 int last_pulse { 0 };
97 int ra_total_pulse { 0 };
98 int de_total_pulse { 0 };
99 uint8_t backlash { 0 };
100
101 // calibration coordinates
102 double start_x1 { 0 };
103 double start_y1 { 0 };
104 double end_x1 { 0 };
105 double end_y1 { 0 };
106 double start_x2 { 0 };
107 double start_y2 { 0 };
108 double end_x2 { 0 };
109 double end_y2 { 0 };
110 double last_x { 0 };
111 double last_y { 0 };
112 double ra_distance {0};
113 double de_distance {0};
114 double start_backlash_x { 0 };
115 double start_backlash_y { 0 };
116
117 CalibrationStage calibrationStage { CAL_IDLE };
118 CalibrationType calibrationType;
119
120 Calibration *calibration = nullptr;
121 Calibration tempCalibration;
122 bool raOnly = false;
123 GuideLog *guideLog = nullptr;
124
125 // Return values from each iteration.
126 // Most of these result in emits in internalguider.cpp
127 bool axisCalibrationComplete = false;
128 QString logString;
129 GuideInterface::CalibrationUpdateType updateType;
130 QString calibrationUpdate;
131 double updateX, updateY;
132 Ekos::GuideState status;
133 GuideDirection pulseDirection;
134 int pulseMsecs = 0;
135};
136}
The main change relative to fitsview is to add the capability of displaying the 'neighbor guide stars...
Definition guideview.h:22
Ekos is an advanced Astrophotography tool for Linux.
Definition align.cpp:78
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:19:02 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.