Kstars

mountmodel.h
1/* Ekos Mount Model
2 SPDX-FileCopyrightText: 2018 Robert Lancaster
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#pragma once
8
9
10#include "ui_mountmodel.h"
11#include "ekos/ekos.h"
12#include "skypoint.h"
13
14#include <QDialog>
15#include <QUrl>
16
18class SkyObject;
19class StarObject;
20
21namespace Ekos
22{
23
24class Align;
25
26class MountModel : public QDialog, public Ui::mountModel
27{
29
30 public:
31 explicit MountModel(Align *parent);
32 ~MountModel();
33
34 enum ModelObjectType
35 {
36 OBJECT_ANY_STAR,
37 OBJECT_NAMED_STAR,
38 OBJECT_ANY_OBJECT,
39 OBJECT_FIXED_DEC,
40 OBJECT_FIXED_GRID
41 };
42
43 void setTelescopeCoord(const SkyPoint &newCoord)
44 {
45 telescopeCoord = newCoord;
46 }
47
48 bool isRunning() const
49 {
50 return m_IsRunning;
51 }
52
53 void setAlignStatus(Ekos::AlignState state);
54
55 protected:
56 void slotWizardAlignmentPoints();
57 void slotStarSelected(const QString selectedStar);
58 void slotLoadAlignmentPoints();
59 void slotSaveAlignmentPoints();
60 void slotClearAllAlignPoints();
61 void slotRemoveAlignPoint();
62 void slotAddAlignPoint();
63 void slotFindAlignObject();
64 void resetAlignmentProcedure();
65 void startStopAlignmentProcedure();
66 void startAlignmentPoint();
67 void finishAlignmentPoint(bool solverSucceeded);
68 void moveAlignPoint(int logicalIndex, int oldVisualIndex, int newVisualIndex);
69 void alignTypeChanged(int alignType);
70 void togglePreviewAlignPoints();
71 void slotSortAlignmentPoints();
72
73
74 private:
75
76 void generateAlignStarList();
77 bool alignmentPointsAreBad();
78 bool loadAlignmentPoints(const QString &fileURL);
79 bool saveAlignmentPoints(const QString &path);
80
81 bool isVisible(const SkyObject *so);
82 double getAltitude(const SkyObject *so);
83 const SkyObject *getWizardAlignObject(double ra, double de);
84 void calculateAngleForRALine(double &raIncrement, double &initRA, double initDEC, double lat, double raPoints,
85 double minAlt);
86 void calculateAZPointsForDEC(dms dec, dms alt, dms &AZEast, dms &AZWest);
87 void updatePreviewAlignPoints();
88 int findNextAlignmentPointAfter(int currentSpot);
89 int findClosestAlignmentPointToTelescope();
90 void swapAlignPoints(int firstPt, int secondPt);
91
92 /**
93 * @brief Get formatted RA & DEC coordinates compatible with astrometry.net format.
94 * @param ra Right ascension
95 * @param dec Declination
96 * @param ra_str will contain the formatted RA string
97 * @param dec_str will contain the formatted DEC string
98 */
99 void getFormattedCoords(double ra, double dec, QString &ra_str, QString &dec_str);
100
101 signals:
102 void newLog(const QString &);
103 void aborted();
104
105 private:
106
107 Align *m_AlignInstance {nullptr};
108 int currentAlignmentPoint { 0 };
109 bool m_IsRunning { false };
110 bool previewShowing { false };
112 QUrl alignURL;
113 SkyPoint telescopeCoord;
114
115
116};
117}
The QProgressIndicator class lets an application display a progress indicator to show that a long tas...
Provides all necessary information about an object in the sky: its coordinates, name(s),...
Definition skyobject.h:42
The sky coordinates of a point in the sky.
Definition skypoint.h:45
This is a subclass of SkyObject.
Definition starobject.h:33
An angle, stored as degrees, but expressible in many ways.
Definition dms.h:38
Ekos is an advanced Astrophotography tool for Linux.
Definition align.cpp:83
AlignState
Definition ekos.h:145
Q_OBJECTQ_OBJECT
QObject * parent() const const
bool isVisible() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:04:45 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.