Kstars

camera.h
1/*
2 SPDX-FileCopyrightText: 2012 Jasem Mutlaq <mutlaqja@ikarustech.com>
3 SPDX-FileCopyrightText: 2024 Wolfgang Reissenberger <sterne-jaeger@openfuture.de>
4
5 SPDX-License-Identifier: GPL-2.0-or-later
6*/
7
8#pragma once
9#include "ui_camera.h"
10#include "ui_limits.h"
11#include "ui_calibrationoptions.h"
12#include "capturetypes.h"
13#include "customproperties.h"
14#include "rotatorsettings.h"
15#include "sequencejob.h"
16
17namespace
18{
19
20// Columns in the job table
21enum JobTableColumnIndex
22{
23 JOBTABLE_COL_STATUS = 0,
24 JOBTABLE_COL_FILTER,
25 JOBTABLE_COL_COUNTS,
26 JOBTABLE_COL_EXP,
27 JOBTABLE_COL_TYPE,
28 JOBTABLE_COL_BINNING,
29 JOBTABLE_COL_ISO,
30 JOBTABLE_COL_OFFSET
31};
32} // namespace
33
34class DSLRInfo;
35
36namespace Ekos
37{
38
39class Capture;
40class CaptureDeviceAdaptor;
41class CameraProcess;
42class CameraState;
43class ScriptsManager;
44class FilterManager;
45class SequenceJob;
46
47class Camera : public QWidget, public Ui::Camera
48{
50 friend class Capture;
51public:
52
53 // default constructor
54 explicit Camera(int id = 0, bool standAlone = false, QWidget *parent = nullptr);
55 // constructor for standalone editor
56 explicit Camera(bool standAlone = false, QWidget *parent = nullptr);
57 ~Camera();
58
59 // ////////////////////////////////////////////////////////////////////
60 // device control
61 // ////////////////////////////////////////////////////////////////////
62 // Gain
63 // This sets and gets the custom properties target gain
64 // it does not access the ccd gain property
65 void setGain(double value);
66 double getGain();
67
68 void setOffset(double value);
69 double getOffset();
70
71 /**
72 * @brief Add new Rotator
73 * @param name name of the new rotator
74 */
75 void setRotator(QString name);
76
77 /**
78 * @brief addDSLRInfo Save DSLR Info the in the database. If the interactive dialog was open, close it.
79 * @param model Camera name
80 * @param maxW Maximum width in pixels
81 * @param maxH Maximum height in pixels
82 * @param pixelW Pixel horizontal size in microns
83 * @param pixelH Pizel vertical size in microns
84 */
85 void addDSLRInfo(const QString &model, uint32_t maxW, uint32_t maxH, double pixelW, double pixelH);
86
87 // ////////////////////////////////////////////////////////////////////
88 // Main capturing actions
89 // ////////////////////////////////////////////////////////////////////
90 /**
91 * @brief Start the execution of the Capture::SequenceJob list #jobs.
92 *
93 * Starting the execution of the Capture::SequenceJob list selects the first job
94 * from the list that may be executed and starts to prepare the job (@see prepareJob()).
95 *
96 * Several factors determine, which of the jobs will be selected:
97 * - First, the list is searched to find the first job that is marked as idle or aborted.
98 * - If none is found, it is checked whether ignoring job progress is set. If yes,
99 * all jobs are are reset (@see reset()) and the first one from the list is selected.
100 * If no, the user is asked whether the jobs should be reset. If the user declines,
101 * starting is aborted.
102 */
103 void start();
104
105 /**
106 * Stops currently running jobs:
107 * CAPTURE_IDLE: capture in idle state waiting for further action (e.g. single sequence
108 * is complete, next one starting)
109 * CAPTURE_COMPLETE: all capture sequences are complete
110 * CAPTURE_ABORT: capture aborted either by user interaction or by a technical error
111 * CAPTURE_SUSPEND: capture suspended and waiting to be restarted
112 * @param targetState status of the job after stop
113 */
114 void stop(CaptureState targetState = CAPTURE_IDLE);
115
116 /**
117 * Aborts all jobs and mark current state as ABORTED. It simply calls stop(CAPTURE_ABORTED)
118 */
119 void abort()
120 {
121 stop(CAPTURE_ABORTED);
122 }
123
124 /**
125 * Aborts all jobs and mark current state as SUSPENDED. It simply calls stop(CAPTURE_SUSPENDED)
126 * The only difference between SUSPENDED and ABORTED it that capture module can automatically resume a suspended
127 * state on its own without external trigger once the right conditions are met. When whatever reason caused the module
128 * to go into suspended state ceases to exist, the capture module automatically resumes. On the other hand, ABORTED state
129 * must be started via an external programmatic or user trigger (e.g. click the start button again).
130 */
131 void suspend()
132 {
133 stop(CAPTURE_SUSPENDED);
134 }
135
136 /** DBUS interface function.
137 * @brief pause Pauses the Sequence Queue progress AFTER the current capture is complete.
138 */
139 void pause();
140
141 /**
142 * @brief toggleSequence Toggle sequence state depending on its current state.
143 * 1. If paused, then resume sequence.
144 * 2. If idle or completed, then start sequence.
145 * 3. Otherwise, abort current sequence.
146 */
147 void toggleSequence();
148
149 /**
150 * Toggle video streaming if supported by the device.
151 * @param enabled Set to true to start video streaming, false to stop it if active.
152 */
153 void toggleVideo(bool enabled);
154
155 /**
156 * @brief restartCamera Restarts the INDI driver associated with a camera. Remote and Local drivers are supported.
157 * @param name Name of camera to restart. If a driver defined multiple cameras, they would be removed and added again
158 * after driver restart.
159 */
160 void restartCamera(const QString &name);
161
162 /**
163 * @brief capturePreview Capture a single preview image
164 */
165 void capturePreview();
166
167 /**
168 * @brief startFraming Like captureOne but repeating.
169 */
170 void startFraming();
171
172 /**
173 * @brief generateDarkFlats Generate a list of dark flat jobs from available flat frames.
174 */
175 void generateDarkFlats();
176
177 /**
178 * @brief setDownloadProgress update the Capture Module and Summary
179 * Screen's estimate of how much time is left in the download
180 */
181 void updateDownloadProgress(double downloadTimeLeft, const QString &devicename);
182
183 void updateCaptureCountDown(int deltaMillis);
184
185 // ////////////////////////////////////////////////////////////////////
186 // Job handling
187 // ////////////////////////////////////////////////////////////////////
188
189 /**
190 * @brief createJob Create a new job with the settings given in the GUI.
191 * @param jobtype batch, preview, looping or dark flat job.
192 * @param filenamePreview if the job is to generate a preview filename
193 * @return pointer to job created or nullptr otherwise.
194 */
195 QSharedPointer<SequenceJob> createJob(SequenceJob::SequenceJobType jobtype = SequenceJob::JOBTYPE_BATCH,
196 FilenamePreviewType filenamePreview = FILENAME_NOT_PREVIEW);
197
198 /**
199 * @brief removeJob Remove a job sequence from the queue
200 * @param index Row index for job to remove, if left as -1 (default), the currently selected row will be removed.
201 * if no row is selected, the last job shall be removed.
202 * @param true if sequence is removed. False otherwise.
203 */
204 Q_INVOKABLE bool removeJob(int index = -1);
205
206 /**
207 * @brief modifyJob Select a job and enter edit state
208 * @param index Row index for job to edit, if left as -1 (default), the currently selected row will be edited.
209 * @param true if sequence is in edit state. False otherwise.
210 */
211 Q_INVOKABLE bool modifyJob(int index = -1);
212
213 // ////////////////////////////////////////////////////////////////////
214 // Process control
215 // ////////////////////////////////////////////////////////////////////
216 /**
217 * Enables or disables the maximum guiding deviation and sets its value.
218 * @param enable If true, enable the guiding deviation check, otherwise, disable it.
219 * @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.
220 */
221 void setMaximumGuidingDeviation(bool enable, double value);
222
223 /**
224 * Enables or disables the in sequence focus and sets Half-Flux-Radius (HFR) limit.
225 * @param enable If true, enable the in sequence auto focus check, otherwise, disable it.
226 * @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.
227 */
228 void setInSequenceFocus(bool enable, double HFR);
229
230 /**
231 * Loads the Ekos Sequence Queue file in the Sequence Queue. Jobs are appended to existing jobs.
232 * @param fileURL full URL of the filename
233 * @param targetName override the target in the sequence queue file (necessary for using the target of the scheduler)
234 */
235 bool loadSequenceQueue(const QString &fileURL, QString targetName = "");
236
237 /**
238 * Saves the Sequence Queue to the Ekos Sequence Queue file.
239 * @param fileURL full URL of the filename
240 */
241 bool saveSequenceQueue(const QString &path);
242
243 /**
244 * @brief Update the camera's capture state
245 */
246 void updateCameraStatus(CaptureState status);
247
248 /**
249 * Aborts any current jobs and remove all sequence queue jobs.
250 */
251 void clearSequenceQueue();
252
253 // shortcuts
254 void loadSequenceQueue();
255 void saveSequenceQueue();
256 void saveSequenceQueueAs();
257
258 QVariantMap getAllSettings() const;
259 void setAllSettings(const QVariantMap &settings, const QVariantMap *standAloneSettings = nullptr);
260
261 // ////////////////////////////////////////////////////////////////////
262 // Optical Train handling
263 // ////////////////////////////////////////////////////////////////////
264 void setupOpticalTrainManager();
265 void initOpticalTrain();
266 void refreshOpticalTrain(const int id);
267
268
269 QString opticalTrain() const
270 {
271 return opticalTrainCombo->currentText();
272 }
273
274 /**
275 * @brief Select the optical train
276 */
277 void selectOpticalTrain(QString name);
278
279 // Utilities for storing stand-alone variables.
280 void storeTrainKey(const QString &key, const QStringList &list);
281 void storeTrainKeyString(const QString &key, const QString &str);
282
283 // ////////////////////////////////////////////////////////////////////
284 // Filter Manager and filters
285 // ////////////////////////////////////////////////////////////////////
286 void setupFilterManager();
287 void clearFilterManager();
288
289 /**
290 * @brief checkFilter Refreshes the filter wheel information in the capture module.
291 */
292 void refreshFilterSettings();
293
294 const QSharedPointer<FilterManager> &filterManager() const
295 {
296 return m_FilterManager;
297 }
298
299 /**
300 * @brief shortcut for updating the current filter information for the state machine
301 */
302 void updateCurrentFilterPosition();
303
304 /**
305 * @brief Add new Filter Wheel
306 * @param name device name of the new filter wheel
307 */
308 void setFilterWheel(QString name);
309
310 // ////////////////////////////////////////////////////////////////////
311 // Devices and process engine
312 // ////////////////////////////////////////////////////////////////////
313
314 /**
315 * @brief activeJob Shortcut to device adapter
316 */
317 QSharedPointer<CaptureDeviceAdaptor> devices()
318 {
319 return m_DeviceAdaptor;
320 }
321
322 QSharedPointer<CameraProcess> process()
323 {
324 return m_cameraProcess;
325 }
326
327 // shortcut for the module state
328 QSharedPointer<CameraState> state() const
329 {
330 return m_cameraState;
331 }
332
333 // shortcut for the active job
334 const QSharedPointer<SequenceJob> &activeJob()
335 {
336 return state()->getActiveJob();
337 }
338
339 // Shortcut to the active camera held in the device adaptor
340 ISD::Camera *activeCamera();
341
342 /**
343 * @brief currentScope Retrieve the scope parameters from the optical train.
344 */
345 QJsonObject currentScope();
346
347 /**
348 * @brief currentReducer Retrieve the reducer parameters from the optical train.
349 */
350 double currentReducer();
351
352 /**
353 * @brief currentAperture Determine the current aperture
354 * @return
355 */
356 double currentAperture();
357
358 void setForceTemperature(bool enabled)
359 {
360 cameraTemperatureS->setChecked(enabled);
361 }
362
363 // Propagate meridian flip state changes to the UI
364 void updateMeridianFlipStage(MeridianFlipState::MFStage stage);
365
366 // ////////////////////////////////////////////////////////////////////
367 // sub dialogs
368 // ////////////////////////////////////////////////////////////////////
369
370 void openExposureCalculatorDialog();
371
372 // Script Manager
373 void handleScriptsManager();
374
375 /**
376 * @brief showTemperatureRegulation Toggle temperature regulation dialog which sets temperature ramp and threshold
377 */
378 void showTemperatureRegulation();
379
380 void createDSLRDialog();
381
382 // Observer
383 void showObserverDialog();
384
385 // ////////////////////////////////////////////////////////////////////
386 // Standalone editor
387 // ////////////////////////////////////////////////////////////////////
388 /**
389 * Gets called when the stand-alone editor gets a show event.
390 * Do this initialization here so that if the live capture module was
391 * used after startup, it will have set more recent remembered values.
392 */
393 void onStandAloneShow(QShowEvent* event);
394
395 bool m_standAlone {false};
396 void setStandAloneGain(double value);
397 void setStandAloneOffset(double value);
398
399 CustomProperties *customPropertiesDialog() const
400 {
401 return m_customPropertiesDialog.get();
402 }
403
404
405 // ////////////////////////////////////////////////////////////////////
406 // Access to properties
407 // ////////////////////////////////////////////////////////////////////
408
409 /**
410 * @brief Set the observer name.
411 */
412 void setObserverName(const QString &value)
413 {
414 state()->setObserverName(value);
415 };
416
417 QString getObserverName()
418 {
419 return state()->observerName();
420 }
421
422 QVariantMap &settings()
423 {
424 return m_settings;
425 }
426 void setSettings(const QVariantMap &newSettings)
427 {
428 m_settings = newSettings;
429 }
430
431 int cameraId() const
432 {
433 return m_cameraId;
434 }
435
436signals:
437 // communication with other modules
438 void ready();
439 void requestAction(int cameraID, CaptureWorkflowActionType action);
440 void refreshCamera(uint id, bool isValid);
441 void newExposureProgress(const QSharedPointer<SequenceJob> &job, const QString &trainname);
442 void newDownloadProgress(double, const QString &trainname);
443 void newImage(const QSharedPointer<SequenceJob> &job, const QSharedPointer<FITSData> &data, const QString &trainname);
444 void captureTarget(QString targetName);
445 void captureComplete(const QVariantMap &metadata, const QString &trainname);
446 void resetNonGuidedDither();
447 void runAutoFocus(AutofocusReason autofocusReason, const QString &reasonInfo, const QString &trainname);
448 void resetFocusFrame(const QString &trainname);
449 void abortFocus(const QString &trainname);
450 void adaptiveFocus(const QString &trainname);
451 void settingsUpdated(const QVariantMap &settings);
452 void sequenceChanged(const QJsonArray &sequence);
453 void newLocalPreview(const QString &preview);
454 void dslrInfoRequested(const QString &cameraName);
455 void filterManagerUpdated(ISD::FilterWheel *device);
456 void newFilterStatus(FilterState state);
457 void trainChanged();
458 void newLog(const QString &text);
459
460 // Signals for the Analyze tab.
461 void captureStarting(double exposureSeconds, const QString &filter);
462 void captureAborted(double exposureSeconds);
463
464 // communication with other modules
465 void checkFocus(double, const QString &trainname);
466 void meridianFlipStarted(const QString &trainname);
467 void guideAfterMeridianFlip();
468 void newStatus(CaptureState status, const QString &devicename, int cameraID);
469 void suspendGuiding();
470 void resumeGuiding();
471 void driverTimedout(const QString &deviceName);
472
473private slots:
474 // ////////////////////////////////////////////////////////////////////
475 // slots handling device and module events
476 // ////////////////////////////////////////////////////////////////////
477
478 void setVideoStreamEnabled(bool enabled);
479
480 // Cooler
481 void setCoolerToggled(bool enabled);
482
483 // Filter
484 void setFilterStatus(FilterState filterState);
485
486 // Jobs
487 void resetJobs();
488 bool selectJob(QModelIndex i);
489 void editJob(QModelIndex i);
490 void resetJobEdit(bool cancelled = false);
491
492private:
493
494 /**
495 * @brief initCamera Initialize all camera settings
496 */
497 void initCamera();
498 // ////////////////////////////////////////////////////////////////////
499 // Device updates
500 // ////////////////////////////////////////////////////////////////////
501 // Rotator
502 void updateRotatorAngle(double value);
503 void setRotatorReversed(bool toggled);
504
505 /**
506 * @brief updateCCDTemperature Update CCD temperature in capture module.
507 * @param value Temperature in celcius.
508 */
509 void updateCCDTemperature(double value);
510
511 // Auto Focus
512 /**
513 * @brief setFocusStatus Forward the new focus state to the capture module state machine
514 */
515 void setFocusStatus(FocusState newstate);
516
517 /**
518 * @brief updateFocusStatus Handle new focus state
519 */
520 void updateFocusStatus(FocusState newstate);
521
522 // Adaptive Focus
523 /**
524 * @brief focusAdaptiveComplete Forward the new focus state to the capture module state machine
525 */
526 void focusAdaptiveComplete(bool success)
527 {
528 // directly forward it to the state machine
529 state()->updateAdaptiveFocusState(success);
530 }
531
532 /**
533 * @brief New camera selected
534 * @param isValid is the selected camera valid.
535 */
536 void updateCamera(bool isValid);
537
538 /**
539 * @brief checkCamera Refreshes the CCD information in the capture module.
540 */
541 void refreshCameraSettings();
542
543 /**
544 * @brief processCCDNumber Process number properties arriving from CCD. Currently, only CCD and Guider frames are processed.
545 * @param nvp pointer to number property.
546 */
547 void processCameraNumber(INDI::Property prop);
548
549 /**
550 * @brief Slot receiving the update of the current target distance.
551 * @param targetDiff distance to the target in arcseconds.
552 */
553 void updateTargetDistance(double targetDiff);
554
555 // ////////////////////////////////////////////////////////////////////
556 // Capture actions
557 // ////////////////////////////////////////////////////////////////////
558 /**
559 * @brief captureStarted Change the UI after the capturing process
560 * has been started.
561 */
562 void jobStarting();
563
564 /**
565 * @brief addJob Add a new job to the UI. This is used when a job is loaded from a capture sequence file. In
566 * contrast to {@see #createJob()}, the job's attributes are taken from the file and only the UI gehts updated.
567 */
568 void addJob(const QSharedPointer<SequenceJob> &job);
569
570 /**
571 * @brief jobEditFinished Editing of an existing job finished, update its
572 * attributes from the UI settings. The job under edit is taken from the
573 * selection in the job table.
574 * @return true if job updated succeeded.
575 */
576 Q_INVOKABLE void editJobFinished();
577
578 /**
579 * @brief imageCapturingCompleted Capturing a single frame completed
580 */
581 Q_INVOKABLE void imageCapturingCompleted();
582
583 /**
584 * @brief captureStopped Capturing has stopped
585 */
586 Q_INVOKABLE void captureStopped();
587
588 /**
589 * @brief processFITSfinished processing new FITS data received from camera finished.
590 * @param success true iff processing was successful
591 */
592 Q_INVOKABLE void processingFITSfinished(bool success);
593
594 /**
595 * @brief captureRunning Manage the result when capturing has been started
596 */
597 Q_INVOKABLE void captureRunning();
598
599 /**
600 * @brief captureImageStarted Image capturing for the active job has started.
601 */
602 Q_INVOKABLE void captureImageStarted();
603
604 /**
605 * @brief jobPreparationStarted Preparation actions for the current active job have beenstarted.
606 */
607 Q_INVOKABLE void jobExecutionPreparationStarted();
608
609 /**
610 * @brief jobPrepared Select the job that is currently in preparation.
611 */
612 void jobPrepared(const QSharedPointer<SequenceJob> &job);
613
614 /**
615 * @brief Set the name of the target to be captured.
616 */
617 void setTargetName(const QString &newTargetName);
618
619 // ////////////////////////////////////////////////////////////////////
620 // UI controls
621 // ////////////////////////////////////////////////////////////////////
622 void checkFrameType(int index);
623
624 /**
625 * @brief updateStartButtons Update the start and the pause button to new states of capturing
626 * @param start start capturing
627 * @param pause pause capturing
628 */
629 void updateStartButtons(bool start, bool pause = false);
630
631 void setBusy(bool enable);
632
633 /**
634 * @brief Listen to device property changes (temperature, rotator) that are triggered by
635 * SequenceJob.
636 */
637 void updatePrepareState(CaptureState prepareState);
638
639 /**
640 * @brief updateJobTable Update the table row values for the given sequence job. If the job
641 * is null, all rows will be updated
642 * @param job as identifier for the row
643 * @param full if false, then only the status and the counter will be updated.
644 */
645 void updateJobTable(const QSharedPointer<SequenceJob> &job, bool full = false);
646
647 /**
648 * @brief updateJobFromUI Update all job attributes from the UI settings.
649 */
650 void updateJobFromUI(const QSharedPointer<SequenceJob> &job, FilenamePreviewType filenamePreview = FILENAME_NOT_PREVIEW);
651
652 /**
653 * @brief syncGUIToJob Update UI to job settings
654 */
655 void syncGUIToJob(const QSharedPointer<SequenceJob> &job);
656
657 void syncCameraInfo();
658
659 // create a new row in the job table and fill it with the given job's values
660 void createNewJobTableRow(const QSharedPointer<SequenceJob> &job);
661
662 /**
663 * @brief Update the style of the job's row, depending on the job's state
664 */
665 void updateRowStyle(const QSharedPointer<SequenceJob> &job);
666
667 /**
668 * @brief updateCellStyle Update the cell's style. If active is true, set a bold and italic font and
669 * a regular font otherwise.
670 */
671 void updateCellStyle(QTableWidgetItem *cell, bool active);
672
673 /**
674 * @brief syncControl Sync setting to widget. The value depends on the widget type.
675 * @param settings Map of all settings
676 * @param key name of widget to sync
677 * @param widget pointer of widget to set
678 * @return True if sync successful, false otherwise
679 */
680 bool syncControl(const QVariantMap &settings, const QString &key, QWidget * widget);
681
682 /**
683 * @brief moveJobUp Move the job in the sequence queue one place up or down.
684 */
685 void moveJob(bool up);
686
687
688 void removeJobFromQueue();
689
690 void saveFITSDirectory();
691
692 /**
693 * @brief updateCaptureFormats Update encoding and transfer formats
694 */
695 void updateCaptureFormats();
696
697 /**
698 * @brief updateHFRCheckAlgo Update the in-sequence HFR check algorithm
699 */
700 void updateHFRCheckAlgo();
701
702 /**
703 * Clear in-sequence focus settings. It sets the autofocus HFR to zero so that next autofocus value is remembered for the in-sequence focusing.
704 */
705 void clearAutoFocusHFR();
706
707 // selection of a job
708 void selectedJobChanged(QModelIndex current, QModelIndex previous);
709
710 // Clear Camera Configuration
711 void clearCameraConfiguration();
712
713 // Change filter name in INDI
714 void editFilterName();
715 bool editFilterNameInternal(const QStringList &labels, QStringList &newLabels);
716
717 void updateVideoDurationUnit();
718
719 // ////////////////////////////////////////////////////////////////////
720 // Settings
721 // ////////////////////////////////////////////////////////////////////
722 /**
723 * @brief loadSettings Load setting from Options and set them accordingly.
724 */
725 void loadGlobalSettings();
726
727 /**
728 * @brief syncLimitSettings Update Limits UI from Options
729 */
730 void syncLimitSettings();
731
732 /**
733 * @brief settleSettings Run this function after timeout from debounce timer to update database
734 * and emit settingsChanged signal. This is required so we don't overload output.
735 */
736 void settleSettings();
737
738 /**
739 * @brief syncSettings When checkboxes, comboboxes, or spin boxes are updated, save their values in the
740 * global and per-train settings.
741 */
742 void syncSettings();
743
744 /**
745 * @brief Connect GUI elements to sync settings once updated.
746 */
747 void connectSyncSettings();
748 /**
749 * @brief Stop updating settings when GUI elements are updated.
750 */
751 void disconnectSyncSettings();
752
753 // ////////////////////////////////////////////////////////////////////
754 // helper functions
755 // ////////////////////////////////////////////////////////////////////
756 // object initializstion
757 void init();
758 // camera device name
759 QString getCameraName()
760 {
761 return activeCamera() == nullptr ? "" : activeCamera()->getDeviceName();
762 }
763
764 // check if the upload paths are filled correctly
765 bool checkUploadPaths(FilenamePreviewType filenamePreview, const QSharedPointer<SequenceJob> &job);
766
767 // Create a Json job from the current job table row
768 QJsonObject createJsonJob(const QSharedPointer<SequenceJob> &job, int currentRow);
769
770 /**
771 * @return Returns true if an ongoing capture is a preview capture.
772 */
773 bool isActiveJobPreview()
774 {
775 return state() && state()->isActiveJobPreview();
776 }
777
778 // Filename preview
779 void generatePreviewFilename();
780 QString previewFilename(FilenamePreviewType previewType = FILENAME_LOCAL_PREVIEW);
781
782 // Updating the upload mode
783 void selectUploadMode(int index);
784 void checkUploadMode(int index);
785
786 /**
787 * @brief updateJobTableCountCell Update the job counter in the job table of a sigle job
788 */
789 void updateJobTableCountCell(const QSharedPointer<SequenceJob> &job, QTableWidgetItem *countCell);
790
791 void cullToDSLRLimits();
792
793 void resetFrameToZero();
794
795 // reset = 0 --> Do not reset
796 // reset = 1 --> Full reset
797 // reset = 2 --> Only update limits if needed
798 void updateFrameProperties(int reset = 0);
799
800 // ////////////////////////////////////////////////////////////////////
801 // Sub dialogs
802 // ////////////////////////////////////////////////////////////////////
803 QSharedPointer<FilterManager> m_FilterManager;
804 std::unique_ptr<Ui::Limits> m_LimitsUI;
805 QPointer<QDialog> m_LimitsDialog;
806 std::unique_ptr<Ui::Calibration> m_CalibrationUI;
807 QPointer<QDialog> m_CalibrationDialog;
808 QPointer<ScriptsManager> m_scriptsManager;
809 QSharedPointer<RotatorSettings> m_RotatorControlPanel;
810 std::unique_ptr<DSLRInfo> m_DSLRInfoDialog;
811
812 // ////////////////////////////////////////////////////////////////////
813 // Module logging
814 // ////////////////////////////////////////////////////////////////////
815 void appendLogText(const QString &text)
816 {
817 emit newLog(QString("[%1] ").arg(getCameraName()) + text);
818 }
819
820 // ////////////////////////////////////////////////////////////////////
821 // Attributes
822 // ////////////////////////////////////////////////////////////////////
823 int m_cameraId;
824 QVariantMap m_settings;
825 QVariantMap m_GlobalSettings;
826 std::unique_ptr<CustomProperties> m_customPropertiesDialog;
827 QTimer m_DebounceTimer;
828
829 bool m_standAloneUseCcdGain { true};
830 bool m_standAloneUseCcdOffset { true};
831 bool m_JobUnderEdit { false };
832
833 QUrl m_dirPath;
834
835 QSharedPointer<CaptureDeviceAdaptor> m_DeviceAdaptor;
836 QSharedPointer<CameraProcess> m_cameraProcess;
837 QSharedPointer<CameraState> m_cameraState;
838
839 // Controls
840 double GainSpinSpecialValue { INVALID_VALUE };
841 double OffsetSpinSpecialValue { INVALID_VALUE };
842};
843} // namespace Ekos
The CameraProcess class holds the entire business logic to control capturing execution.
Captures single or sequence of images from a CCD.
Definition capture.h:94
Ekos is an advanced Astrophotography tool for Linux.
Definition align.cpp:83
CaptureState
Capture states.
Definition ekos.h:92
@ CAPTURE_SUSPENDED
Definition ekos.h:98
@ CAPTURE_ABORTED
Definition ekos.h:99
@ CAPTURE_IDLE
Definition ekos.h:93
Q_INVOKABLEQ_INVOKABLE
Q_OBJECTQ_OBJECT
virtual bool event(QEvent *e)
QObject * parent() const const
QWidget(QWidget *parent, Qt::WindowFlags f)
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Mar 28 2025 11:57:24 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.