Changeset View
Changeset View
Standalone View
Standalone View
kstars/ekos/observatory/observatory.h
- This file was added.
1 | /* Ekos Observatory Module | ||||
---|---|---|---|---|---|
2 | Copyright (C) Wolfgang Reissenberger <sterne-jaeger@t-online.de> | ||||
3 | | ||||
4 | This application is free software; you can redistribute it and/or | ||||
5 | modify it under the terms of the GNU General Public | ||||
6 | License as published by the Free Software Foundation; either | ||||
7 | version 2 of the License, or (at your option) any later version. | ||||
8 | */ | ||||
9 | | ||||
10 | #pragma once | ||||
11 | | ||||
12 | #include "ui_observatory.h" | ||||
13 | #include "observatorydomemodel.h" | ||||
14 | #include "observatoryweathermodel.h" | ||||
15 | #include "indiweather.h" | ||||
16 | | ||||
17 | #include <QWidget> | ||||
18 | #include <QObject> | ||||
19 | #include "klocalizedstring.h" | ||||
20 | | ||||
21 | | ||||
22 | namespace Ekos | ||||
23 | { | ||||
24 | | ||||
25 | class Observatory : public QWidget, public Ui::Observatory | ||||
26 | { | ||||
27 | Q_OBJECT | ||||
28 | Q_CLASSINFO("D-Bus Interface", "org.kde.kstars.Ekos.Observatory") | ||||
29 | Q_PROPERTY(QStringList logText READ logText NOTIFY newLog) | ||||
30 | | ||||
31 | public: | ||||
32 | Observatory(); | ||||
33 | ObservatoryDomeModel *getDomeModel() { return mDomeModel; } | ||||
34 | ObservatoryWeatherModel *getWeatherModel() { return mWeatherModel; } | ||||
35 | | ||||
36 | // Logging | ||||
37 | QStringList logText() { return m_LogText; } | ||||
38 | QString getLogText() { return m_LogText.join("\n"); } | ||||
39 | | ||||
40 | signals: | ||||
41 | Q_SCRIPTABLE void newLog(const QString &text); | ||||
42 | | ||||
43 | private: | ||||
44 | ObservatoryDomeModel *mDomeModel; | ||||
45 | void setDomeModel(ObservatoryDomeModel *model); | ||||
46 | | ||||
47 | ObservatoryWeatherModel *mWeatherModel; | ||||
48 | void setWeatherModel(ObservatoryWeatherModel *model); | ||||
49 | | ||||
50 | // Logging | ||||
51 | QStringList m_LogText; | ||||
52 | void appendLogText(const QString &); | ||||
53 | void clearLog(); | ||||
54 | | ||||
55 | // timer for refreshing the observatory status | ||||
56 | QTimer weatherStatusTimer; | ||||
57 | | ||||
58 | // reacting on weather changes | ||||
59 | void setWarningActions(WeatherActions actions); | ||||
60 | void setAlertActions(WeatherActions actions); | ||||
61 | | ||||
62 | private slots: | ||||
63 | void initWeather(); | ||||
64 | void shutdownWeather(); | ||||
65 | void setWeatherStatus(ISD::Weather::Status status); | ||||
66 | | ||||
67 | // reacting on weather changes | ||||
68 | void weatherWarningSettingsChanged(); | ||||
69 | void weatherAlertSettingsChanged(); | ||||
70 | | ||||
71 | void initDome(); | ||||
72 | void shutdownDome(); | ||||
73 | | ||||
74 | void setDomeStatus(ISD::Dome::Status status); | ||||
75 | void setShutterStatus(ISD::Dome::ShutterStatus status); | ||||
76 | }; | ||||
77 | } |