cut  1.2.1-pre1
QeRaDec.hpp
Go to the documentation of this file.
1 #ifndef QERADEC_H
2 #define QERADEC_H
3 
4 #include <QWidget>
5 #include <QtSvg>
6 #include <QSvgRenderer>
7 #include <QColor>
8 #include <QXmlStreamReader>
9 
20 class QeRaDec : public QWidget
21 {
22  Q_OBJECT
23 
28  Q_PROPERTY(double currentRa MEMBER m_currentRa READ getCurrentRa WRITE setCurrentRa NOTIFY currentRaChanged )
29 
30 
34  Q_PROPERTY(double currentDec MEMBER m_currentDec READ getCurrentDec WRITE setCurrentDec NOTIFY currentDecChanged )
35 
36 
40  Q_PROPERTY(double targetRa MEMBER m_targetRa READ getTargetRa WRITE setTargetRa NOTIFY targetRaChanged )
41 
42 
46  Q_PROPERTY(double targetDec MEMBER m_targetDec READ getTargetDec WRITE setTargetDec NOTIFY targetDecChanged )
47 
48 
52  Q_PROPERTY(double telescopeLat MEMBER m_telescopeLat READ getTelescopeLat WRITE setTelescopeLat NOTIFY telescopeLatChanged )
53 
54 
58  Q_PROPERTY(double telescopeLong MEMBER m_telescopeLong READ getTelescopeLong WRITE setTelescopeLong NOTIFY telescopeLongChanged )
59 
60 public:
61  explicit QeRaDec(QWidget *parent = nullptr);
62  double getCurrentRa(){ return m_currentRa; };
63  double getCurrentDec(){ return m_currentDec; };
64  double getTargetRa(){ return m_targetRa; };
65  double getTargetDec(){ return m_targetDec; };
66  double getTelescopeLat(){ return m_telescopeLat; };
67  double getTelescopeLong(){ return m_telescopeLong; };
68 
69 signals:
73  void currentRaChanged(double newValue);
74 
78  void currentDecChanged(double newValue);
79 
83  void targetRaChanged(double newValue);
84 
88  void targetDecChanged(double newValue);
89 
93  void telescopeLatChanged(double newValue);
94 
98  void telescopeLongChanged(double newValue);
99 
100 public slots:
101  void setCurrentRa(double newValue){ this->m_currentRa = newValue; this->update();} ;
102  void setCurrentDec (double newValue){ this->m_currentDec = newValue; this->update(); };
103  void setTargetRa(double newValue){ this->m_targetRa = newValue; this->update(); };
104  void setTargetDec(double newValue){ this->m_targetDec = newValue; this->update(); };
105  void setTelescopeLat (double newValue){ this->m_windDirection = newValue; this->update(); };
106  void setTelescopeLong(double newValue){ this->m_telescopeLat = newValue; this->update(); };
107 
108 protected:
109  void paintEvent(QPaintEvent *event);
110  void resizeEvent(QResizeEvent *event);
111 
112 private:
113  double m_currentRa = 0.0;
114  double m_currentDec = 0.0;
115  double m_targetRa = 0.0;
116  double m_targetDec = 0.0;
117  double m_windDirection = 0.0;
118  double m_telescopeLat = 0.0;
119  double m_telescopeLong = 0.0;
120  QSvgRenderer m_svg;
121  QString m_originalXml;
122  double m_ratio = 0.0;
123  const QString c_skyDayImagePath = ":/sky_day.svg";
124 
125  void updateColor();
126  QColor calculateColor();
127 };
128 
129 #endif // QERADEC_H
QeRaDec::getTelescopeLat
double getTelescopeLat()
Definition: QeRaDec.hpp:66
QeRaDec::getTelescopeLong
double getTelescopeLong()
Definition: QeRaDec.hpp:67
QeRaDec::setTargetRa
void setTargetRa(double newValue)
Definition: QeRaDec.hpp:103
QeRaDec::paintEvent
void paintEvent(QPaintEvent *event)
Definition: QeRaDec.cpp:29
QeRaDec::targetDec
double targetDec
Declination coordinate of the target position in radians.
Definition: QeRaDec.hpp:46
QeRaDec::setCurrentRa
void setCurrentRa(double newValue)
Definition: QeRaDec.hpp:101
QeRaDec::resizeEvent
void resizeEvent(QResizeEvent *event)
Definition: QeRaDec.cpp:85
QeRaDec::getCurrentDec
double getCurrentDec()
Definition: QeRaDec.hpp:63
QeRaDec::getTargetDec
double getTargetDec()
Definition: QeRaDec.hpp:65
QeRaDec::currentRa
double currentRa
Right Ascension coordinate of the current position in radians.
Definition: QeRaDec.hpp:28
QeRaDec::getTargetRa
double getTargetRa()
Definition: QeRaDec.hpp:64
QeRaDec::currentDecChanged
void currentDecChanged(double newValue)
Indicates a change in the declination coordinate for the current position.
QeRaDec::QeRaDec
QeRaDec(QWidget *parent=nullptr)
Definition: QeRaDec.cpp:8
QeRaDec::telescopeLong
double telescopeLong
Longitude coordinate of the telescope @accessors getTelescopeLong(), setTelescopeLong(double)
Definition: QeRaDec.hpp:58
QeRaDec::targetRa
double targetRa
Right Ascension coordinate of the target position in radians.
Definition: QeRaDec.hpp:40
QeRaDec::targetDecChanged
void targetDecChanged(double newValue)
Indicates a change in the declination coordinate for the target position.
QeRaDec::setTelescopeLong
void setTelescopeLong(double newValue)
Definition: QeRaDec.hpp:106
QeRaDec::setTargetDec
void setTargetDec(double newValue)
Definition: QeRaDec.hpp:104
QeRaDec::getCurrentRa
double getCurrentRa()
Definition: QeRaDec.hpp:62
QeRaDec::telescopeLongChanged
void telescopeLongChanged(double newValue)
Indicates a change in the telescope longitude coordinate.
QeRaDec::telescopeLat
double telescopeLat
Latitude coordinate of the telescope @accessors getTelescopeLat(), setTelescopeLat(double)
Definition: QeRaDec.hpp:52
QeRaDec::setTelescopeLat
void setTelescopeLat(double newValue)
Definition: QeRaDec.hpp:105
QeRaDec::setCurrentDec
void setCurrentDec(double newValue)
Definition: QeRaDec.hpp:102
QeRaDec
A widget that renders two set of RA/Dec coordinates using cylindrical projection.
Definition: QeRaDec.hpp:21
QeRaDec::targetRaChanged
void targetRaChanged(double newValue)
Indicates a change in the right ascension coordinate for the target position.
QeRaDec::currentDec
double currentDec
Declination coordinate of the current position in radians.
Definition: QeRaDec.hpp:34
QeRaDec::telescopeLatChanged
void telescopeLatChanged(double newValue)
Indicates a change in the telescope latitude coordinate.
QeRaDec::currentRaChanged
void currentRaChanged(double newValue)
Indicates a change in the right ascension coordinate for the current position.
cut-test-performance-python-datapoints.update
def update(number, ups, timeout, datatype, instance)
Definition: cut-test-performance-python-datapoints.py:69