Kstars

mosaic.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 mosaicDialog;
20 }
21 
22 namespace Ekos
23 {
24 class Scheduler;
25 class MosaicTilesManager;
26 class MosaicTilesScene;
27 
28 class Mosaic : public QDialog
29 {
30  Q_OBJECT
31 
32  public:
33  Mosaic(QString targetName, SkyPoint center, QWidget *parent = nullptr);
34  ~Mosaic() override;
35 
36  public:
37  Ui::mosaicDialog* ui { nullptr };
38 
39  void setCameraSize(uint16_t width, uint16_t height);
40  void setPixelSize(double pixelWSize, double pixelHSize);
41  void setFocalLength(double focalLength);
42  void setCenter(const SkyPoint &value);
43  QString getJobsDir() const;
44 
45  public:
46  typedef struct _Job
47  {
49  double rotation;
50  bool doAlign;
51  bool doFocus;
52  } Job;
53 
54  QList <Job> getJobs() const;
55 
56  protected:
57  virtual void showEvent(QShowEvent *) override;
58  virtual void resizeEvent(QResizeEvent *) override;
59 
60  /// @brief Camera information validity checker.
61  bool isScopeInfoValid() const;
62 
63  /// @brief Expected arcmin field width for the current number of tiles.
64  double getTargetWFOV() const;
65 
66  /// @brief Expected arcmin field height for the current number of tiles.
67  double getTargetHFOV() const;
68 
69  /// @brief Expected number of tiles for the current target field width.
70  double getTargetMosaicW() const;
71 
72  /// @brief Expected number of tiles for the current target field height.
73  double getTargetMosaicH() const;
74 
75  public slots:
76  void updateTargetFOVFromGrid();
77  void updateGridFromTargetFOV();
78  void constructMosaic();
79  void calculateFOV();
80  void updateTargetFOV();
81  void saveJobsDirectory();
82  void resetFOV();
83  void fetchINDIInformation();
84  void rewordStepEvery(int v);
85 
86  public slots:
87  virtual int exec() override;
88  virtual void accept() override;
89 
90  private:
91  SkyPoint m_CenterPoint;
92  QImage *m_skyChart { nullptr };
93 
94  QPixmap targetPix;
95  QGraphicsPixmapItem *m_SkyPixmapItem { nullptr };
96 
97  MosaicTilesManager *m_MosaicTilesManager { nullptr };
98 
99  double pixelsPerArcminRA { 0 }, pixelsPerArcminDE { 0 };
100  double renderedWFOV { 0 }, renderedHFOV { 0 };
101  double premosaicZoomFactor { 0 };
102 
103  QPointF screenPoint;
104  QGraphicsScene m_TilesScene;
105 
106  bool m_RememberAltAzOption {false}, m_RememberShowGround {false};
107 
108  QTimer *updateTimer { nullptr };
109 };
110 }
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
QTextStream & center(QTextStream &stream)
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Fri Aug 12 2022 04:00:55 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.