Kstars

framingassistant.h
1/*
2 SPDX-FileCopyrightText: 2015 Jasem Mutlaq <mutlaqja@ikarustech.com>
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
17namespace Ui
18{
19class FramingAssistant;
20}
21
22namespace Ekos
23{
24class Scheduler;
25class MosaicTilesManager;
26class MosaicTilesScene;
27
28class FramingAssistant : public QDialog
29{
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 {
52 SkyPoint center;
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}
The sky coordinates of a point in the sky.
Definition skypoint.h:45
Ekos is an advanced Astrophotography tool for Linux.
Definition align.cpp:83
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:38:43 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.