cut 3.3.0
Loading...
Searching...
No Matches
QeRaDec.hpp
1#ifndef QERADEC_H
2#define QERADEC_H
3
4#include <QWidget>
5#include <QtSvg/QtSvg>
6#include <QtSvg/QSvgRenderer>
7#include <QColor>
8#include <QXmlStreamReader>
9#include <QSize>
10
21class QeRaDec : public QWidget
22{
23 Q_OBJECT
24
29 Q_PROPERTY(double currentRa READ getCurrentRa WRITE setCurrentRa NOTIFY currentRaChanged )
30
31
35 Q_PROPERTY(double currentDec READ getCurrentDec WRITE setCurrentDec NOTIFY currentDecChanged )
36
41 Q_PROPERTY(double targetRa READ getTargetRa WRITE setTargetRa NOTIFY targetRaChanged )
42
47 Q_PROPERTY(double targetDec READ getTargetDec WRITE setTargetDec NOTIFY targetDecChanged )
48
53 Q_PROPERTY(double telescopeLat READ getTelescopeLat WRITE setTelescopeLat NOTIFY telescopeLatChanged )
54
59 Q_PROPERTY(double telescopeLong READ getTelescopeLong WRITE setTelescopeLong NOTIFY telescopeLongChanged )
60
61public:
62 explicit QeRaDec(QWidget *parent = nullptr);
63 double getCurrentRa(){ return m_currentRa; };
64 double getCurrentDec(){ return m_currentDec; };
65 double getTargetRa(){ return m_targetRa; };
66 double getTargetDec(){ return m_targetDec; };
67 double getTelescopeLat(){ return m_telescopeLat; };
68 double getTelescopeLong(){ return m_telescopeLong; };
69
70signals:
74 void currentRaChanged(double newValue);
75
79 void currentDecChanged(double newValue);
80
84 void targetRaChanged(double newValue);
85
89 void targetDecChanged(double newValue);
90
94 void telescopeLatChanged(double newValue);
95
99 void telescopeLongChanged(double newValue);
100
101public slots:
102 void setCurrentRa(double newValue){ this->m_currentRa = newValue; emit currentRaChanged(newValue); this->update();} ;
103 void setCurrentDec (double newValue){ this->m_currentDec = newValue; emit currentDecChanged(newValue); this->update(); };
104 void setTargetRa(double newValue){ this->m_targetRa = newValue; emit targetRaChanged(newValue); this->update(); };
105 void setTargetDec(double newValue){ this->m_targetDec = newValue; emit targetDecChanged(newValue); this->update(); };
106 void setTelescopeLat (double newValue){ this->m_windDirection = newValue; emit telescopeLatChanged(newValue); this->update(); };
107 void setTelescopeLong(double newValue){ this->m_telescopeLat = newValue; emit telescopeLongChanged(newValue); this->update(); };
108
109protected:
110 void paintEvent(QPaintEvent *event) override;
111 void resizeEvent(QResizeEvent *event) override;
112 QSize sizeHint() const override;
113
114private:
115 double m_currentRa = 0.0;
116 double m_currentDec = 0.0;
117 double m_targetRa = 0.0;
118 double m_targetDec = 0.0;
119 double m_windDirection = 0.0;
120 double m_telescopeLat = 0.0;
121 double m_telescopeLong = 0.0;
122 QSvgRenderer m_svg;
123 QString m_originalXml;
124 double m_ratio = 0.0;
125 const QString c_skyDayImagePath = ":/sky_day.svg";
126
127 void updateColor();
128 QColor calculateColor();
129 void prepareSizes();
130};
131
132#endif // QERADEC_H
double currentDec
Declination coordinate of the current position in radians.
Definition QeRaDec.hpp:35
double currentRa
Right Ascension coordinate of the current position in radians.
Definition QeRaDec.hpp:29
void telescopeLongChanged(double newValue)
Indicates a change in the telescope longitude coordinate.
double telescopeLong
Longitude coordinate of the telescope.
Definition QeRaDec.hpp:59
void telescopeLatChanged(double newValue)
Indicates a change in the telescope latitude coordinate.
double telescopeLat
Latitude coordinate of the telescope.
Definition QeRaDec.hpp:53
void currentRaChanged(double newValue)
Indicates a change in the right ascension coordinate for the current position.
void targetDecChanged(double newValue)
Indicates a change in the declination coordinate for the target position.
void targetRaChanged(double newValue)
Indicates a change in the right ascension coordinate for the target position.
double targetDec
Declination coordinate of the target position in radians.
Definition QeRaDec.hpp:47
void currentDecChanged(double newValue)
Indicates a change in the declination coordinate for the current position.
double targetRa
Right Ascension coordinate of the target position in radians.
Definition QeRaDec.hpp:41