Kstars

capture.h
1/*
2 SPDX-FileCopyrightText: 2012 Jasem Mutlaq <mutlaqja@ikarustech.com>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "ui_capture.h"
10
11#include "ekos/manager/meridianflipstate.h"
12#include "ekos/ekos.h"
13#include "ekos/auxiliary/opticaltrainsettings.h"
14#include "ekos/focus/focusutils.h"
15#include "indi/indicamera.h"
16#include "indi/indidustcap.h"
17#include "indi/indidome.h"
18#include "indi/indilightbox.h"
19#include "indi/indimount.h"
20
21#include <QTimer>
22#include <QUrl>
23#include <QDBusInterface>
24
25#include <memory>
26
27class DSLRInfo;
29
30/**
31 * @namespace Ekos
32 * @short Ekos is an advanced Astrophotography tool for Linux.
33 * 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 ,
34 * auto-focus & auto-guide capabilities, and capture of single or stack of images with filter wheel support.\n
35 * Features:
36 * - Control your telescope, CCD (& DSLRs), filter wheel, focuser, guider, adaptive optics unit, and any INDI-compatible auxiliary device from Ekos.
37 * - Extremely accurate GOTOs using astrometry.net solver (both Online and Offline solvers supported).
38 * - 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.
39 * - Measure & Correct Polar Alignment errors using astrometry.net solver.
40 * - Auto and manual focus modes using Half-Flux-Radius (HFR) method.
41 * - Automated unattended meridian flip. Ekos performs post meridian flip alignment, calibration, and guiding to resume the capture session.
42 * - Automatic focus between exposures when a user-configurable HFR limit is exceeded.
43 * - Automatic focus between exposures when the temperature has changed a lot since last focus.
44 * - Auto guiding with support for automatic dithering between exposures and support for Adaptive Optics devices in addition to traditional guiders.
45 * - Powerful sequence queue for batch capture of images with optional prefixes, timestamps, filter wheel selection, and much more!
46 * - Export and import sequence queue sets as Ekos Sequence Queue (.esq) files.
47 * - Center the telescope anywhere in a captured FITS image or any FITS with World Coordinate System (WCS) header.
48 * - Automatic flat field capture, just set the desired ADU and let Ekos does the rest!
49 * - Automatic abort and resumption of exposure tasks if guiding errors exceed a user-configurable value.
50 * - Support for dome slaving.
51 * - Complete integration with KStars Observation Planner and SkyMap
52 * - Integrate with all INDI native devices.
53 * - Powerful scripting capabilities via \ref EkosDBusInterface "DBus."
54 *
55 * 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
56 * interface to enable unattended scripting.
57 *
58 * @author Jasem Mutlaq
59 * @version 1.9
60 */
61namespace Ekos
62{
63
64class CaptureDeviceAdaptor;
65class CaptureModuleState;
66class CaptureProcess;
67class ScriptsManager;
68
69/**
70 *@class Capture
71 *@short Captures single or sequence of images from a CCD.
72 * The capture class support capturing single or multiple images from a CCD, it provides a
73 * powerful sequence queue with filter selection. Any sequence queue can be saved as
74 * Ekos Sequence Queue (.esq). All image capture operations are saved as Sequence Jobs
75 * that encapsulate all the different options in a capture process. The user may select in
76 * sequence autofocusing by setting limits for HFR, execution time or temperature delta. When the limit
77 * is exceeded, it automatically trigger autofocus operation. The capture process can also be
78 * 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 *
81 * Controlling the capturing execution is a complex process, that is controlled by
82 * these classes:
83 * - this class, that controll the UI and is the interface for all DBUS functions
84 * - {@see CaptureModuleState} holds all state informations
85 * - {@see CaptureProcess} holds the business logic that controls the process
86 * For ore details about the capturing execution process, please visit {@see CaptureProcess}.
87 *
88 *@author Jasem Mutlaq
89 *@version 1.4
90 */
91class Capture : public QWidget, public Ui::Capture
92{
94 Q_CLASSINFO("D-Bus Interface", "org.kde.kstars.Ekos.Capture")
95 Q_PROPERTY(Ekos::CaptureState status READ status NOTIFY newStatus)
96 Q_PROPERTY(QString targetName READ getTargetName WRITE setTargetName)
97 Q_PROPERTY(QString observerName READ getObserverName WRITE setObserverName)
98 Q_PROPERTY(QString opticalTrain READ opticalTrain WRITE setOpticalTrain)
99 Q_PROPERTY(QString camera READ camera)
100 Q_PROPERTY(QString filterWheel READ filterWheel)
101 Q_PROPERTY(QString filter READ filter WRITE setFilter)
103 Q_PROPERTY(QStringList logText READ logText NOTIFY newLog)
104
105 public:
106 Capture(bool standAlone = false);
107
108 /** @defgroup CaptureDBusInterface Ekos DBus Interface - Capture Module
109 * Ekos::Capture interface provides advanced scripting capabilities to capture image sequences.
110 * @{
111 */
112
113
114 /** DBUS interface function.
115 * select the CCD device from the available CCD drivers.
116 * @param device The CCD device name
117 */
119
120 /** DBUS interface function.
121 * 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.
122 * @param device The filter device name
123 */
125
126 /** DBUS interface function.
127 * select the filter name from the available filters in case a filter device is active.
128 * @param filter The filter name
129 */
130 Q_SCRIPTABLE bool setFilter(const QString &filter);
131 Q_SCRIPTABLE QString filter();
132
133 /** DBUS interface function.
134 * Aborts any current jobs and remove all sequence queue jobs.
135 */
137 {
138 cameraUI->clearSequenceQueue();
139 }
140
141 /** DBUS interface function.
142 * 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
143 * 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".
144 */
146 {
147 return state()->sequenceQueueStatus();
148 }
149
150 /** DBUS interface function.
151 * Loads the Ekos Sequence Queue file in the Sequence Queue. Jobs are appended to existing jobs.
152 * @param fileURL full URL of the filename
153 * @param targetName override the target in the sequence queue file (necessary for using the target of the scheduler)
154 */
156 {
157 return cameraUI->loadSequenceQueue(fileURL, targetName);
158 }
159
160 /** DBUS interface function.
161 * Saves the Sequence Queue to the Ekos Sequence Queue file.
162 * @param fileURL full URL of the filename
163 */
165 {
166 return cameraUI->saveSequenceQueue(path);
167 }
168
169 /** DBUS interface function.
170 * Enables or disables the maximum guiding deviation and sets its value.
171 * @param enable If true, enable the guiding deviation check, otherwise, disable it.
172 * @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.
173 */
174 Q_SCRIPTABLE Q_NOREPLY void setMaximumGuidingDeviation(bool enable, double value)
175 {
176 cameraUI->setMaximumGuidingDeviation(enable, value);
177 }
178
179 /** DBUS interface function.
180 * Enables or disables the in sequence focus and sets Half-Flux-Radius (HFR) limit.
181 * @param enable If true, enable the in sequence auto focus check, otherwise, disable it.
182 * @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.
183 */
184 Q_SCRIPTABLE Q_NOREPLY void setInSequenceFocus(bool enable, double HFR)
185 {
186 cameraUI->setInSequenceFocus(enable, HFR);
187 }
188
189 /** DBUS interface function.
190 * Does the CCD has a cooler control (On/Off) ?
191 */
193
194 /** DBUS interface function.
195 * Set the CCD cooler ON/OFF
196 *
197 */
198 Q_SCRIPTABLE bool setCoolerControl(bool enable);
199
200 /** DBUS interface function.
201 * @return Returns the percentage of completed captures in all active jobs
202 */
204 {
205 return state()->progressPercentage();
206 }
207
208 /** DBUS interface function.
209 * @return Returns true if an ongoing capture is a preview capture.
210 */
212 {
213 return cameraUI->isActiveJobPreview();
214 }
215
216 /** DBUS interface function.
217 * @return Returns the number of jobs in the sequence queue.
218 */
220 {
221 return state()->allJobs().count();
222 }
223
224 /** DBUS interface function.
225 * @return Returns the number of pending uncompleted jobs in the sequence queue.
226 */
228 {
229 return state()->pendingJobCount();
230 }
231
232 /** DBUS interface function.
233 * @return Returns ID of current active job if any, or -1 if there are no active jobs.
234 */
236 {
237 return state()->activeJobID();
238 }
239
240 /** DBUS interface function.
241 * @return Returns time left in seconds until active job is estimated to be complete.
242 */
244 {
245 return state()->activeJobRemainingTime();
246 }
247
248 /** DBUS interface function.
249 * @return Returns overall time left in seconds until all jobs are estimated to be complete
250 */
252 {
253 return state()->overallRemainingTime();
254 }
255
256 /** DBUS interface function.
257 * @param id job number. Job IDs start from 0 to N-1.
258 * @return Returns the job state (Idle, In Progress, Error, Aborted, Complete)
259 */
261 {
262 return state()->jobState(id);
263 }
264
265 /** DBUS interface function.
266 * @param id job number. Job IDs start from 0 to N-1.
267 * @return Returns the job filter name.
268 */
270 {
271 return state()->jobFilterName(id);
272 }
273
274 /** DBUS interface function.
275 * @param id job number. Job IDs start from 0 to N-1.
276 * @return Returns The number of images completed capture in the job.
277 */
279 {
280 return state()->jobImageProgress(id);
281 }
282
283 /** DBUS interface function.
284 * @param id job number. Job IDs start from 0 to N-1.
285 * @return Returns the total number of images to capture in the job.
286 */
288 {
289 return state()->jobImageCount(id);
290 }
291
292 /** DBUS interface function.
293 * @param id job number. Job IDs start from 0 to N-1.
294 * @return Returns the number of seconds left in an exposure operation.
295 */
297 {
298 return state()->jobExposureProgress(id);
299 }
300
301 /** DBUS interface function.
302 * @param id job number. Job IDs start from 0 to N-1.
303 * @return Returns the total requested exposure duration in the job.
304 */
306 {
307 return state()->jobExposureDuration(id);
308 }
309
310 /** DBUS interface function.
311 * @param id job number. Job IDs start from 0 to N-1.
312 * @return Returns the frame type (light, dark, ...) of the job.
313 */
314 Q_SCRIPTABLE CCDFrameType getJobFrameType(int id)
315 {
316 return state()->jobFrameType(id);
317 }
318
319 /** DBUS interface function.
320 * Clear in-sequence focus settings. It sets the autofocus HFR to zero so that next autofocus value is remembered for the in-sequence focusing.
321 */
323 {
324 cameraUI->clearAutoFocusHFR();
325 }
326
327 /** DBUS interface function.
328 * Jobs will NOT be checked for progress against the file system and will be always assumed as new jobs.
329 */
330 Q_SCRIPTABLE Q_NOREPLY void ignoreSequenceHistory();
331
332 /** DBUS interface function.
333 * Set count of already completed frames. This is required when we have identical external jobs
334 * with identical paths, but we need to continue where we left off. For example, if we have 3 identical
335 * jobs, each capturing 5 images. Let's suppose 9 images were captured before. If the count for this signature
336 * is set to 1, then we continue to capture frame #2 even though the number of completed images is already
337 * larger than required count (5). It is mostly used in conjunction with Ekos Scheduler.
338 */
339 Q_SCRIPTABLE Q_NOREPLY void setCapturedFramesMap(const QString &signature, int count)
340 {
341 state()->setCapturedFramesCount(signature, static_cast<ushort>(count));
342 };
343
344
345 /** DBUS interface function.
346 * List of logging entries for the capture module.
347 */
349 {
350 return m_LogText;
351 }
352
353 /** DBUS interface function.
354 * Single text string holding all log lines for the capture module.
355 */
357 {
358 return m_LogText.join("\n");
359 }
360
361 /** DBUS interface function.
362 * Status of the capture module
363 */
365 {
366 return state()->getCaptureState();
367 }
368 /** @} end of group CaptureDBusInterface */
369
370
371 // ////////////////////////////////////////////////////////////////////
372 // Changing the devices used by Capture
373 // ////////////////////////////////////////////////////////////////////
374
375 /**
376 * @brief Add new Camera
377 * @param device pointer to camera device.
378 * @return True if added successfully, false if duplicate or failed to add.
379 */
380 bool updateCamera();
381
382 /**
383 * @brief setDome Set dome device
384 * @param device pointer to dome device
385 * @return true if successfull, false otherewise.
386 */
387 bool setDome(ISD::Dome *device);
388
389 /**
390 * @brief Generic method for removing any connected device.
391 */
393
394 /**
395 * @brief registerNewModule Register an Ekos module as it arrives via DBus
396 * and create the appropriate DBus interface to communicate with it.
397 * @param name of module
398 */
399 void registerNewModule(const QString &name);
400
401 // ////////////////////////////////////////////////////////////////////
402 // Optical Train handling
403 // ////////////////////////////////////////////////////////////////////
404
405 QString opticalTrain() const
406 {
407 return cameraUI->opticalTrainCombo->currentText();
408 }
409 void setOpticalTrain(const QString &value)
410 {
411 cameraUI->opticalTrainCombo->setCurrentText(value);
412 }
413
414 // ////////////////////////////////////////////////////////////////////
415 // Read and write access for EkosLive
416 // ////////////////////////////////////////////////////////////////////
417
418 /**
419 * @brief getSequence Return the JSON representation of the current sequeue queue
420 * @return Reference to JSON array containing sequence queue jobs.
421 */
422 const QJsonArray &getSequence() const
423 {
424 return state()->getSequence();
425 }
426
427 /**
428 * @brief setVideoLimits sets the buffer size and max preview fps for live preview
429 * @param maxBufferSize in bytes
430 * @param maxPreviewFPS number of frames per second
431 * @return True if value is updated, false otherwise.
432 */
433 bool setVideoLimits(uint16_t maxBufferSize, uint16_t maxPreviewFPS);
434
435 QSharedPointer<CaptureDeviceAdaptor> m_captureDeviceAdaptor;
436
437 public slots:
438 // ////////////////////////////////////////////////////////////////////
439 // Main capturing actions
440 // ////////////////////////////////////////////////////////////////////
441
442 /** \addtogroup CaptureDBusInterface
443 * @{
444 */
445
446 /** DBUS interface function.
447 * @brief Start the execution of the Capture::SequenceJob list #jobs.
448 *
449 * Starting the execution of the Capture::SequenceJob list selects the first job
450 * from the list that may be executed and starts to prepare the job (@see prepareJob()).
451 *
452 * Several factors determine, which of the jobs will be selected:
453 * - First, the list is searched to find the first job that is marked as idle or aborted.
454 * - If none is found, it is checked whether ignoring job progress is set. If yes,
455 * all jobs are are reset (@see reset()) and the first one from the list is selected.
456 * If no, the user is asked whether the jobs should be reset. If the user declines,
457 * starting is aborted.
458 */
459 Q_SCRIPTABLE Q_NOREPLY void start()
460 {
461 cameraUI->start();
462 }
463
464 /** DBUS interface function.
465 * Stops currently running jobs:
466 * CAPTURE_IDLE: capture in idle state waiting for further action (e.g. single sequence
467 * is complete, next one starting)
468 * CAPTURE_COMPLETE: all capture sequences are complete
469 * CAPTURE_ABORT: capture aborted either by user interaction or by a technical error
470 * CAPTURE_SUSPEND: capture suspended and waiting to be restarted
471 * @param targetState status of the job after stop
472 */
473 Q_SCRIPTABLE Q_NOREPLY void stop(CaptureState targetState = CAPTURE_IDLE)
474 {
475 cameraUI->stop(targetState);
476 }
477
478 /** DBUS interface function.
479 * Aborts all jobs and mark current state as ABORTED. It simply calls stop(CAPTURE_ABORTED)
480 */
481 Q_SCRIPTABLE Q_NOREPLY void abort()
482 {
483 cameraUI->abort();
484 }
485
486 /** DBUS interface function.
487 * Aborts all jobs and mark current state as SUSPENDED. It simply calls stop(CAPTURE_SUSPENDED)
488 * The only difference between SUSPENDED and ABORTED it that capture module can automatically resume a suspended
489 * state on its own without external trigger once the right conditions are met. When whatever reason caused the module
490 * to go into suspended state ceases to exist, the capture module automatically resumes. On the other hand, ABORTED state
491 * must be started via an external programmatic or user trigger (e.g. click the start button again).
492 */
493 Q_SCRIPTABLE Q_NOREPLY void suspend()
494 {
495 cameraUI->suspend();
496 }
497 /** DBUS interface function.
498 * @brief pause Pauses the Sequence Queue progress AFTER the current capture is complete.
499 */
500 Q_SCRIPTABLE Q_NOREPLY void pause()
501 {
502 cameraUI->pause();
503 }
504
505 /** DBUS interface function.
506 * @brief toggleSequence Toggle sequence state depending on its current state.
507 * 1. If paused, then resume sequence.
508 * 2. If idle or completed, then start sequence.
509 * 3. Otherwise, abort current sequence.
510 */
512 {
513 cameraUI->toggleSequence();
514 }
515
516
517 /** DBUS interface function.
518 * Toggle video streaming if supported by the device.
519 * @param enabled Set to true to start video streaming, false to stop it if active.
520 */
521 Q_SCRIPTABLE Q_NOREPLY void toggleVideo(bool enabled)
522 {
523 cameraUI->toggleVideo(enabled);
524 }
525
526
527 /** DBus interface function
528 * @brief restartCamera Restarts the INDI driver associated with a camera. Remote and Local drivers are supported.
529 * @param name Name of camera to restart. If a driver defined multiple cameras, they would be removed and added again
530 * after driver restart.
531 */
532 Q_SCRIPTABLE Q_NOREPLY void restartCamera(const QString &name)
533 {
534 cameraUI->restartCamera(name);
535 }
536
537 /** DBus interface function
538 * @brief Set the name of the target to be captured.
539 */
540 Q_SCRIPTABLE Q_NOREPLY void setTargetName(const QString &newTargetName)
541 {
542 cameraUI->setTargetName(newTargetName);
543 }
544
545 Q_SCRIPTABLE QString getTargetName();
546
547 /** DBus interface function
548 * @brief Set the observer name.
549 */
550 Q_SCRIPTABLE Q_NOREPLY void setObserverName(const QString &value)
551 {
552 cameraUI->setObserverName(value);
553 };
554 Q_SCRIPTABLE QString getObserverName()
555 {
556 return cameraUI->getObserverName();
557 }
558
559 /** @}*/
560
561 /**
562 * @brief process shortcut for the process engine
563 */
565 {
566 return m_captureProcess;
567 }
568
569 // ////////////////////////////////////////////////////////////////////
570 // public capture settings
571 // ////////////////////////////////////////////////////////////////////
572 /**
573 * @brief Slot receiving the update of the current target distance.
574 * @param targetDiff distance to the target in arcseconds.
575 */
577 {
578 cameraUI->updateTargetDistance(targetDiff);
579 }
580
581
582 /**
583 * @brief MeridianFlipState Access to the meridian flip state machine
584 */
586 {
587 return state()->getMeridianFlipState();
588 }
589 void setMeridianFlipState(QSharedPointer<MeridianFlipState> newstate);
590
591 // ////////////////////////////////////////////////////////////////////
592 // slots handling device and module events
593 // ////////////////////////////////////////////////////////////////////
594
595 /**
596 * @brief setGuideDeviation Set the guiding deviation as measured by the guiding module. Abort capture
597 * if deviation exceeds user value. Resume capture if capture was aborted and guiding
598 * deviations are below user value.
599 * @param delta_ra Deviation in RA in arcsecs from the selected guide star.
600 * @param delta_dec Deviation in DEC in arcsecs from the selected guide star.
601 */
602 void setGuideDeviation(double delta_ra, double delta_dec);
603
604 void setGuideChip(ISD::CameraChip *guideChip);
605
606 // Auto Focus
607 /**
608 * @brief setFocusStatus Forward the new focus state to the capture module state machine
609 */
610 void setFocusStatus(FocusState newstate)
611 {
612 cameraUI->setFocusStatus(newstate);
613 }
614
615
616 // Adaptive Focus
617 /**
618 * @brief focusAdaptiveComplete Forward the new focus state to the capture module state machine
619 */
620 void focusAdaptiveComplete(bool success)
621 {
622 // directly forward it to the state machine
623 cameraUI->focusAdaptiveComplete(success);
624 }
625
626 /**
627 * @brief updateAdaptiveFocusStatus Handle new focus state
628 */
629
631
632 /**
633 * @brief setHFR Receive the measured HFR value of the latest frame
634 */
635 void setHFR(double newHFR, int position, bool inAutofocus);
636
637 // Guide
638 void setGuideStatus(GuideState newstate);
639
640 // Align
641
642 void setAlignStatus(Ekos::AlignState newstate);
643 void setAlignResults(double solverPA, double ra, double de, double pixscale);
644
645 // Update Mount module status
646 void setMountStatus(ISD::Mount::Status newState);
647
648 // ////////////////////////////////////////////////////////////////////
649 // Module logging
650 // ////////////////////////////////////////////////////////////////////
651 Q_SCRIPTABLE void clearLog();
652 void appendLogText(const QString &);
653
654
655 private slots:
656
657 // ////////////////////////////////////////////////////////////////////
658 // UI controls
659 // ////////////////////////////////////////////////////////////////////
660
661 signals:
662 Q_SCRIPTABLE void newLog(const QString &text);
663 Q_SCRIPTABLE void meridianFlipStarted();
664 Q_SCRIPTABLE void guideAfterMeridianFlip();
665 Q_SCRIPTABLE void newStatus(CaptureState status);
666 Q_SCRIPTABLE void captureComplete(const QVariantMap &metadata);
667
668 void newFilterStatus(FilterState state);
669
670 void ready();
671
672 // communication with other modules
673 void checkFocus(double);
674 void runAutoFocus(AutofocusReason autofocusReason, const QString &reasonInfo);
675 void resetFocus();
676 void abortFocus();
677 void adaptiveFocus();
678 void suspendGuiding();
679 void resumeGuiding();
680 void captureTarget(QString targetName);
681 void newImage(SequenceJob *job, const QSharedPointer<FITSData> &data);
682 void newExposureProgress(SequenceJob *job);
683 void newDownloadProgress(double);
684 void sequenceChanged(const QJsonArray &sequence);
685 void settingsUpdated(const QVariantMap &settings);
686 void newLocalPreview(const QString &preview);
687 void dslrInfoRequested(const QString &cameraName);
688 void driverTimedout(const QString &deviceName);
689
690 // Signals for the Analyze tab.
691 void captureStarting(double exposureSeconds, const QString &filter);
692 void captureAborted(double exposureSeconds);
693
694 // Filter Manager
695 void filterManagerUpdated(ISD::FilterWheel *device);
696
697 void trainChanged();
698
699
700 private:
701 // ////////////////////////////////////////////////////////////////////
702 // capture process steps
703 // ////////////////////////////////////////////////////////////////////
704
705 // Propagate meridian flip state changes to the UI
706 void updateMeridianFlipStage(MeridianFlipState::MFStage stage);
707
708 // ////////////////////////////////////////////////////////////////////
709 // helper functions
710 // ////////////////////////////////////////////////////////////////////
711
712 // shortcut for the module state
714 {
715 return m_captureModuleState;
716 }
717 // shortcut to device adapter
719 {
720 return m_captureDeviceAdaptor;
721 }
722 // shortcut for the active job
723 SequenceJob *activeJob() const
724 {
725 return state()->getActiveJob();
726 }
727 // Shortcut to the active camera held in the device adaptor
728 ISD::Camera *activeCamera()
729 {
730 return cameraUI->activeCamera();
731 }
732
733 /**
734 * @brief Sync refocus options to the GUI settings
735 */
736 //void syncRefocusOptionsFromGUI();
737
738 // ////////////////////////////////////////////////////////////////////
739 // UI controls
740 // ////////////////////////////////////////////////////////////////////
741
742 // ////////////////////////////////////////////////////////////////////
743 // device control
744 // ////////////////////////////////////////////////////////////////////
745
746 /**
747 * @brief processCCDNumber Process number properties arriving from CCD. Currently, only CCD and Guider frames are processed.
748 * @param nvp pointer to number property.
749 */
750 void processCCDNumber(INumberVectorProperty *nvp);
751
752 // ////////////////////////////////////////////////////////////////////
753 // Attributes
754 // ////////////////////////////////////////////////////////////////////
755 double seqExpose { 0 };
756 int seqTotalCount;
757 int seqCurrentCount { 0 };
758
759 QSharedPointer<CaptureProcess> m_captureProcess;
760 QSharedPointer<CaptureModuleState> m_captureModuleState;
761
762 QPointer<QDBusInterface> mountInterface;
763
764 QStringList m_LogText;
765
766 // Flat field automation
768
769 // Controls
770 double GainSpinSpecialValue { INVALID_VALUE };
771 double OffsetSpinSpecialValue { INVALID_VALUE };
772
773 QVariantMap m_Metadata;
774};
775
776}
Captures single or sequence of images from a CCD.
Definition capture.h:92
bool setVideoLimits(uint16_t maxBufferSize, uint16_t maxPreviewFPS)
setVideoLimits sets the buffer size and max preview fps for live preview
Definition capture.cpp:309
bool setDome(ISD::Dome *device)
setDome Set dome device
Definition capture.cpp:160
void setFocusTemperatureDelta(double focusTemperatureDelta, double absTemperature)
updateAdaptiveFocusStatus Handle new focus state
Definition capture.cpp:243
void setHFR(double newHFR, int position, bool inAutofocus)
setHFR Receive the measured HFR value of the latest frame
Definition capture.cpp:384
void updateTargetDistance(double targetDiff)
Slot receiving the update of the current target distance.
Definition capture.h:576
void setFocusStatus(FocusState newstate)
setFocusStatus Forward the new focus state to the capture module state machine
Definition capture.h:610
QSharedPointer< CaptureProcess > process() const
process shortcut for the process engine
Definition capture.h:564
bool updateCamera()
Add new Camera.
Definition capture.cpp:142
void setGuideDeviation(double delta_ra, double delta_dec)
setGuideDeviation Set the guiding deviation as measured by the guiding module.
Definition capture.cpp:252
void focusAdaptiveComplete(bool success)
focusAdaptiveComplete Forward the new focus state to the capture module state machine
Definition capture.h:620
void registerNewModule(const QString &name)
registerNewModule Register an Ekos module as it arrives via DBus and create the appropriate DBus inte...
Definition capture.cpp:165
const QJsonArray & getSequence() const
getSequence Return the JSON representation of the current sequeue queue
Definition capture.h:422
QSharedPointer< MeridianFlipState > getMeridianFlipState()
MeridianFlipState Access to the meridian flip state machine.
Definition capture.h:585
void removeDevice(const QSharedPointer< ISD::GenericDevice > &device)
Generic method for removing any connected device.
Definition capture.cpp:371
CameraChip class controls a particular chip in camera.
Camera class controls an INDI Camera device.
Definition indicamera.h:44
Class handles control of INDI dome devices.
Definition indidome.h:23
Sequence Job is a container for the details required to capture a series of images.
Q_SCRIPTABLE bool hasCoolerControl()
DBUS interface function.
Definition capture.cpp:361
Q_SCRIPTABLE double getJobExposureProgress(int id)
DBUS interface function.
Definition capture.h:296
Q_SCRIPTABLE bool isActiveJobPreview()
DBUS interface function.
Definition capture.h:211
Q_SCRIPTABLE Q_NOREPLY void setInSequenceFocus(bool enable, double HFR)
DBUS interface function.
Definition capture.h:184
Q_SCRIPTABLE Q_NOREPLY void abort()
DBUS interface function.
Definition capture.h:481
Q_SCRIPTABLE Q_NOREPLY void setCapturedFramesMap(const QString &signature, int count)
DBUS interface function.
Definition capture.h:339
Q_SCRIPTABLE int getActiveJobID()
DBUS interface function.
Definition capture.h:235
Q_SCRIPTABLE QString getJobState(int id)
DBUS interface function.
Definition capture.h:260
Q_SCRIPTABLE Q_NOREPLY void clearAutoFocusHFR()
DBUS interface function.
Definition capture.h:322
Q_SCRIPTABLE Q_NOREPLY void toggleSequence()
DBUS interface function.
Definition capture.h:511
Q_SCRIPTABLE Q_NOREPLY void setTargetName(const QString &newTargetName)
DBus interface function.
Definition capture.h:540
Q_SCRIPTABLE Q_NOREPLY void toggleVideo(bool enabled)
DBUS interface function.
Definition capture.h:521
Q_SCRIPTABLE Q_NOREPLY void setMaximumGuidingDeviation(bool enable, double value)
DBUS interface function.
Definition capture.h:174
Q_SCRIPTABLE QString getSequenceQueueStatus()
DBUS interface function.
Definition capture.h:145
Q_SCRIPTABLE Q_NOREPLY void ignoreSequenceHistory()
DBUS interface function.
Definition capture.cpp:291
Q_SCRIPTABLE int getJobCount()
DBUS interface function.
Definition capture.h:219
Q_SCRIPTABLE Q_NOREPLY void restartCamera(const QString &name)
DBus interface function.
Definition capture.h:532
Q_SCRIPTABLE Q_NOREPLY void stop(CaptureState targetState=CAPTURE_IDLE)
DBUS interface function.
Definition capture.h:473
Q_SCRIPTABLE double getProgressPercentage()
DBUS interface function.
Definition capture.h:203
Q_SCRIPTABLE QString getJobFilterName(int id)
DBUS interface function.
Definition capture.h:269
Q_SCRIPTABLE Q_NOREPLY void setObserverName(const QString &value)
DBus interface function.
Definition capture.h:550
Q_SCRIPTABLE double getJobExposureDuration(int id)
DBUS interface function.
Definition capture.h:305
Q_SCRIPTABLE QString filterWheel()
DBUS interface function.
Q_SCRIPTABLE QString camera()
DBUS interface function.
Q_SCRIPTABLE QStringList logText()
DBUS interface function.
Definition capture.h:348
Q_SCRIPTABLE int getActiveJobRemainingTime()
DBUS interface function.
Definition capture.h:243
Q_SCRIPTABLE bool setCoolerControl(bool enable)
DBUS interface function.
Definition capture.cpp:366
Q_SCRIPTABLE bool setFilter(const QString &filter)
DBUS interface function.
Definition capture.cpp:209
Q_SCRIPTABLE Q_NOREPLY void start()
DBUS interface function.
Definition capture.h:459
Q_SCRIPTABLE CCDFrameType getJobFrameType(int id)
DBUS interface function.
Definition capture.h:314
Q_SCRIPTABLE int getJobImageCount(int id)
DBUS interface function.
Definition capture.h:287
Q_SCRIPTABLE int getJobImageProgress(int id)
DBUS interface function.
Definition capture.h:278
Q_SCRIPTABLE bool saveSequenceQueue(const QString &path)
DBUS interface function.
Definition capture.h:164
Q_SCRIPTABLE int getOverallRemainingTime()
DBUS interface function.
Definition capture.h:251
Q_SCRIPTABLE QString getLogText()
DBUS interface function.
Definition capture.h:356
Q_SCRIPTABLE bool loadSequenceQueue(const QString &fileURL, QString targetName="")
DBUS interface function.
Definition capture.h:155
Q_SCRIPTABLE int getPendingJobCount()
DBUS interface function.
Definition capture.h:227
Q_SCRIPTABLE Q_NOREPLY void pause()
DBUS interface function.
Definition capture.h:500
Q_SCRIPTABLE CaptureState status()
DBUS interface function.
Definition capture.h:364
Q_SCRIPTABLE Q_NOREPLY void suspend()
DBUS interface function.
Definition capture.h:493
Q_SCRIPTABLE Q_NOREPLY void clearSequenceQueue()
DBUS interface function.
Definition capture.h:136
Ekos is an advanced Astrophotography tool for Linux.
Definition align.cpp:79
AlignState
Definition ekos.h:145
CaptureState
Capture states.
Definition ekos.h:92
@ CAPTURE_IDLE
Definition ekos.h:93
Q_CLASSINFO(Name, Value)
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
QString join(QChar separator) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 17 2024 11:48:25 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.