Kstars

capturestatuswidget.cpp
1 /* Progress and status of capture preparation and execution
2  SPDX-FileCopyrightText: Wolfgang Reissenberger <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #include "capturestatuswidget.h"
8 
9 namespace Ekos
10 {
11 CaptureStatusWidget::CaptureStatusWidget(QWidget * parent) : QWidget(parent)
12 {
13  setupUi(this);
14 
15  statusLed = new KLed(Qt::gray, KLed::On, KLed::Flat, KLed::Circular, this);
16  statusLed->setObjectName("statusLed");
17  statusLayout->insertWidget(-1, statusLed, 0, Qt::AlignVCenter);
18 
19  statusText->setText(i18n("Idle"));
20 }
21 
22 void CaptureStatusWidget::setCaptureState(CaptureState status)
23 {
24  switch (status)
25  {
26  case CAPTURE_IDLE:
27  setStatus(i18n("Idle"), Qt::gray);
28  break;
29  case CAPTURE_PAUSED:
30  setStatus(i18n("Paused"), Qt::gray);
31  break;
32  case CAPTURE_SUSPENDED:
33  setStatus(i18n("Suspended"), Qt::gray);
34  break;
35  case CAPTURE_COMPLETE:
36  setStatus(i18n("Completed"), Qt::gray);
37  break;
38 
39  case CAPTURE_PROGRESS:
40  setStatus(i18n("Preparing..."), Qt::yellow);
41  break;
42  case CAPTURE_WAITING:
43  setStatus(i18n("Waiting..."), Qt::yellow);
44  break;
45  case CAPTURE_DITHERING:
46  setStatus(i18n("Dithering..."), Qt::yellow);
47  break;
48  case CAPTURE_FOCUSING:
49  setStatus(i18n("Focusing..."), Qt::yellow);
50  break;
52  setStatus(i18n("Filter change..."), Qt::yellow);
53  break;
55  setStatus(i18n("Filter change..."), Qt::yellow);
56  break;
57  case CAPTURE_ALIGNING:
58  setStatus(i18n("Aligning..."), Qt::yellow);
59  break;
61  setStatus(i18n("Calibrating..."), Qt::yellow);
62  break;
64  setStatus(i18n("Meridian flip..."), Qt::yellow);
65  break;
66 
67  case CAPTURE_CAPTURING:
68  setStatus(i18n("Capturing"), Qt::darkGreen);
69  break;
71  setStatus(i18n("Image received."), Qt::darkGreen);
72  break;
74  setStatus(i18n("Pause planned..."), Qt::darkGreen);
75  break;
76 
77  case CAPTURE_ABORTED:
78  setStatus(i18n("Aborted"), Qt::darkRed);
79  break;
80 
84  // do nothing here, set from {@see Capture::updatePrepareState()}
85  break;
86  }
87 }
88 
89 void CaptureStatusWidget::setFilterState(FilterState status)
90 {
91  switch (status)
92  {
93  case FILTER_CHANGE:
94  case FILTER_OFFSET:
95  case FILTER_AUTOFOCUS:
96  setStatus(Ekos::getFilterStatusString(status), Qt::yellow);
97  break;
98  case FILTER_IDLE:
99  if (lastFilterState == FILTER_CHANGE)
100  setStatus(i18n("Filter selected."), Qt::darkGreen);
101  break;
102  default:
103  // do nothing
104  break;
105  }
106  // remember the current status
107  lastFilterState = status;
108 }
109 
110 void CaptureStatusWidget::setStatus(QString text, Qt::GlobalColor color)
111 {
112  statusText->setText(text);
113  statusLed->setColor(color);
114 }
115 
116 }
@ CAPTURE_COMPLETE
Definition: ekos.h:112
AlignVCenter
@ CAPTURE_FOCUSING
Definition: ekos.h:103
@ CAPTURE_CALIBRATING
Definition: ekos.h:110
Ekos is an advanced Astrophotography tool for Linux. It is based on a modular extensible framework to...
Definition: align.cpp:70
@ CAPTURE_CAPTURING
Definition: ekos.h:95
@ CAPTURE_SETTING_ROTATOR
Definition: ekos.h:108
@ CAPTURE_PROGRESS
Definition: ekos.h:94
@ CAPTURE_SETTING_TEMPERATURE
Definition: ekos.h:107
QString i18n(const char *text, const TYPE &arg...)
NETWORKMANAGERQT_EXPORT NetworkManager::Status status()
@ CAPTURE_IDLE
Definition: ekos.h:93
@ CAPTURE_ABORTED
Definition: ekos.h:99
@ CAPTURE_DITHERING
Definition: ekos.h:102
@ CAPTURE_FILTER_FOCUS
Definition: ekos.h:104
@ CAPTURE_WAITING
Definition: ekos.h:100
@ CAPTURE_PAUSED
Definition: ekos.h:97
@ CAPTURE_SUSPENDED
Definition: ekos.h:98
@ CAPTURE_CHANGING_FILTER
Definition: ekos.h:105
@ CAPTURE_PAUSE_PLANNED
Definition: ekos.h:96
@ CAPTURE_IMAGE_RECEIVED
Definition: ekos.h:101
@ CAPTURE_MERIDIAN_FLIP
Definition: ekos.h:111
@ CAPTURE_GUIDER_DRIFT
Definition: ekos.h:106
@ CAPTURE_ALIGNING
Definition: ekos.h:109
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Fri Aug 12 2022 04:00:53 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.