Kstars

focusmanager.cpp
1/*
2 SPDX-FileCopyrightText: 2012 Jasem Mutlaq <mutlaqja@ikartech.com>
3 SPDX-FileCopyrightText: 2021 Wolfgang Reissenberger <sterne-jaeger@openfuture.de>
4
5 SPDX-License-Identifier: GPL-2.0-or-later
6*/
7
8#include "focusmanager.h"
9#include "kstarsdata.h"
10#include "Options.h"
11
12namespace Ekos
13{
14FocusManager::FocusManager(QWidget * parent) : QWidget(parent)
15{
16 setupUi(this);
17}
18
19void FocusManager::updateCurrentHFR(double newHFR)
20{
21 currentHFR->setText(QString("%1").arg(newHFR, 0, 'f', 2) + " px");
22 profilePlot->drawProfilePlot(newHFR);
23}
24
25void FocusManager::updateFocusDetailView()
26{
27 const int pos = focusDetailView->currentIndex();
28 if (pos == 1 && focusStarPixmap.get() != nullptr)
29 {
30 focusStarView->setPixmap(focusStarPixmap.get()->scaled(focusDetailView->width(), focusDetailView->height(),
32 }
33}
34
35void FocusManager::updateFocusStarPixmap(QPixmap &starPixmap)
36{
37 if (starPixmap.isNull())
38 return;
39
40 focusStarPixmap.reset(new QPixmap(starPixmap));
41 updateFocusDetailView();
42}
43
44void FocusManager::updateFocusStatus(Ekos::FocusState status)
45{
46 focusStatus->setFocusState(status);
47}
48
49void FocusManager::init()
50{
51
52 // focus details buttons
54 {
55 const int pos = focusDetailView->currentIndex();
56 if (pos == 0 || (pos == 1 && focusStarPixmap.get() != nullptr))
57 focusDetailView->setCurrentIndex(pos + 1);
58 else if (pos > 0)
59 focusDetailView->setCurrentIndex(0);
60 updateFocusDetailView();
61 });
63 {
64 const int pos = focusDetailView->currentIndex();
65 if (pos == 0 && focusStarPixmap.get() != nullptr)
66 focusDetailView->setCurrentIndex(pos + 2);
67 else if (pos == 0)
68 focusDetailView->setCurrentIndex(pos + 1);
69 else if (pos > 0)
70 focusDetailView->setCurrentIndex(pos - 1);
71 updateFocusDetailView();
72 });
73}
74
75void FocusManager::reset()
76{
77 focusStatus->setFocusState(FOCUS_IDLE);
78}
79
80} // namespace Ekos
Ekos is an advanced Astrophotography tool for Linux.
Definition align.cpp:78
void clicked(bool checked)
KeepAspectRatio
SmoothTransformation
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:19:03 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.