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

KDE's Doxygen guidelines are available online.