Kstars

framingassistant.h
1 /*
2  SPDX-FileCopyrightText: 2015 Jasem Mutlaq <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include "skypoint.h"
10 
11 #include <QGraphicsScene>
12 #include <QGraphicsItem>
13 #include <QDialog>
14 #include <QBrush>
15 #include <QPen>
16 
17 namespace Ui
18 {
19 class FramingAssistant;
20 }
21 
22 namespace Ekos
23 {
24 class Scheduler;
25 class MosaicTilesManager;
26 class MosaicTilesScene;
27 
28 class FramingAssistant : public QDialog
29 {
30  Q_OBJECT
31  Q_PROPERTY(double focalLength MEMBER m_FocalLength)
32  Q_PROPERTY(double overlap MEMBER m_Overlap)
33  Q_PROPERTY(double rotation MEMBER m_Rotation)
34  Q_PROPERTY(QSize cameraSize MEMBER m_CameraSize)
35  Q_PROPERTY(QSizeF pixelSize MEMBER m_PixelSize)
36  Q_PROPERTY(QSize gridSize MEMBER m_GridSize)
37 
38  public:
39  static FramingAssistant *Instance();
40 
41  public:
42  Ui::FramingAssistant* ui { nullptr };
43 
44  void setCenter(const SkyPoint &value);
45  QString getJobsDir() const;
46  void syncModelToGUI();
47  void syncGUIToModel();
48 
49  public:
50  typedef struct _Job
51  {
53  double rotation;
54  bool doAlign;
55  bool doFocus;
56  } Job;
57 
58  QList <Job> getJobs() const;
59 
60  protected:
61  virtual void showEvent(QShowEvent *) override;
62  virtual void resizeEvent(QResizeEvent *) override;
63 
64  /// @brief Camera information validity checker.
65  bool isScopeInfoValid() const;
66 
67  /// @brief Expected arcmin field width for the current number of tiles.
68  double getTargetWFOV() const;
69 
70  /// @brief Expected arcmin field height for the current number of tiles.
71  double getTargetHFOV() const;
72 
73  /// @brief Expected number of tiles for the current target field width.
74  double getTargetMosaicW() const;
75 
76  /// @brief Expected number of tiles for the current target field height.
77  double getTargetMosaicH() const;
78 
79  /**
80  * @brief goAndSolve Go to current center, capture an image, and solve.
81  */
82  void goAndSolve();
83 
84  public slots:
85  void updateTargetFOVFromGrid();
86  void updateGridFromTargetFOV();
87  void constructMosaic();
88  void calculateFOV();
89  void updateTargetFOV();
90  void saveJobsDirectory();
91  void resetFOV();
92  void fetchINDIInformation();
93  void rewordStepEvery(int v);
94 
95  private:
96 
97  FramingAssistant();
98  ~FramingAssistant() override;
99 
100  static FramingAssistant *_FramingAssistant;
101 
102  SkyPoint m_CenterPoint;
103  QImage *m_skyChart { nullptr };
104 
105  QPixmap targetPix;
106  QGraphicsPixmapItem *m_SkyPixmapItem { nullptr };
107 
108  MosaicTilesManager *m_MosaicTilesManager { nullptr };
109 
110  double pixelsPerArcminRA { 0 }, pixelsPerArcminDE { 0 };
111  double renderedWFOV { 0 }, renderedHFOV { 0 };
112  double premosaicZoomFactor { 0 };
113 
114  QPointF screenPoint;
115  QGraphicsScene m_TilesScene;
116 
117  bool m_RememberAltAzOption {false}, m_RememberShowGround {false};
118 
119  QTimer *updateTimer { nullptr };
120 
121  // Equipment
122  double m_FocalLength {0};
123  QSize m_CameraSize;
124  QSizeF m_PixelSize, m_cameraFOV, m_MosaicFOV;
125  QSize m_GridSize {1,1};
126  double m_Overlap {10}, m_Rotation {0};
127 };
128 }
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
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
QTextStream & center(QTextStream &stream)
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Mon Aug 8 2022 04:13:20 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.