Kstars

capture.h
1 /*
2  SPDX-FileCopyrightText: 2012 Jasem Mutlaq <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include "ui_capture.h"
10 #include "capturedeviceadaptor.h"
11 #include "sequencejobstate.h"
12 #include "customproperties.h"
13 #include "oal/filter.h"
14 #include "ekos/ekos.h"
15 #include "ekos/mount/mount.h"
16 #include "indi/indicamera.h"
17 #include "indi/indidustcap.h"
18 #include "indi/indidome.h"
19 #include "indi/indilightbox.h"
20 #include "indi/indimount.h"
21 #include "ekos/auxiliary/filtermanager.h"
22 #include "ekos/scheduler/schedulerjob.h"
23 #include "ekos/auxiliary/darkprocessor.h"
24 #include "dslrinfodialog.h"
25 #include "ui_limits.h"
26 
27 #include <QTimer>
28 #include <QUrl>
29 #include <QtDBus>
30 
31 #include <memory>
32 
33 class QProgressIndicator;
34 class QTableWidgetItem;
35 class KDirWatch;
36 class RotatorSettings;
37 
38 /**
39  * @namespace Ekos
40  * @short Ekos is an advanced Astrophotography tool for Linux.
41  * It is based on a modular extensible framework to perform common astrophotography tasks. This includes highly accurate GOTOs using astrometry solver, ability to measure and correct polar alignment errors ,
42  * auto-focus & auto-guide capabilities, and capture of single or stack of images with filter wheel support.\n
43  * Features:
44  * - Control your telescope, CCD (& DSLRs), filter wheel, focuser, guider, adaptive optics unit, and any INDI-compatible auxiliary device from Ekos.
45  * - Extremely accurate GOTOs using astrometry.net solver (both Online and Offline solvers supported).
46  * - Load & Slew: Load a FITS image, slew to solved coordinates, and center the mount on the exact image coordinates in order to get the same desired frame.
47  * - Measure & Correct Polar Alignment errors using astrometry.net solver.
48  * - Auto and manual focus modes using Half-Flux-Radius (HFR) method.
49  * - Automated unattended meridian flip. Ekos performs post meridian flip alignment, calibration, and guiding to resume the capture session.
50  * - Automatic focus between exposures when a user-configurable HFR limit is exceeded.
51  * - Automatic focus between exposures when the temperature has changed a lot since last focus.
52  * - Auto guiding with support for automatic dithering between exposures and support for Adaptive Optics devices in addition to traditional guiders.
53  * - Powerful sequence queue for batch capture of images with optional prefixes, timestamps, filter wheel selection, and much more!
54  * - Export and import sequence queue sets as Ekos Sequence Queue (.esq) files.
55  * - Center the telescope anywhere in a captured FITS image or any FITS with World Coordinate System (WCS) header.
56  * - Automatic flat field capture, just set the desired ADU and let Ekos does the rest!
57  * - Automatic abort and resumption of exposure tasks if guiding errors exceed a user-configurable value.
58  * - Support for dome slaving.
59  * - Complete integration with KStars Observation Planner and SkyMap
60  * - Integrate with all INDI native devices.
61  * - Powerful scripting capabilities via \ref EkosDBusInterface "DBus."
62  *
63  * The primary class is Ekos::Manager. It handles startup and shutdown of local and remote INDI devices, manages and orchesterates the various Ekos modules, and provides advanced DBus
64  * interface to enable unattended scripting.
65  *
66  * @author Jasem Mutlaq
67  * @version 1.9
68  */
69 namespace Ekos
70 {
71 class SequenceJob;
72 
73 /**
74  *@class Capture
75  *@short Captures single or sequence of images from a CCD.
76  * The capture class support capturing single or multiple images from a CCD, it provides a powerful sequence queue with filter wheel selection. Any sequence queue can be saved as Ekos Sequence Queue (.esq).
77  * All image capture operations are saved as Sequence Jobs that encapsulate all the different options in a capture process. The user may select in sequence autofocusing by setting a maximum HFR limit. When the limit
78  * is exceeded, it automatically trigger autofocus operation. The capture process can also be linked with guide module. If guiding deviations exceed a certain threshold, the capture operation aborts until
79  * the guiding deviation resume to acceptable levels and the capture operation is resumed.
80  *@author Jasem Mutlaq
81  *@version 1.4
82  */
83 class Capture : public QWidget, public Ui::Capture
84 {
85  Q_OBJECT
86  Q_CLASSINFO("D-Bus Interface", "org.kde.kstars.Ekos.Capture")
87  Q_PROPERTY(Ekos::CaptureState status READ status NOTIFY newStatus)
88  Q_PROPERTY(QString targetName MEMBER m_TargetName)
89  Q_PROPERTY(QString observerName MEMBER m_ObserverName)
90  Q_PROPERTY(QString camera READ camera WRITE setCamera)
91  Q_PROPERTY(QString filterWheel READ filterWheel WRITE setFilterWheel)
92  Q_PROPERTY(QString filter READ filter WRITE setFilter)
93  Q_PROPERTY(bool coolerControl READ hasCoolerControl WRITE setCoolerControl)
94  Q_PROPERTY(QStringList logText READ logText NOTIFY newLog)
95 
96  public:
97  typedef enum { MF_NONE, MF_REQUESTED, MF_READY, MF_INITIATED, MF_FLIPPING, MF_SLEWING, MF_COMPLETED, MF_ALIGNING, MF_GUIDING } MFStage;
98 
99  typedef enum
100  {
101  ADU_LEAST_SQUARES,
102  ADU_POLYNOMIAL
103  } ADUAlgorithm;
104 
105  typedef IPState (Capture::*PauseFunctionPointer)();
106 
107  Capture();
108  ~Capture();
109 
110  /** @defgroup CaptureDBusInterface Ekos DBus Interface - Capture Module
111  * Ekos::Capture interface provides advanced scripting capabilities to capture image sequences.
112  */
113 
114  /*@{*/
115 
116  /** DBUS interface function.
117  * select the CCD device from the available CCD drivers.
118  * @param device The CCD device name
119  */
120  Q_SCRIPTABLE bool setCamera(const QString &device);
121  Q_SCRIPTABLE QString camera();
122 
123  /** DBUS interface function.
124  * select the filter device from the available filter drivers. The filter device can be the same as the CCD driver if the filter functionality was embedded within the driver.
125  * @param device The filter device name
126  */
127  Q_SCRIPTABLE bool setFilterWheel(const QString &device);
128  Q_SCRIPTABLE QString filterWheel();
129 
130  /** DBUS interface function.
131  * select the filter name from the available filters in case a filter device is active.
132  * @param filter The filter name
133  */
134  Q_SCRIPTABLE bool setFilter(const QString &filter);
135  Q_SCRIPTABLE QString filter();
136 
137  /** DBUS interface function.
138  * Aborts any current jobs and remove all sequence queue jobs.
139  */
140  Q_SCRIPTABLE Q_NOREPLY void clearSequenceQueue();
141 
142  /** DBUS interface function.
143  * Returns the overall sequence queue status. If there are no jobs pending, it returns "Invalid". If all jobs are idle, it returns "Idle". If all jobs are complete, it returns "Complete". If one or more jobs are aborted
144  * it returns "Aborted" unless it was temporarily aborted due to guiding deviations, then it would return "Suspended". If one or more jobs have errors, it returns "Error". If any jobs is under progress, returns "Running".
145  */
146  Q_SCRIPTABLE QString getSequenceQueueStatus();
147 
148  /** DBUS interface function.
149  * Loads the Ekos Sequence Queue file in the Sequence Queue. Jobs are appended to existing jobs.
150  * @param fileURL full URL of the filename
151  */
152  Q_SCRIPTABLE bool loadSequenceQueue(const QString &fileURL);
153 
154  /** DBUS interface function.
155  * Saves the Sequence Queue to the Ekos Sequence Queue file.
156  * @param fileURL full URL of the filename
157  */
158  Q_SCRIPTABLE bool saveSequenceQueue(const QString &path);
159 
160  /** DBUS interface function.
161  * Enables or disables the maximum guiding deviation and sets its value.
162  * @param enable If true, enable the guiding deviation check, otherwise, disable it.
163  * @param value if enable is true, it sets the maximum guiding deviation in arcsecs. If the value is exceeded, the capture operation is aborted until the value falls below the value threshold.
164  */
165  Q_SCRIPTABLE Q_NOREPLY void setMaximumGuidingDeviation(bool enable, double value);
166 
167  /** DBUS interface function.
168  * Enables or disables the in sequence focus and sets Half-Flux-Radius (HFR) limit.
169  * @param enable If true, enable the in sequence auto focus check, otherwise, disable it.
170  * @param HFR if enable is true, it sets HFR in pixels. After each exposure, the HFR is re-measured and if it exceeds the specified value, an autofocus operation will be commanded.
171  */
172  Q_SCRIPTABLE Q_NOREPLY void setInSequenceFocus(bool enable, double HFR);
173 
174  /** DBUS interface function.
175  * Does the CCD has a cooler control (On/Off) ?
176  */
177  Q_SCRIPTABLE bool hasCoolerControl();
178 
179  /** DBUS interface function.
180  * Set the CCD cooler ON/OFF
181  *
182  */
183  Q_SCRIPTABLE bool setCoolerControl(bool enable);
184 
185  /** DBUS interface function.
186  * @return Returns the percentage of completed captures in all active jobs
187  */
188  Q_SCRIPTABLE double getProgressPercentage();
189 
190  /** DBUS interface function.
191  * @return Returns the number of jobs in the sequence queue.
192  */
193  Q_SCRIPTABLE int getJobCount()
194  {
195  return jobs.count();
196  }
197 
198  /** DBUS interface function.
199  * @return Returns the number of pending uncompleted jobs in the sequence queue.
200  */
201  Q_SCRIPTABLE int getPendingJobCount();
202 
203  /** DBUS interface function.
204  * @return Returns ID of current active job if any, or -1 if there are no active jobs.
205  */
206  Q_SCRIPTABLE int getActiveJobID();
207 
208  /** DBUS interface function.
209  * @return Returns time left in seconds until active job is estimated to be complete.
210  */
211  Q_SCRIPTABLE int getActiveJobRemainingTime();
212 
213  /** DBUS interface function.
214  * @return Returns overall time left in seconds until all jobs are estimated to be complete
215  */
216  Q_SCRIPTABLE int getOverallRemainingTime();
217 
218  /** DBUS interface function.
219  * @param id job number. Job IDs start from 0 to N-1.
220  * @return Returns the job state (Idle, In Progress, Error, Aborted, Complete)
221  */
222  Q_SCRIPTABLE QString getJobState(int id);
223 
224  /** DBUS interface function.
225  * @param id job number. Job IDs start from 0 to N-1.
226  * @return Returns the job filter name.
227  */
228  Q_SCRIPTABLE QString getJobFilterName(int id);
229 
230  /** DBUS interface function.
231  * @param id job number. Job IDs start from 0 to N-1.
232  * @return Returns The number of images completed capture in the job.
233  */
234  Q_SCRIPTABLE int getJobImageProgress(int id);
235 
236  /** DBUS interface function.
237  * @param id job number. Job IDs start from 0 to N-1.
238  * @return Returns the total number of images to capture in the job.
239  */
240  Q_SCRIPTABLE int getJobImageCount(int id);
241 
242  /** DBUS interface function.
243  * @param id job number. Job IDs start from 0 to N-1.
244  * @return Returns the number of seconds left in an exposure operation.
245  */
246  Q_SCRIPTABLE double getJobExposureProgress(int id);
247 
248  /** DBUS interface function.
249  * @param id job number. Job IDs start from 0 to N-1.
250  * @return Returns the total requested exposure duration in the job.
251  */
252  Q_SCRIPTABLE double getJobExposureDuration(int id);
253 
254  /** DBUS interface function.
255  * @param id job number. Job IDs start from 0 to N-1.
256  * @return Returns the frame type (light, dark, ...) of the job.
257  */
258  Q_SCRIPTABLE CCDFrameType getJobFrameType(int id);
259 
260  /** DBUS interface function.
261  * Clear in-sequence focus settings. It sets the autofocus HFR to zero so that next autofocus value is remembered for the in-sequence focusing.
262  */
263  Q_SCRIPTABLE Q_NOREPLY void clearAutoFocusHFR();
264 
265  /** DBUS interface function.
266  * Jobs will NOT be checked for progress against the file system and will be always assumed as new jobs.
267  */
268  Q_SCRIPTABLE Q_NOREPLY void ignoreSequenceHistory();
269 
270  /** DBUS interface function.
271  * Set count of already completed frames. This is required when we have identical external jobs
272  * with identical paths, but we need to continue where we left off. For example, if we have 3 identical
273  * jobs, each capturing 5 images. Let's suppose 9 images were captured before. If the count for this signature
274  * is set to 1, then we continue to capture frame #2 even though the number of completed images is already
275  * larger than required count (5). It is mostly used in conjunction with Ekos Scheduler.
276  */
277  Q_SCRIPTABLE Q_NOREPLY void setCapturedFramesMap(const QString &signature, int count);
278 
279  Q_SCRIPTABLE QStringList logText()
280  {
281  return m_LogText;
282  }
283 
284  Q_SCRIPTABLE Ekos::CaptureState status()
285  {
286  return m_State;
287  }
288 
289  /** @}*/
290 
291 
292  /**
293  * @brief Add new Camera
294  * @param device pointer to camera device.
295  * @return True if added successfully, false if duplicate or failed to add.
296  */
297  bool addCamera(ISD::Camera *device);
298 
299  /**
300  * @brief Add new Filter Wheel
301  * @param device pointer to filter wheel device.
302  * @return True if added successfully, false if duplicate or failed to add.
303  */
304  bool addFilterWheel(ISD::FilterWheel *device);
305 
306  /**
307  * @brief Add new Dome
308  * @param device pointer to Dome device.
309  * @return True if added successfully, false if duplicate or failed to add.
310  */
311  bool addDome(ISD::Dome *device);
312 
313  /**
314  * @brief Add new Dust Cap
315  * @param device pointer to Dust Cap device.
316  * @return True if added successfully, false if duplicate or failed to add.
317  */
318  bool addDustCap(ISD::DustCap *device);
319 
320  /**
321  * @brief Add new Light Box
322  * @param device pointer to Light Box device.
323  * @return True if added successfully, false if duplicate or failed to add.
324  */
325  bool addLightBox(ISD::LightBox *device);
326 
327  /**
328  * @brief Add new Mount
329  * @param device pointer to Mount device.
330  * @return True if added successfully, false if duplicate or failed to add.
331  */
332  bool addMount(ISD::Mount *device);
333 
334  /**
335  * @brief Add new Rotator
336  * @param device pointer to rotator device.
337  * @return True if added successfully, false if duplicate or failed to add.
338  */
339  bool addRotator(ISD::Rotator *device);
340 
341  void removeDevice(ISD::GenericDevice *device);
342  void addGuideHead(ISD::Camera *device);
343  void syncFrameType(const QString &name);
344  void setRotatorReversed(bool toggled);
345  void setFilterManager(const QSharedPointer<FilterManager> &manager);
346  void syncTelescopeInfo();
347  void syncCameraInfo();
348  void syncFilterInfo();
349 
350  // Restart driver
351  void reconnectDriver(const QString &camera, const QString &filterWheel);
352 
353  void clearLog();
354  QString getLogText()
355  {
356  return m_LogText.join("\n");
357  }
358 
359  /* Capture */
360  void updateSequencePrefix(const QString &newPrefix, const QString &dir);
361 
362  /**
363  * @brief getSequence Return the JSON representation of the current sequeue queue
364  * @return Reference to JSON array containing sequence queue jobs.
365  */
366  const QJsonArray &getSequence() const
367  {
368  return m_SequenceArray;
369  }
370 
371  /**
372  * @brief setSettings Set capture settings
373  * @param settings list of settings
374  */
375  void setPresetSettings(const QJsonObject &settings);
376 
377  /**
378  * @brief getSettings get current capture settings as a JSON Object
379  * @return settings as JSON object
380  */
382 
383  /**
384  * @brief setFileSettings Set File Settings
385  * @param settings as JSON object
386  */
387  void setFileSettings(const QJsonObject &settings);
388  /**
389  * @brief getFileSettings Compile file setting
390  * @return File settings as JSON object
391  */
393 
394  /**
395  * @brief setCalibrationSettings Set Calibration settings
396  * @param settings as JSON object
397  */
398  void setCalibrationSettings(const QJsonObject &settings);
399  /**
400  * @brief getCalibrationSettings Get Calibration settings
401  * @return settings as JSON object
402  */
404 
405  /**
406  * @brief setLimitSettings Set limit settings
407  * @param settings as JSON Object
408  */
409  void setLimitSettings(const QJsonObject &settings);
410  /**
411  * @brief getLimitSettings Get Limit Settings
412  * @return settings as JSON Object
413  */
415 
416  /**
417  * @brief setVideoLimits sets the buffer size and max preview fps for live preview
418  * @param maxBufferSize in bytes
419  * @param maxPreviewFPS number of frames per second
420  * @return True if value is updated, false otherwise.
421  */
422  bool setVideoLimits(uint16_t maxBufferSize, uint16_t maxPreviewFPS);
423  /**
424  * @brief addDSLRInfo Save DSLR Info the in the database. If the interactive dialog was open, close it.
425  * @param model Camera name
426  * @param maxW Maximum width in pixels
427  * @param maxH Maximum height in pixels
428  * @param pixelW Pixel horizontal size in microns
429  * @param pixelH Pizel vertical size in microns
430  */
431  void addDSLRInfo(const QString &model, uint32_t maxW, uint32_t maxH, double pixelW, double pixelH);
432 
433  /**
434  * @brief syncDSLRToTargetChip Syncs INDI driver CCD_INFO property to the DSLR values.
435  * This include Max width, height, and pixel sizes.
436  * @param model Name of camera driver in the DSLR database.
437  */
438  void syncDSLRToTargetChip(const QString &model);
439 
440  double getEstimatedDownloadTime();
441 
442  public slots:
443 
444  /** \addtogroup CaptureDBusInterface
445  * @{
446  */
447 
448  /* Capture */
449  /** DBUS interface function.
450  * Starts the sequence queue capture procedure sequentially by starting all jobs that are either Idle or Aborted in order.
451  */
452  Q_SCRIPTABLE Q_NOREPLY void start();
453 
454  /** DBUS interface function.
455  * Stop all jobs and set current job status to aborted if abort is set to true, otherwise status is idle until
456  * sequence is resumed or restarted.
457  * @param targetState status of the job after abortion
458  */
459  Q_SCRIPTABLE Q_NOREPLY void stop(CaptureState targetState = CAPTURE_IDLE);
460 
461  /** DBUS interface function.
462  * Aborts all jobs and mark current state as ABORTED. It simply calls stop(CAPTURE_ABORTED)
463  */
464  Q_SCRIPTABLE Q_NOREPLY void abort()
465  {
467  }
468 
469  /** DBUS interface function.
470  * Aborts all jobs and mark current state as SUSPENDED. It simply calls stop(CAPTURE_SUSPENDED)
471  * The only difference between SUSPENDED and ABORTED it that capture module can automatically resume a suspended
472  * state on its own without external trigger once the right conditions are met. When whatever reason caused the module
473  * to go into suspended state ceases to exist, the capture module automatically resumes. On the other hand, ABORTED state
474  * must be started via an external programmatic or user trigger (e.g. click the start button again).
475  */
476  Q_SCRIPTABLE Q_NOREPLY void suspend()
477  {
479  }
480 
481  /** DBUS interface function.
482  * Toggle video streaming if supported by the device.
483  * @param enabled Set to true to start video streaming, false to stop it if active.
484  */
485  Q_SCRIPTABLE Q_NOREPLY void toggleVideo(bool enabled);
486 
487  /** DBUS interface function.
488  * @brief pause Pauses the Sequence Queue progress AFTER the current capture is complete.
489  */
490  Q_SCRIPTABLE Q_NOREPLY void pause();
491 
492  /** DBUS interface function.
493  * @brief toggleSequence Toggle sequence state depending on its current state.
494  * 1. If paused, then resume sequence.
495  * 2. If idle or completed, then start sequence.
496  * 3. Otherwise, abort current sequence.
497  */
498  Q_SCRIPTABLE Q_NOREPLY void toggleSequence();
499 
500 
501  /** DBus interface function
502  * @brief restartCamera Restarts the INDI driver associated with a camera. Remote and Local drivers are supported.
503  * @param name Name of camera to restart. If a driver defined multiple cameras, they would be removed and added again
504  * after driver restart.
505  * @note Restarting camera should only be used as a last resort when it comes completely unresponsive. Due the complex
506  * nature of driver interactions with Ekos, restarting cameras can lead to unexpected behavior.
507  */
508  Q_SCRIPTABLE Q_NOREPLY void restartCamera(const QString &name);
509 
510  /** @}*/
511 
512  /**
513  * @brief captureOne Capture one preview image
514  */
515  void captureOne();
516 
517  /**
518  * @brief startFraming Like captureOne but repeating.
519  */
520  void startFraming();
521 
522  /**
523  * @brief setExposure Set desired exposure value in seconds
524  * @param value exposure values in seconds
525  */
526  void setExposure(double value)
527  {
528  captureExposureN->setValue(value);
529  }
530 
531  /**
532  * @brief seqCount Set required number of images to capture in one sequence job
533  * @param count number of images to capture
534  */
535  void setCount(uint16_t count)
536  {
537  captureCountN->setValue(count);
538  }
539 
540  /**
541  * @brief setDelay Set delay between capturing images within a sequence in seconds
542  * @param delay numbers of seconds to wait before starting the next image.
543  */
544  void setDelay(uint16_t delay)
545  {
546  captureDelayN->setValue(delay);
547  }
548 
549  /**
550  * @brief setPrefix Set target or prefix name used in constructing the generated file name
551  * @param prefix Leading text of the generated image name.
552  */
553  void setPrefix(const QString &prefix)
554  {
555  filePrefixT->setText(prefix);
556  }
557 
558  /**
559  * @brief setBinning Set binning
560  * @param horBin Horizontal binning
561  * @param verBin Vertical binning
562  */
563  void setBinning(int horBin, int verBin)
564  {
565  captureBinHN->setValue(horBin);
566  captureBinVN->setValue(verBin);
567  }
568 
569  /**
570  * @brief setISO Set index of ISO list.
571  * @param index index of ISO list.
572  */
573  void setISO(int index)
574  {
575  captureISOS->setCurrentIndex(index);
576  }
577 
578  /**
579  * @brief Slot receiving the update of the current target distance.
580  * @param targetDiff distance to the target in arcseconds.
581  */
582  void updateTargetDistance(double targetDiff);
583 
584  /**
585  * @brief captureImage Initiates image capture in the active job.
586  */
587  void captureImage();
588 
589  /**
590  * @brief newFITS process new FITS data received from camera. Update status of active job and overall sequence.
591  * @param bp pointer to blob containing FITS data
592  */
593  void processData(const QSharedPointer<FITSData> &data);
594 
595  /**
596  * @brief checkCamera Refreshes the CCD information in the capture module.
597  * @param CCDNum The CCD index in the CCD combo box to select as the active CCD.
598  */
599  void checkCamera(int CCDNum = -1);
600 
601  /**
602  * @brief checkFilter Refreshes the filter wheel information in the capture module.
603  * @param filterNum The filter wheel index in the filter device combo box to set as the active filter.
604  */
605  void checkFilter(int filterNum = -1);
606 
607  /**
608  * @brief processCCDNumber Process number properties arriving from CCD. Currently, only CCD and Guider frames are processed.
609  * @param nvp pointer to number property.
610  */
611  void processCCDNumber(INumberVectorProperty *nvp);
612 
613  /**
614  * @brief processTelescopeNumber Process number properties arriving from telescope for meridian flip purposes.
615  * @param nvp pointer to number property.
616  */
617  void processTelescopeNumber(INumberVectorProperty *nvp);
618 
619  /**
620  * @brief processNewTargetName If mount slews to a new object, process it as it can be used for prefix
621  * @param name new sky object under tracking.
622  */
623  void processNewTargetName(const QString &name);
624 
625  /**
626  * @brief addSequenceJob Add a sequence job. This simply calls addJob below with both preview and isDarkFlat set to false.
627  * @return return result of addJob(..)
628  */
629  bool addSequenceJob();
630 
631  /**
632  * @brief addJob Add a new job to the sequence queue given the settings in the GUI.
633  * @param preview True if the job is a preview job, otherwise, it is added as a batch job.
634  * @param isDarkFlat True if the job is a dark flat job, false otherwise.
635  * @return True if job is added successfully, false otherwise.
636  */
637  bool addJob(bool preview = false, bool isDarkFlat = false);
638 
639  /**
640  * @brief removeJob Remove a job sequence from the queue
641  * @param index Row index for job to remove, if left as -1 (default), the currently selected row will be removed.
642  * if no row is selected, the last job shall be removed.
643  * @param true if sequence is removed. False otherwise.
644  */
645  bool removeJob(int index = -1);
646 
647  void removeJobFromQueue();
648 
649  /**
650  * @brief moveJobUp Move the job in the sequence queue one place up.
651  */
652  void moveJobUp();
653 
654  /**
655  * @brief moveJobDown Move the job in the sequence queue one place down.
656  */
657  void moveJobDown();
658 
659  /**
660  * @brief setGuideDeviation Set the guiding deviation as measured by the guiding module. Abort capture if deviation exceeds user value. Resume capture if capture was aborted and guiding deviations are below user value.
661  * @param delta_ra Deviation in RA in arcsecs from the selected guide star.
662  * @param delta_dec Deviation in DEC in arcsecs from the selected guide star.
663  */
664  void setGuideDeviation(double delta_ra, double delta_dec);
665 
666  /**
667  * @brief updateCCDTemperature Update CCD temperature in capture module.
668  * @param value Temperature in celcius.
669  */
670  void updateCCDTemperature(double value);
671 
672  /**
673  * @brief setTemperature Set the target CCD temperature in the GUI settings.
674  */
675  void setTargetTemperature(double temperature);
676 
677  void setForceTemperature(bool enabled)
678  {
679  cameraTemperatureS->setChecked(enabled);
680  }
681 
682  /**
683  * @brief showTemperatureRegulation Toggle temperature regulation dialog which sets temperature ramp and threshold
684  */
686 
687  /**
688  * @brief prepareActiveJobStage1 Check for pre job script to execute. If none, move to stage 2
689  */
690  void prepareActiveJobStage1();
691  /**
692  * @brief prepareActiveJob Reset calibration state machine and prepare capture job actions.
693  */
694  void prepareActiveJobStage2();
695 
696  /**
697  * @brief preparePreCaptureActions Check if we need to update filter position or CCD temperature before starting capture process
698  */
700 
701  void setFrameType(const QString &type)
702  {
703  captureTypeS->setCurrentText(type);
704  }
705 
706  // Logs
707  void appendLogText(const QString &);
708 
709  // Auto Focus
710  void setFocusStatus(Ekos::FocusState state);
711  void setHFR(double newHFR, int)
712  {
713  focusHFR = newHFR;
714  }
715  void setFocusTemperatureDelta(double focusTemperatureDelta, double absTemperature);
716  // Return TRUE if we need to run focus/autofocus. Otherwise false if not necessary
717  bool startFocusIfRequired();
718 
719  // Guide
720  void setGuideStatus(Ekos::GuideState state);
721 
722  // Align
723  void setAlignStatus(Ekos::AlignState state);
724  void setAlignResults(double orientation, double ra, double de, double pixscale);
725  // Update Mount module status
726  void setMountStatus(ISD::Mount::Status newState);
727 
728  void setGuideChip(ISD::CameraChip *guideChip);
729  //void setGeneratedPreviewFITS(const QString &previewFITS);
730 
731  // Clear Camera Configuration
732  void clearCameraConfiguration();
733 
734  // Meridian flip
735  void meridianFlipStatusChanged(Mount::MeridianFlipStatus status);
736 
737  /**
738  * @brief registerNewModule Register an Ekos module as it arrives via DBus
739  * and create the appropriate DBus interface to communicate with it.
740  * @param name of module
741  */
742  void registerNewModule(const QString &name);
743 
744  /**
745  * @brief generateDarkFlats Generate a list of dark flat jobs from available flat frames.
746  */
747  void generateDarkFlats();
748 
749  private slots:
750 
751  /**
752  * @brief setDirty Set dirty bit to indicate sequence queue file was modified and needs saving.
753  */
754  void setDirty();
755 
756  void checkFrameType(int index);
757  void resetFrame();
758  void setExposureProgress(ISD::CameraChip *tChip, double value, IPState state);
759  void updateCaptureCountDown(int deltaMillis);
760  void checkSeqBoundary(const QString &path);
761  void saveFITSDirectory();
762  void setDefaultCCD(QString ccd);
763  void setDefaultFilterWheel(QString filterWheel);
764  void setNewRemoteFile(QString file);
765 
766  // Sequence Queue
767  void loadSequenceQueue();
768  void saveSequenceQueue();
769  void saveSequenceQueueAs();
770 
771  // Jobs
772  void resetJobs();
773  bool selectJob(QModelIndex i);
774  void editJob(QModelIndex i);
775  void resetJobEdit();
776  void executeJob();
777 
778  // AutoGuide
779  void checkGuideDeviationTimeout();
780 
781  // Auto Focus
782  // Timed refocus
783  void startRefocusEveryNTimer()
784  {
785  startRefocusTimer(false);
786  }
787  void restartRefocusEveryNTimer()
788  {
789  startRefocusTimer(true);
790  }
791  int getRefocusEveryNTimerElapsedSec();
792 
793  // Flat field
794  void openCalibrationDialog();
795  IPState processPreCaptureCalibrationStage();
796  bool processPostCaptureCalibrationStage();
797  void updatePreCaptureCalibrationStatus();
798 
799  // Script Manager
800  void handleScriptsManager();
801 
802  /* Frame Type calibration checks */
803 
804  /**
805  * @brief Check if some tasks are pending before the active job
806  * can start light frame capturing
807  * @return IPS_OK iff the light frame capturing sequence is ready to start
808  */
809  IPState checkLightFramePendingTasks();
810 
811  // Send image info
812  //void sendNewImage(const QString &filename, ISD::CameraChip *myChip);
813 
814  // Capture
815  IPState setCaptureComplete();
816 
817  // capture scripts
818  void scriptFinished(int exitCode, QProcess::ExitStatus status);
819 
820  void setVideoStreamEnabled(bool enabled);
821 
822  // Observer
823  void showObserverDialog();
824 
825  // Active Job Prepare State
826  void updatePrepareState(Ekos::CaptureState prepareState);
827 
828  // Rotator
829  void updateRotatorAngle(double value);
830 
831  // Cooler
832  void setCoolerToggled(bool enabled);
833 
834  void setDownloadProgress();
835 
836  signals:
837  Q_SCRIPTABLE void newLog(const QString &text);
838  Q_SCRIPTABLE void meridianFlipStarted();
839  Q_SCRIPTABLE void meridianFlipCompleted();
840  Q_SCRIPTABLE void newStatus(Ekos::CaptureState status);
841  Q_SCRIPTABLE void captureComplete(const QVariantMap &metadata);
842 
843  void ready();
844 
845  // signals to the sequence job
846  void prepareCapture();
847 
848  // device status
849  void newGuiderDrift(double deviation_rms);
850 
851  // communication with other modules
852  void checkFocus(double);
853  void resetFocus();
854  void abortFocus();
855  void suspendGuiding();
856  void resumeGuiding();
857  void newImage(Ekos::SequenceJob *job, const QSharedPointer<FITSData> &data);
858  void newExposureProgress(Ekos::SequenceJob *job);
859  void newDownloadProgress(double);
860  void sequenceChanged(const QJsonArray &sequence);
861  void settingsUpdated(const QJsonObject &settings);
862  void newMeridianFlipStatus(Mount::MeridianFlipStatus status);
863  void newMeridianFlipSetup(bool activate, double hours);
864  void dslrInfoRequested(const QString &cameraName);
865  void driverTimedout(const QString &deviceName);
866 
867  // Signals for the Analyze tab.
868  void captureStarting(double exposureSeconds, const QString &filter);
869  void captureAborted(double exposureSeconds);
870 
871  private:
872  /**
873  * @brief Set the currently active sequence job. Use this function to ensure
874  * that everything is cleaned up properly.
875  */
876  void setActiveJob(SequenceJob *value);
877 
878  void setBusy(bool enable);
879  IPState resumeSequence();
880  IPState startNextExposure();
881 
882  /**
883  * @brief Loop retrying #startNextExposure() if there are pending preparation tasks.
884  */
885  void checkNextExposure();
886 
887  // reset = 0 --> Do not reset
888  // reset = 1 --> Full reset
889  // reset = 2 --> Only update limits if needed
890  void updateFrameProperties(int reset = 0);
891  void prepareJob(SequenceJob *job);
892  void syncGUIToJob(SequenceJob *job);
893  bool processJobInfo(XMLEle *root);
894 
895  /**
896  * @brief processJobCompletionStage1 Process job completion. In stage 1 when simply check if the is a post-job script to be running
897  * if yes, we run it and wait until it is done before we move to stage2
898  */
899  void processJobCompletionStage1();
900 
901  /**
902  * @brief processJobCompletionStage2 Set job as complete and look for next job in the sequence, if any.
903  */
904  void processJobCompletionStage2();
905 
906  double setCurrentADU(double value);
907  void llsq(QVector<double> x, QVector<double> y, double &a, double &b);
908 
909  // Gain
910  // This sets and gets the custom properties target gain
911  // it does not access the ccd gain property
912  void setGain(double value);
913  double getGain();
914 
915  void setOffset(double value);
916  double getOffset();
917 
918  // DSLR Info
919  void cullToDSLRLimits();
920  //void syncDriverToDSLRLimits();
921  bool isModelinDSLRInfo(const QString &model);
922 
923  /* Meridian Flip */
924  /**
925  * @brief Check if a meridian flip has already been started
926  * @return true iff the scope has started the meridian flip
927  */
928  inline bool checkMeridianFlipRunning()
929  {
930  return meridianFlipStage == MF_INITIATED || meridianFlipStage == MF_FLIPPING || meridianFlipStage == MF_SLEWING;
931  }
932 
933  /**
934  * @brief Check whether a meridian flip has been requested and trigger it
935  * @return true iff a meridian flip has been triggered
936  */
937  bool checkMeridianFlipReady();
938 
939  bool checkGuidingAfterFlip();
940  bool checkAlignmentAfterFlip();
941 
942  // check if a pause has been planned
943  bool checkPausing();
944 
945  /**
946  * @brief Check whether dithering is necessary and trigger it if required.
947  * @return true iff dithering has been triggered
948  */
949  bool checkDithering();
950 
951  void resetFrameToZero();
952 
953  /* Refocus */
954  void startRefocusTimer(bool forced = false);
955 
956  // If exposure timed out, let's handle it.
957  void processCaptureTimeout();
958 
959  // selection of a job
960  void selectedJobChanged(QModelIndex current, QModelIndex previous);
961 
962  // Change filter name in INDI
963  void editFilterName();
964 
965  // short cut for all guiding states that indicate guiding is on
966  bool isGuidingOn();
967  // short cut for all guiding states that indicate guiding in state GUIDING
968  bool isActivelyGuiding();
969 
970  /**
971  * @brief generateScriptArguments Generate argument list to pass to capture script
972  * @return generates argument list consisting of one argument -metadata followed by JSON-formatted key:value pair:
973  * -ts UNIX timestamp
974  * -image full path to captured image (if any)
975  * -size size of file in bytes (if any)
976  * -job {name, index}
977  * -capture {name, index}
978  * -filter
979  * TODO depending on user feedback.
980  */
981  QStringList generateScriptArguments() const;
982  /* Capture */
983 
984  /**
985  * @brief Determine the overall number of target frames with the same signature.
986  * Assume capturing RGBLRGB, where in each sequence job there is only one frame.
987  * For "L" the result will be 1, for "R" it will be 2 etc.
988  * @param frame signature (typically the filter name)
989  * @return
990  */
991  int getTotalFramesCount(QString signature);
992 
993  /**
994  * @brief processCaptureError Handle when image capture fails
995  * @param type error type
996  */
997  void processCaptureError(ISD::Camera::ErrorType type);
998 
999  /**
1000  * @brief setDarkFlatExposure Given a dark flat job, find the exposure suitable from it by searching for
1001  * completed flat frames.
1002  * @param job Dark flat job
1003  * @return True if a matching exposure is found and set, false otherwise.
1004  * @warning This only works if the flat frames were captured in the same live session.
1005  * If the flat frames were captured in another session (i.e. Ekos restarted), then all automatic exposure
1006  * calculation results are discarded since Ekos does not save this information to the sequene file.
1007  * Possible solution is to write to a local config file to keep this information persist between sessions.
1008  */
1009  bool setDarkFlatExposure(SequenceJob *job);
1010 
1011  double seqExpose { 0 };
1012  int seqTotalCount;
1013  int seqCurrentCount { 0 };
1014  // time left of the current exposure
1015  QTime imageCountDown;
1016  double lastRemainingFrameTimeMS;
1017  // time left for the current sequence
1018  QTime sequenceCountDown;
1019 
1020  int seqDelay { 0 };
1021  int retries { 0 };
1022  // Timer for starting the next capture sequence with delay
1023  // @see startNextExposure()
1024  QTimer *seqDelayTimer { nullptr };
1025  // Timer to start the entire capturing with the delay configured
1026  // for the first capture job that is ready to be executed.
1027  // @see start().
1028  QTimer *captureDelayTimer { nullptr };
1029  QString seqPrefix;
1030  int nextSequenceID { 0 };
1031  int seqFileCount { 0 };
1032  bool isBusy { false };
1033  bool m_isFraming { false };
1034 
1035  // Capture timeout timer
1036  QTimer captureTimeout;
1037  uint8_t m_CaptureTimeoutCounter { 0 };
1038  uint8_t m_DeviceRestartCounter { 0 };
1039 
1040  bool useGuideHead { false };
1041  bool autoGuideReady { false};
1042 
1043  QString m_TargetName;
1044  QString m_FullTargetName;
1045  QString m_ObserverName;
1046 
1047  // Currently active sequence job.
1048  // DO NOT SET IT MANUALLY, USE {@see setActiveJob()} INSTEAD!
1049  SequenceJob *activeJob { nullptr };
1050  QSharedPointer<CaptureDeviceAdaptor> m_captureDeviceAdaptor;
1052 
1053  QList<ISD::Camera *> m_Cameras;
1054  QList<ISD::Mount *> m_Mounts;
1055  QList<ISD::Rotator *> m_Rotators;
1056  QList<ISD::FilterWheel *> m_FilterWheels;
1057  QList<ISD::Dome *> m_Domes;
1058  QList<ISD::DustCap *> m_DustCaps;
1059  QList<ISD::LightBox *> m_LightBoxes;
1060 
1061  QList<SequenceJob *> jobs;
1062 
1063  QPointer<QDBusInterface> mountInterface;
1064 
1065  QSharedPointer<FITSData> m_ImageData;
1066 
1067  QStringList m_LogText;
1068  QUrl m_SequenceURL;
1069  bool m_Dirty { false };
1070  bool m_JobUnderEdit { false };
1071  int m_CurrentFilterPosition { -1 };
1072 
1073  // Guide Deviation
1074  bool m_DeviationDetected { false };
1075  int m_SpikesDetected { 0 };
1076  QTimer guideDeviationTimer;
1077 
1078  // Autofocus
1079  /**
1080  * @brief updateHFRThreshold calculate new HFR threshold based on median value for current selected filter
1081  */
1082  void updateHFRThreshold();
1083  bool isInSequenceFocus { false };
1084  bool m_AutoFocusReady { false };
1085  //bool requiredAutoFocusStarted { false };
1086  //bool firstAutoFocus { true };
1087  double focusHFR { 0 }; // HFR value as received from the Ekos focus module
1089  double fileHFR { 0 }; // HFR value as loaded from the sequence file
1090 
1091  // Refocus in progress because of time forced refocus or temperature change
1092  bool isRefocus { false };
1093 
1094  // Fast Exposure
1095  bool m_RememberFastExposure {false};
1096  // Focus on Temperature change
1097  bool isTemperatureDeltaCheckActive { false };
1098  double focusTemperatureDelta { 0 }; // Temperature delta as received from the Ekos focus module
1099 
1100  // Refocus every N minutes
1101  int refocusEveryNMinutesValue { 0 }; // number of minutes between forced refocus
1102  QElapsedTimer refocusEveryNTimer; // used to determine when next force refocus should occur
1103 
1104  bool refocusAfterMeridianFlip { false };// set to true at meridian flip to request refocus
1105 
1106  // Meridian flip
1107  SkyPoint initialMountCoords;
1108  bool resumeAlignmentAfterFlip { false };
1109  bool resumeGuidingAfterFlip { false };
1110  MFStage meridianFlipStage { MF_NONE };
1111 
1112  QString MFStageString(MFStage stage);
1113 
1114  // Flat field automation
1115  QVector<double> ExpRaw, ADURaw;
1116  double targetADU { 0 };
1117  double targetADUTolerance { 1000 };
1118  ADUAlgorithm targetADUAlgorithm { ADU_LEAST_SQUARES};
1119  SkyPoint wallCoord;
1120  bool preMountPark { false };
1121  bool preDomePark { false };
1122  FlatFieldDuration flatFieldDuration { DURATION_MANUAL };
1123  FlatFieldSource flatFieldSource { SOURCE_MANUAL };
1124  bool lightBoxLightEnabled { false };
1125  QMap<ScriptTypes, QString> m_Scripts;
1126 
1127  QUrl dirPath;
1128 
1129  // Misc
1130  bool ignoreJobProgress { true };
1131  bool suspendGuideOnDownload { false };
1132  QJsonArray m_SequenceArray;
1133 
1134  // State
1135  CaptureState m_State { CAPTURE_IDLE };
1136  FocusState m_FocusState { FOCUS_IDLE };
1137  GuideState m_GuideState { GUIDE_IDLE };
1138  IPState m_DitheringState {IPS_IDLE};
1139  AlignState m_AlignState { ALIGN_IDLE };
1140  FilterState m_FilterManagerState { FILTER_IDLE };
1141 
1142  PauseFunctionPointer pauseFunction;
1143 
1144  // CCD Chip frame settings
1146 
1147  // Post capture script
1148  QProcess m_CaptureScript;
1149  uint8_t m_CaptureScriptType {0};
1150 
1151  // Rotator Settings
1152  std::unique_ptr<RotatorSettings> rotatorSettings;
1153 
1154  // How many images to capture before dithering operation is executed?
1155  uint ditherCounter { 0 };
1156  uint inSequenceFocusCounter { 0 };
1157 
1158  std::unique_ptr<CustomProperties> customPropertiesDialog;
1159 
1160  void createDSLRDialog();
1161  std::unique_ptr<DSLRInfo> dslrInfoDialog;
1162 
1163  // DSLR Infos
1164  QList<QMap<QString, QVariant>> DSLRInfos;
1165 
1166  // Captured Frames Map
1167  SchedulerJob::CapturedFramesMap capturedFramesMap;
1168 
1169  // Execute the meridian flip
1170  void setMeridianFlipStage(MFStage stage);
1171  void processFlipCompleted();
1172 
1173  // Controls
1174  double GainSpinSpecialValue { INVALID_VALUE };
1175  double OffsetSpinSpecialValue { INVALID_VALUE };
1176 
1177  // Dark Processor
1178  QPointer<DarkProcessor> m_DarkProcessor;
1179  std::unique_ptr<Ui::Limits> m_LimitsUI;
1180  QPointer<QDialog> m_LimitsDialog;
1181 
1182  QList<double> downloadTimes;
1183  QElapsedTimer m_DownloadTimer;
1184  QTimer downloadProgressTimer;
1185  QVariantMap m_Metadata;
1186  void processGuidingFailed();
1187 };
1188 }
void setISO(int index)
setISO Set index of ISO list.
Definition: capture.h:573
Q_OBJECTQ_OBJECT
const QJsonArray & getSequence() const
getSequence Return the JSON representation of the current sequeue queue
Definition: capture.h:366
bool addFilterWheel(ISD::FilterWheel *device)
Add new Filter Wheel.
Definition: capture.cpp:554
void setTargetTemperature(double temperature)
setTemperature Set the target CCD temperature in the GUI settings.
Definition: capture.cpp:5326
void captureOne()
captureOne Capture one preview image
Definition: capture.cpp:2434
Q_PROPERTY(...)
bool addRotator(ISD::Rotator *device)
Add new Rotator.
Definition: capture.cpp:638
void setPrefix(const QString &prefix)
setPrefix Set target or prefix name used in constructing the generated file name
Definition: capture.h:553
Q_SCRIPTABLE QString getSequenceQueueStatus()
DBUS interface function.
Definition: capture.cpp:5344
Ekos is an advanced Astrophotography tool for Linux. It is based on a modular extensible framework to...
Definition: align.cpp:70
void generateDarkFlats()
generateDarkFlats Generate a list of dark flat jobs from available flat frames.
Definition: capture.cpp:7517
bool addJob(bool preview=false, bool isDarkFlat=false)
addJob Add a new job to the sequence queue given the settings in the GUI.
Definition: capture.cpp:2970
Q_SCRIPTABLE Q_NOREPLY void stop(CaptureState targetState=CAPTURE_IDLE)
DBUS interface function.
Definition: capture.cpp:879
Stores dms coordinates for a point in the sky. for converting between coordinate systems.
Definition: skypoint.h:44
Q_SCRIPTABLE int getOverallRemainingTime()
DBUS interface function.
Definition: capture.cpp:5293
Q_CLASSINFO(Name, Value)
int count(const T &value) const const
void captureImage()
captureImage Initiates image capture in the active job.
Definition: capture.cpp:2475
Q_SCRIPTABLE double getJobExposureProgress(int id)
DBUS interface function.
Definition: capture.cpp:5260
void setDelay(uint16_t delay)
setDelay Set delay between capturing images within a sequence in seconds
Definition: capture.h:544
Q_SCRIPTABLE Q_NOREPLY void start()
DBUS interface function.
Definition: capture.cpp:746
Q_SCRIPTABLE Q_NOREPLY void setMaximumGuidingDeviation(bool enable, double value)
DBUS interface function.
Definition: capture.cpp:5312
Q_SCRIPTABLE bool saveSequenceQueue(const QString &path)
DBUS interface function.
Definition: capture.cpp:4747
void updateCCDTemperature(double value)
updateCCDTemperature Update CCD temperature in capture module.
Definition: capture.cpp:2945
Q_SCRIPTABLE Q_NOREPLY void toggleVideo(bool enabled)
DBUS interface function.
Definition: capture.cpp:6362
Q_SCRIPTABLE bool hasCoolerControl()
DBUS interface function.
Definition: capture.cpp:5891
bool startFocusIfRequired()
Check, if re-focusing is required and initiate it in that case.
Definition: capture.cpp:2329
Q_SCRIPTABLE double getProgressPercentage()
DBUS interface function.
Definition: capture.cpp:5172
void setBinning(int horBin, int verBin)
setBinning Set binning
Definition: capture.h:563
Q_SCRIPTABLE bool setCamera(const QString &device)
DBUS interface function.
Definition: capture.cpp:1014
void checkCamera(int CCDNum=-1)
checkCamera Refreshes the CCD information in the capture module.
Definition: capture.cpp:1039
The QProgressIndicator class lets an application display a progress indicator to show that a long tas...
void showTemperatureRegulation()
showTemperatureRegulation Toggle temperature regulation dialog which sets temperature ramp and thresh...
Definition: capture.cpp:7466
Q_SCRIPTABLE Q_NOREPLY void restartCamera(const QString &name)
DBus interface function.
Definition: capture.cpp:7431
QJsonObject getCalibrationSettings()
getCalibrationSettings Get Calibration settings
Definition: capture.cpp:6847
Sequence Job is a container for the details required to capture a series of images.
Definition: sequencejob.h:18
Q_SCRIPTABLE QString getJobState(int id)
DBUS interface function.
Definition: capture.cpp:5216
void moveJobDown()
moveJobDown Move the job in the sequence queue one place down.
Definition: capture.cpp:3353
void setCount(uint16_t count)
seqCount Set required number of images to capture in one sequence job
Definition: capture.h:535
Q_SCRIPTABLE Q_NOREPLY void setCapturedFramesMap(const QString &signature, int count)
DBUS interface function.
Definition: capture.cpp:6694
void setLimitSettings(const QJsonObject &settings)
setLimitSettings Set limit settings
Definition: capture.cpp:6864
Q_SCRIPTABLE int getJobCount()
DBUS interface function.
Definition: capture.h:193
Q_SCRIPTABLE bool setCoolerControl(bool enable)
DBUS interface function.
Definition: capture.cpp:5899
bool addSequenceJob()
addSequenceJob Add a sequence job.
Definition: capture.cpp:2965
@ CAPTURE_IDLE
Definition: ekos.h:93
void prepareActiveJobStage2()
prepareActiveJob Reset calibration state machine and prepare capture job actions.
Definition: capture.cpp:3607
Q_SCRIPTABLE int getJobImageProgress(int id)
DBUS interface function.
Definition: capture.cpp:5238
CaptureState
Capture states.
Definition: ekos.h:91
Q_SCRIPTABLE QString getJobFilterName(int id)
DBUS interface function.
Definition: capture.cpp:5227
bool addDustCap(ISD::DustCap *device)
Add new Dust Cap.
Definition: capture.cpp:600
bool addMount(ISD::Mount *device)
Add new Mount.
Definition: capture.cpp:618
Q_SCRIPTABLE Q_NOREPLY void pause()
DBUS interface function.
Definition: capture.cpp:673
Q_SCRIPTABLE Q_NOREPLY void suspend()
DBUS interface function.
Definition: capture.h:476
QJsonObject getPresetSettings()
getSettings get current capture settings as a JSON Object
Definition: capture.cpp:5067
Q_SCRIPTABLE bool setFilter(const QString &filter)
DBUS interface function.
Definition: capture.cpp:1640
void processNewTargetName(const QString &name)
processNewTargetName If mount slews to a new object, process it as it can be used for prefix
Definition: capture.cpp:4257
Q_SCRIPTABLE int getJobImageCount(int id)
DBUS interface function.
Definition: capture.cpp:5249
Q_SCRIPTABLE Q_NOREPLY void clearAutoFocusHFR()
DBUS interface function.
Definition: capture.cpp:5907
QString join(const QString &separator) const const
void startFraming()
startFraming Like captureOne but repeating.
Definition: capture.cpp:2451
bool addLightBox(ISD::LightBox *device)
Add new Light Box.
Definition: capture.cpp:656
void preparePreCaptureActions()
preparePreCaptureActions Check if we need to update filter position or CCD temperature before startin...
Definition: capture.cpp:3659
Q_SCRIPTABLE Q_NOREPLY void setInSequenceFocus(bool enable, double HFR)
DBUS interface function.
Definition: capture.cpp:5319
@ CAPTURE_ABORTED
Definition: ekos.h:99
void setPresetSettings(const QJsonObject &settings)
setSettings Set capture settings
Definition: capture.cpp:6703
void processTelescopeNumber(INumberVectorProperty *nvp)
processTelescopeNumber Process number properties arriving from telescope for meridian flip purposes.
Definition: capture.cpp:5399
bool addDome(ISD::Dome *device)
Add new Dome.
Definition: capture.cpp:583
bool setVideoLimits(uint16_t maxBufferSize, uint16_t maxPreviewFPS)
setVideoLimits sets the buffer size and max preview fps for live preview
Definition: capture.cpp:6390
Captures single or sequence of images from a CCD. The capture class support capturing single or multi...
Definition: capture.h:83
void checkFilter(int filterNum=-1)
checkFilter Refreshes the filter wheel information in the capture module.
Definition: capture.cpp:1656
Q_SCRIPTABLE Q_NOREPLY void toggleSequence()
DBUS interface function.
Definition: capture.cpp:694
void syncDSLRToTargetChip(const QString &model)
syncDSLRToTargetChip Syncs INDI driver CCD_INFO property to the DSLR values.
Definition: capture.cpp:7377
Q_SCRIPTABLE Q_NOREPLY void abort()
DBUS interface function.
Definition: capture.h:464
void prepareActiveJobStage1()
prepareActiveJobStage1 Check for pre job script to execute.
Definition: capture.cpp:3583
QJsonObject getLimitSettings()
getLimitSettings Get Limit Settings
Definition: capture.cpp:6908
void setExposure(double value)
setExposure Set desired exposure value in seconds
Definition: capture.h:526
@ CAPTURE_SUSPENDED
Definition: ekos.h:98
Q_SCRIPTABLE int getActiveJobRemainingTime()
DBUS interface function.
Definition: capture.cpp:5304
void updateTargetDistance(double targetDiff)
Slot receiving the update of the current target distance.
Definition: capture.cpp:2465
Q_SCRIPTABLE CCDFrameType getJobFrameType(int id)
DBUS interface function.
Definition: capture.cpp:5282
void registerNewModule(const QString &name)
registerNewModule Register an Ekos module as it arrives via DBus and create the appropriate DBus inte...
Definition: capture.cpp:722
Q_SCRIPTABLE bool setFilterWheel(const QString &device)
DBUS interface function.
Definition: capture.cpp:1606
void setFileSettings(const QJsonObject &settings)
setFileSettings Set File Settings
Definition: capture.cpp:6788
void setCalibrationSettings(const QJsonObject &settings)
setCalibrationSettings Set Calibration settings
Definition: capture.cpp:6826
bool removeJob(int index=-1)
removeJob Remove a job sequence from the queue
Definition: capture.cpp:3257
Q_SCRIPTABLE int getPendingJobCount()
DBUS interface function.
Definition: capture.cpp:5203
bool addCamera(ISD::Camera *device)
Add new Camera.
Definition: capture.cpp:516
void addDSLRInfo(const QString &model, uint32_t maxW, uint32_t maxH, double pixelW, double pixelH)
addDSLRInfo Save DSLR Info the in the database.
Definition: capture.cpp:6625
void processCCDNumber(INumberVectorProperty *nvp)
processCCDNumber Process number properties arriving from CCD.
Definition: capture.cpp:1563
void moveJobUp()
moveJobUp Move the job in the sequence queue one place up.
Definition: capture.cpp:3315
Q_SCRIPTABLE double getJobExposureDuration(int id)
DBUS interface function.
Definition: capture.cpp:5271
QJsonObject getFileSettings()
getFileSettings Compile file setting
Definition: capture.cpp:6809
Q_SCRIPTABLE Q_NOREPLY void clearSequenceQueue()
DBUS interface function.
Definition: capture.cpp:5331
Q_SCRIPTABLE int getActiveJobID()
DBUS interface function.
Definition: capture.cpp:5189
void setGuideDeviation(double delta_ra, double delta_dec)
setGuideDeviation Set the guiding deviation as measured by the guiding module.
Definition: capture.cpp:3825
Q_SCRIPTABLE Q_NOREPLY void ignoreSequenceHistory()
DBUS interface function.
Definition: capture.cpp:4963
Q_SCRIPTABLE bool loadSequenceQueue(const QString &fileURL)
DBUS interface function.
Definition: capture.cpp:4329
void processData(const QSharedPointer< FITSData > &data)
newFITS process new FITS data received from camera.
Definition: capture.cpp:1797
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Fri Aug 12 2022 04:00:52 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.