Kstars

capturecountswidget.h
1/*
2 SPDX-FileCopyrightText: 2012 Jasem Mutlaq <mutlaqja@ikarustech.com>
3 SPDX-FileCopyrightText: 2021 Wolfgang Reissenberger <sterne-jaeger@openfuture.de>
4
5 SPDX-License-Identifier: GPL-2.0-or-later
6*/
7
8#pragma once
9
10#include <QObject>
11#include <QWidget>
12#include <QTime>
13
14#include "ui_capturecountswidget.h"
15#include "captureprocessoverlay.h"
16#include "ekos/ekos.h"
17
18namespace Ekos
19{
20class Capture;
21class SequenceJob;
22class SchedulerModuleState;
23}
24
25class CaptureCountsWidget : public QWidget, public Ui::CaptureCountsWidget
26{
28public:
29 friend class CapturePreviewWidget;
30
31 typedef struct CaptureCountsStruct
32 {
33 int count { -1 }; /* total frames count */
34 int completed { -1 }; /* captured frames count */
35 double remainingTime { -1 }; /* remaining time to complete (in seconds) */
36 double totalTime { -1 }; /* total exposure time (in seconds) */
37 QTime countDown; /* timer for countdown to completion */
38 bool changed { true }; /* flag if some value has changed */
39 } CaptureCounts;
40
41 explicit CaptureCountsWidget(QWidget *parent = nullptr);
42
43 void setCurrentTrainName(const QString &name);
44
45public slots:
46
47 /**
48 * @brief display the progress of the current exposure (remaining time etc.)
49 * @param job currently active job
50 * @param trainname train name of the camera reporting exposure process
51 */
52 void updateExposureProgress(const QSharedPointer<Ekos::SequenceJob> &job, const QString &trainname);
53
54 /**
55 * @brief display the download progress
56 * @param timeLeft time left until the download is finished
57 */
58 void updateDownloadProgress(double timeLeft, const QString &devicename);
59
60
61private:
62 void shareCaptureProcess(Ekos::Capture *process) {m_captureProcess = process;}
63 void shareSchedulerState(QSharedPointer<Ekos::SchedulerModuleState> state);
64
65 /**
66 * @brief update the count down value of the current exposure
67 * @param delta time difference
68 */
69 void updateCaptureCountDown(int delta);
70
71 /**
72 * @brief update display when the capture status changes
73 */
74 void updateCaptureStatus(Ekos::CaptureState status, bool isPreview, const QString &devicename);
75
76 /**
77 * @brief display information about the currently running job
78 * @param job currently active job
79 * @param devicename name of the used camera device
80 */
81 void updateJobProgress(CaptureProcessOverlay::FrameData data, const QString &devicename);
82
83 /**
84 * @brief enable / disable display widgets
85 */
86 void setEnabled(bool enabled);
87
88 /**
89 * @brief reset display values
90 */
91 void reset();
92
93 // informations about the current frame
94 void setFrameInfo(const QString frametype, const QString filter = "", const double exptime = -1, const int xBin = -1, const int yBin = -1, const double gain = -1);
95
96 /**
97 * @brief showCurrentCameraInfo Display the capturing status informations for the selected camera device
98 */
99 void showCurrentCameraInfo();
100 /**
101 * @brief refreshCaptureCounters Refresh the display of the counters for sequence, job and overall
102 */
103 void refreshCaptureCounters(const QString &trainname);
104
105 /**
106 * @brief captureState Retrieve the currently known capture state of a given optical train
107 */
108 Ekos::CaptureState captureState(const QString &trainname);
109
110 /**
111 * @brief isCaptureActive Check if the given optical train is currently capturing
112 */
113 bool isCaptureActive(const QString &trainname);
114
115 QSharedPointer<Ekos::SchedulerModuleState> m_schedulerModuleState;
116 Ekos::Capture *m_captureProcess = nullptr;
117
118 // current camera train name
119 QString m_currentTrainName = "";
120 // is a capture preview active=
121 bool m_isPreview = false;
122 // capture counters
123 QMap<QString, CaptureCounts> imageCounts;
124 QMap<QString, CaptureCounts> sequenceCounts;
125 QMap<QString, CaptureCounts> jobCounts;
126 QMap<QString, CaptureCounts> totalCounts;
127 // capture status per train
128 QMap<QString, Ekos::CaptureState> captureStates;
129 // refresh display of counts
130 void refreshImageCounts(const QString &trainname);
131
132 // cache frame data
133 QMap<QString, CaptureProcessOverlay::FrameData> m_currentFrame;
134};
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
Q_OBJECTQ_OBJECT
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 Apr 25 2025 11:58:34 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.