1 /* 2 SPDX-FileCopyrightText: 2003 Jason Harris <kstars@30doradus.org> 3 4 SPDX-License-Identifier: GPL-2.0-or-later 5 */ 6 7 #ifndef FOVDIALOG_H_ 8 #define FOVDIALOG_H_ 9 10 #include <QPaintEvent> 11 #include <QDialog> 12 #include <QDoubleSpinBox> 13 14 #include "fov.h" 15 #include "ui_fovdialog.h" 16 #include "ui_newfov.h" 17 18 class FOVDialogUI : public QFrame, public Ui::FOVDialog 19 { 20 Q_OBJECT 21 public: 22 explicit FOVDialogUI(QWidget *parent = nullptr); 23 }; 24 25 class NewFOVUI : public QFrame, public Ui::NewFOV 26 { 27 Q_OBJECT 28 public: 29 explicit NewFOVUI(QWidget *parent = nullptr); 30 }; 31 32 /** @class FOVDialog 33 * FOVDialog is dialog to select a Field-of-View indicator (or create a new one) 34 *@author Jason Harris 35 *@version 1.0 36 */ 37 class FOVDialog : public QDialog 38 { 39 Q_OBJECT 40 public: 41 explicit FOVDialog(QWidget *parent = nullptr); 42 ~FOVDialog() override; 43 private slots: 44 void slotNewFOV(); 45 void slotEditFOV(); 46 void slotRemoveFOV(); 47 void slotSelect(int); 48 49 private: 50 /** Add new widget to list box */ 51 QListWidgetItem *addListWidget(FOV *f); 52 53 unsigned int currentItem() const; 54 FOVDialogUI *fov; 55 static int fovID; 56 }; 57 58 /** @class NewFOV 59 * Dialog for defining a new FOV symbol 60 *@author Jason Harris 61 *@version 1.0 62 */ 63 class NewFOV : public QDialog 64 { 65 Q_OBJECT 66 public: 67 /** Create new dialog 68 * @param parent parent widget 69 * @param fov widget to copy data from. If it's empty will create empty one. 70 */ 71 explicit NewFOV(QWidget *parent = nullptr, const FOV *fov = nullptr); 72 ~NewFOV() override = default; 73 /** Return reference to FOV. */ getFOV()74 const FOV &getFOV() const 75 { 76 return f; 77 } 78 79 public slots: 80 void slotBinocularFOVDistanceChanged(int index); 81 void slotUpdateFOV(); 82 void slotComputeFOV(); 83 void slotEyepieceAFOVChanged(int index); 84 void slotComputeTelescopeFL(); 85 void slotDetectFromINDI(); 86 87 private: 88 FOV f; 89 NewFOVUI *ui; 90 QPushButton *okB; 91 }; 92 93 /** 94 *@class TelescopeFL 95 *Dialog for calculating telescope focal length from f-number and diameter 96 *@author Akarsh Simha 97 *@version 1.0 98 */ 99 100 class TelescopeFL : public QDialog 101 { 102 Q_OBJECT 103 public: 104 /** 105 * Create a telescope focal length dialog 106 * @param parent parent widget 107 */ 108 explicit TelescopeFL(QWidget *parent = nullptr); 109 110 ~TelescopeFL() override = default; 111 112 /** 113 * Compute and return the focal length in mm 114 * @return focal length in mm 115 */ 116 double computeFL() const; 117 118 private: 119 QDoubleSpinBox *aperture, *fNumber; 120 QComboBox *apertureUnit; 121 }; 122 123 #endif 124