9#include "ui_observatory.h"
11#include "indi/indidome.h"
12#include "indi/indiweather.h"
16#include <KLocalizedString>
21struct ObservatoryStatusControl
23 bool useDome, useShutter, useWeather;
28 bool parkDome, closeShutter, stopScheduler;
33class Observatory :
public QWidget,
public Ui::Observatory
36 Q_CLASSINFO(
"D-Bus Interface",
"org.kde.kstars.Ekos.Observatory")
38 Q_PROPERTY(
ISD::Weather::Status status READ status NOTIFY newStatus)
43 bool setDome(
ISD::Dome *device);
44 bool addWeatherSource(
ISD::Weather *device);
46 ISD::Weather::Status status()
48 return m_WeatherStatus;
58 return m_LogText.
join(
"\n");
67 ObservatoryStatusControl statusControl()
69 return m_StatusControl;
71 void setStatusControl(ObservatoryStatusControl control);
73 void setWeatherSource(
const QString &name);
77 Q_SCRIPTABLE
void newLog(
const QString &text);
78 Q_SCRIPTABLE
void newWeatherData(
const QJsonArray &data);
79 Q_SCRIPTABLE
void newStatus(ISD::Weather::Status status);
83 void enableMotionControl(
bool enabled);
86 void enableAutoSync(
bool enabled);
87 void showAutoSync(
bool enabled);
91 void appendLogText(
const QString &);
97 void setWarningActions(WeatherActions
actions);
98 void setAlertActions(WeatherActions
actions);
109 std::map<QString, QPair<QAbstractButton*, QLineEdit*>*> sensorDataWidgets = {};
111 std::map<QString, QVector<QCPGraphData>*> sensorGraphData = {};
114 std::map<QString, int> sensorRanges = {};
122 ISD::Weather::Status m_WeatherStatus { ISD::Weather::WEATHER_IDLE };
125 void initWeatherActions(
bool enabled);
127 void initSensorGraphs();
128 void updateSensorData(
const QJsonArray &data);
129 void updateSensorGraph(
const QString &sensor_label,
QDateTime now,
double value);
137 void setWarningActionsActive(
bool active);
141 void setAlertActionsActive(
bool active);
146 bool autoScaleValues()
148 return m_autoScaleValues;
150 void setAutoScaleValues(
bool show);
155 void statusControlSettingsChanged();
158 void enableWeather(
bool enable);
159 void clearSensorDataHistory();
160 void shutdownWeather();
161 void setWeatherStatus(ISD::Weather::Status status);
165 void refreshSensorGraph();
167 void execute(WeatherActions
actions);
170 void weatherWarningSettingsChanged();
171 void weatherAlertSettingsChanged();
174 void selectedSensorChanged(
QString id);
177 void observatoryStatusChanged(
bool ready);
178 void domeAzimuthChanged(
double position);
182 void setDomeStatus(ISD::Dome::Status status);
183 void setDomeParkStatus(ISD::ParkStatus status);
184 void setShutterStatus(ISD::Dome::ShutterStatus status);
189 WeatherActions getWarningActions()
191 return m_WarningActions;
193 QString getWarningActionsStatus();
194 bool getWarningActionsActive()
196 return warningActionsActive;
202 WeatherActions getAlertActions()
204 return m_AlertActions;
206 QString getAlertActionsStatus();
207 bool getAlertActionsActive()
209 return alertActionsActive;
217 ObservatoryStatusControl m_StatusControl;
219 QTimer warningTimer, alertTimer;
220 struct WeatherActions m_WarningActions, m_AlertActions;
221 bool warningActionsActive, alertActionsActive, m_autoScaleValues;
222 void startAlertTimer();
223 void startWarningTimer();
Class handles control of INDI dome devices.
Focuser class handles control of INDI Weather devices.
Ekos is an advanced Astrophotography tool for Linux.
ISD is a collection of INDI Standard Devices.
QString join(QChar separator) const const