Kstars

observatorymodel.h
1 /* Ekos Observatory Module
2  SPDX-FileCopyrightText: Wolfgang Reissenberger <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include "observatorydomemodel.h"
10 #include "observatoryweathermodel.h"
11 
12 #include <QObject>
13 
14 namespace Ekos
15 {
16 
17 struct ObservatoryStatusControl
18 {
19  bool useDome, useShutter, useWeather;
20 };
21 
22 class ObservatoryModel : public QObject
23 {
24  Q_OBJECT
25 
26  public:
27  ObservatoryModel();
28 
29  ObservatoryDomeModel *getDomeModel()
30  {
31  return mDomeModel;
32  }
33  ObservatoryWeatherModel *getWeatherModel()
34  {
35  return mWeatherModel;
36  }
37 
38  void setDomeModel(ObservatoryDomeModel *model);
39  void setWeatherModel(ObservatoryWeatherModel *model);
40 
41  /**
42  * @brief Retrieve the settings that define, from which states the
43  * "ready" state of the observatory is derived from.
44  */
45  ObservatoryStatusControl statusControl()
46  {
47  return mStatusControl;
48  }
49  void setStatusControl(ObservatoryStatusControl control);
50 
51  /**
52  * @brief Is the observatory ready? This depends upon the states of the weather,
53  * dome etc and upon whether these settings are relevant (see status control).
54  */
55  bool isReady();
56 
57  public slots:
58  // call this slot in case that the weather or dome status has changed
59  void updateStatus();
60 
61  /**
62  * @brief Depending on the status control settings execute everything so
63  * that the status reaches the state "READY".
64  */
65  void makeReady();
66 
67  signals:
68  /**
69  * @brief Signal a new observatory status
70  * @param isReady
71  */
72  void newStatus(bool isReady);
73 
74 
75  private:
76  ObservatoryStatusControl mStatusControl;
77 
78  ObservatoryDomeModel *mDomeModel = nullptr;
79  ObservatoryWeatherModel *mWeatherModel = nullptr;
80 
81 };
82 
83 }
Q_OBJECTQ_OBJECT
Ekos is an advanced Astrophotography tool for Linux. It is based on a modular extensible framework to...
Definition: align.cpp:66
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Fri Aug 19 2022 03:57:52 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.