File indexing completed on 2024-04-28 03:43:14
0001 /* 0002 SPDX-FileCopyrightText: 2012 Jasem Mutlaq <mutlaqja@ikarustech.com> 0003 SPDX-FileCopyrightText: 2021 Wolfgang Reissenberger <sterne-jaeger@openfuture.de> 0004 0005 SPDX-License-Identifier: GPL-2.0-or-later 0006 */ 0007 0008 #pragma once 0009 0010 #include <QObject> 0011 #include <QWidget> 0012 #include <QTime> 0013 0014 #include "ui_capturecountswidget.h" 0015 #include "ekos/ekos.h" 0016 0017 namespace Ekos 0018 { 0019 class Capture; 0020 class SequenceJob; 0021 class Scheduler; 0022 } 0023 0024 class CaptureCountsWidget : public QWidget, public Ui::CaptureCountsWidget 0025 { 0026 Q_OBJECT 0027 public: 0028 friend class CapturePreviewWidget; 0029 0030 explicit CaptureCountsWidget(QWidget *parent = nullptr); 0031 0032 public slots: 0033 0034 /** 0035 * @brief display the progress of the current exposure (remaining time etc.) 0036 * @param job currently active job 0037 */ 0038 void updateExposureProgress(Ekos::SequenceJob *job); 0039 0040 /** 0041 * @brief display the download progress 0042 * @param timeLeft time left until the download is finished 0043 */ 0044 void updateDownloadProgress(double timeLeft); 0045 0046 0047 private: 0048 void shareCaptureProcess(Ekos::Capture *process) {captureProcess = process;} 0049 void shareSchedulerProcess(Ekos::Scheduler *process) {schedulerProcess = process;} 0050 0051 /** 0052 * @brief update the count down value of the current exposure 0053 * @param delta time difference 0054 */ 0055 void updateCaptureCountDown(int delta); 0056 0057 /** 0058 * @brief update display when the capture status changes 0059 * @param status current capture status 0060 */ 0061 void updateCaptureStatus(Ekos::CaptureState status); 0062 0063 /** 0064 * @brief display information about the currently running job 0065 * @param currently active job 0066 */ 0067 void updateJobProgress(Ekos::SequenceJob *job); 0068 0069 /** 0070 * @brief enable / disable display widgets 0071 */ 0072 void setEnabled(bool enabled); 0073 0074 /** 0075 * @brief reset display values 0076 */ 0077 void reset(); 0078 0079 // informations about the current frame 0080 void setFrameInfo(const QString frametype, const QString filter = "", const double exptime = -1, const int xBin = -1, const int yBin = -1, const double gain = -1); 0081 0082 0083 Ekos::Scheduler *schedulerProcess = nullptr; 0084 Ekos::Capture *captureProcess = nullptr; 0085 0086 QTime imageCountDown; 0087 QTime sequenceCountDown; 0088 QTime jobCountDown; 0089 QTime overallCountDown; 0090 };