cut  1.2.2-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 #include <QSize>
10 
21 class QeRaDec : public QWidget
22 {
23  Q_OBJECT
24 
29  Q_PROPERTY(double currentRa MEMBER m_currentRa READ getCurrentRa WRITE setCurrentRa NOTIFY currentRaChanged )
30 
31 
35  Q_PROPERTY(double currentDec MEMBER m_currentDec READ getCurrentDec WRITE setCurrentDec NOTIFY currentDecChanged )
36 
37 
41  Q_PROPERTY(double targetRa MEMBER m_targetRa READ getTargetRa WRITE setTargetRa NOTIFY targetRaChanged )
42 
43 
47  Q_PROPERTY(double targetDec MEMBER m_targetDec READ getTargetDec WRITE setTargetDec NOTIFY targetDecChanged )
48 
49 
53  Q_PROPERTY(double telescopeLat MEMBER m_telescopeLat READ getTelescopeLat WRITE setTelescopeLat NOTIFY telescopeLatChanged )
54 
55 
59  Q_PROPERTY(double telescopeLong MEMBER m_telescopeLong READ getTelescopeLong WRITE setTelescopeLong NOTIFY telescopeLongChanged )
60 
61 public:
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 
70 signals:
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 
101 public 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 
109 protected:
110  void paintEvent(QPaintEvent *event);
111  void resizeEvent(QResizeEvent *event);
112  QSize sizeHint();
113 
114 private:
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
QeRaDec::getTelescopeLat
double getTelescopeLat()
Definition: QeRaDec.hpp:67
QeRaDec::getTelescopeLong
double getTelescopeLong()
Definition: QeRaDec.hpp:68
QeRaDec::setTargetRa
void setTargetRa(double newValue)
Definition: QeRaDec.hpp:104
QeRaDec::paintEvent
void paintEvent(QPaintEvent *event)
Definition: QeRaDec.cpp:33
QeRaDec::targetDec
double targetDec
Declination coordinate of the target position in radians.
Definition: QeRaDec.hpp:47
QeRaDec::setCurrentRa
void setCurrentRa(double newValue)
Definition: QeRaDec.hpp:102
QeRaDec::resizeEvent
void resizeEvent(QResizeEvent *event)
Definition: QeRaDec.cpp:116
QeRaDec::getCurrentDec
double getCurrentDec()
Definition: QeRaDec.hpp:64
QeRaDec::getTargetDec
double getTargetDec()
Definition: QeRaDec.hpp:66
QeRaDec::currentRa
double currentRa
Right Ascension coordinate of the current position in radians.
Definition: QeRaDec.hpp:29
QeRaDec::getTargetRa
double getTargetRa()
Definition: QeRaDec.hpp:65
QeRaDec::sizeHint
QSize sizeHint()
Definition: QeRaDec.cpp:124
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:11
QeRaDec::telescopeLong
double telescopeLong
Longitude coordinate of the telescope @accessors getTelescopeLong(), setTelescopeLong(double)
Definition: QeRaDec.hpp:59
QeRaDec::targetRa
double targetRa
Right Ascension coordinate of the target position in radians.
Definition: QeRaDec.hpp:41
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:107
QeRaDec::setTargetDec
void setTargetDec(double newValue)
Definition: QeRaDec.hpp:105
QeRaDec::getCurrentRa
double getCurrentRa()
Definition: QeRaDec.hpp:63
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:53
QeRaDec::setTelescopeLat
void setTelescopeLat(double newValue)
Definition: QeRaDec.hpp:106
QeRaDec::setCurrentDec
void setCurrentDec(double newValue)
Definition: QeRaDec.hpp:103
QeRaDec
A widget that renders two set of RA/Dec coordinates using cylindrical projection.
Definition: QeRaDec.hpp:22
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:35
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