Kstars

capturedeviceadaptor.h
1 /* Ekos commands for the capture module
2  SPDX-FileCopyrightText: Wolfgang Reissenberger <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 
8 #pragma once
9 
10 #include "ekos/ekos.h"
11 #include "indi/indicommon.h"
12 #include "indiapi.h"
13 #include "indi/indicamera.h"
14 #include "indi/indidustcap.h"
15 #include "indi/indidome.h"
16 #include "indi/indilightbox.h"
17 #include "indi/indimount.h"
18 #include "indi/indirotator.h"
19 #include "ekos/auxiliary/filtermanager.h"
20 
21 #include "sequencejobstate.h"
22 
23 namespace Ekos
24 {
25 class CaptureDeviceAdaptor: public QObject
26 {
27  Q_OBJECT
28 
29  public:
30  CaptureDeviceAdaptor();
31 
32  //////////////////////////////////////////////////////////////////////
33  // current sequence job's state machine
34  //////////////////////////////////////////////////////////////////////
35 
36  SequenceJobState *currentSequenceJobState = nullptr;
37 
38  /**
39  * @brief Set the state machine for the current sequence job and attach
40  * all active devices to it.
41  */
42  void setCurrentSequenceJobState(SequenceJobState *jobState);
43 
44 
45  //////////////////////////////////////////////////////////////////////
46  // Devices
47  //////////////////////////////////////////////////////////////////////
48  void setLightBox(ISD::LightBox *device);
49  ISD::LightBox *getLightBox()
50  {
51  return m_ActiveLightBox;
52  }
53  void connectLightBox();
54  void disconnectLightBox();
55 
56  void setDustCap(ISD::DustCap *device);
57  ISD::DustCap *getDustCap()
58  {
59  return m_ActiveDustCap;
60  }
61  void connectDustCap();
62  void disconnectDustCap();
63 
64  void setMount(ISD::Mount *device);
65  ISD::Mount *getMount()
66  {
67  return m_ActiveTelescope;
68  }
69  void connectTelescope();
70  void disconnectTelescope();
71 
72  void setDome(ISD::Dome *device);
73  ISD::Dome *getDome()
74  {
75  return m_ActiveDome;
76  }
77  void connectDome();
78  void disconnectDome();
79 
80  void setRotator(ISD::Rotator *device);
81  ISD::Rotator *getRotator()
82  {
83  return m_ActiveRotator;
84  }
85  void connectRotator();
86  void disconnectRotator();
87 
88  void setActiveCamera(ISD::Camera *device);
89  ISD::Camera *getActiveCamera()
90  {
91  return m_ActiveCamera;
92  }
93  void connectActiveCamera();
94  void disconnectActiveCamera();
95 
96  void setActiveChip(ISD::CameraChip *device);
97  ISD::CameraChip *getActiveChip()
98  {
99  return m_ActiveChip;
100  }
101 
102  void setFilterWheel(ISD::FilterWheel *device);
103  ISD::FilterWheel *getFilterWheel()
104  {
105  return m_ActiveFilterWheel;
106  }
107 
108  void setFilterManager(const QSharedPointer<FilterManager> &value)
109  {
110  filterManager = value;
111  }
112  const QSharedPointer<FilterManager> getFilterManager()
113  {
114  return filterManager;
115  }
116  void connectFilterManager();
117  void disconnectFilterManager();
118 
119  //////////////////////////////////////////////////////////////////////
120  // Rotator commands
121  //////////////////////////////////////////////////////////////////////
122  /**
123  * @brief Set the rotator's angle
124  */
125  void setRotatorAngle(double *rawAngle);
126 
127  /**
128  * @brief reverseRotator Toggle rotation reverse
129  * @param toggled If true, reverse rotator normal direction. If false, use rotator normal direction.
130  */
131  void reverseRotator(bool toggled);
132 
133  /**
134  * @brief Read the current rotator's angle from the rotator device
135  * and emit it as {@see newRotatorAngle()}
136  */
137  void readRotatorAngle();
138 
139  //////////////////////////////////////////////////////////////////////
140  // Camera commands
141  //////////////////////////////////////////////////////////////////////
142 
143  /**
144  * @brief Set the CCD target temperature
145  * @param temp
146  */
147  void setCCDTemperature(double temp);
148 
149  /**
150  * @brief Set CCD to batch mode
151  * @param enable true iff batch mode
152  */
153  void enableCCDBatchMode(bool enable);
154 
155  //////////////////////////////////////////////////////////////////////
156  // Filter wheel commands
157  //////////////////////////////////////////////////////////////////////
158 
159  //////////////////////////////////////////////////////////////////////
160  // Flat capturing commands
161  //////////////////////////////////////////////////////////////////////
162 
163  /**
164  * @brief Ask for covering the scope manually with a flats light source
165  */
166  void askManualScopeLightCover(QString question, QString title);
167  /**
168  * @brief Ask for opening the scope cover manually
169  */
170  void askManualScopeLightOpen();
171  /**
172  * @brief Turn light on in the light box
173  */
174  void setLightBoxLight(bool on);
175  /**
176  * @brief park the dust cap
177  */
178  void parkDustCap(bool park);
179  /**
180  * @brief Slew the telescope to a target
181  */
182  void slewTelescope(SkyPoint &target);
183  /**
184  * @brief Turn scope tracking on and off
185  */
186  void setScopeTracking(bool on);
187  /**
188  * @brief Park / unpark telescope
189  */
190  void setScopeParked(bool parked);
191  /**
192  * @brief Park / unpark dome
193  */
194  void setDomeParked(bool parked);
195  /**
196  * @brief Check if the the focuser needs to be moved to the focus position.
197  */
198  void flatSyncFocus(int targetFilterID);
199 
200  //////////////////////////////////////////////////////////////////////
201  // Dark capturing commands
202  //////////////////////////////////////////////////////////////////////
203 
204  /**
205  * @brief Check whether the CCD has a shutter
206  */
207  void queryHasShutter();
208 
209  signals:
210  /**
211  * @brief Update for the CCD temperature
212  */
213  void newCCDTemperatureValue(double value);
214  /**
215  * @brief Update for the rotator's angle
216  */
217  void newRotatorAngle(double value, IPState state);
218  /**
219  * @brief Update for the rotator reverse status
220  */
221  void rotatorReverseToggled(bool enabled);
222  /**
223  * @brief Cover for the scope with a flats light source
224  */
225  void manualScopeLightCover(bool closed, bool success);
226  /**
227  * @brief Light box light is on.
228  */
229  void lightBoxLight(bool on);
230  /**
231  * @brief dust cap status change
232  */
233  void dustCapStatusChanged(ISD::DustCap::Status status);
234  /**
235  * @brief telescope status change
236  */
237  void scopeStatusChanged(ISD::Mount::Status status);
238  /**
239  * @brief telescope status change
240  */
241  void scopeParkStatusChanged(ISD::ParkStatus status);
242  /**
243  * @brief dome status change
244  */
245  void domeStatusChanged(ISD::Dome::Status status);
246  /**
247  * @brief flat sync focus status change
248  */
249  void flatSyncFocusChanged(bool completed);
250  /**
251  * @brief CCD has a shutter
252  */
253  void hasShutter(bool present);
254 
255  public slots:
256  /**
257  * @brief Slot that reads the requested device state and publishes the corresponding event
258  * @param state device state that needs to be read directly
259  */
260  void readCurrentState(Ekos::CaptureState state);
261 
262  private:
263  // the light box device
264  ISD::LightBox *m_ActiveLightBox { nullptr };
265  // the dust cap
266  ISD::DustCap *m_ActiveDustCap { nullptr };
267  // the current telescope
268  ISD::Mount *m_ActiveTelescope { nullptr };
269  // the current dome
270  ISD::Dome *m_ActiveDome { nullptr };
271  // active rotator device
272  ISD::Rotator * m_ActiveRotator { nullptr };
273  // active camera device
274  ISD::Camera * m_ActiveCamera { nullptr };
275  // active CCD chip
276  ISD::CameraChip * m_ActiveChip { nullptr };
277  // currently active filter wheel device
278  ISD::FilterWheel * m_ActiveFilterWheel { nullptr };
279  // Filter Manager
280  QSharedPointer<FilterManager> filterManager;
281 
282  // flag if manual cover has been asked
283  bool m_ManualCoveringAsked { false };
284  bool m_ManualOpeningAsked { false };
285 };
286 }; // namespace
Q_OBJECTQ_OBJECT
Ekos is an advanced Astrophotography tool for Linux. It is based on a modular extensible framework to...
Definition: align.cpp:66
Stores dms coordinates for a point in the sky. for converting between coordinate systems.
Definition: skypoint.h:44
CaptureState
Capture states.
Definition: ekos.h:91
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Fri Aug 19 2022 03:57:49 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.