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

KDE's Doxygen guidelines are available online.