Kstars

manualrotator.cpp
1/* Ekos Alignment Manual Rotator
2 SPDX-FileCopyrightText: 2021 Rick Bassham
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7
8#include "manualrotator.h"
9
10#include "align.h"
11#include "ksnotification.h"
12#include "ksmessagebox.h"
13
14// Options
15#include "Options.h"
16
17#include <QIcon>
18#include <ekos_align_debug.h>
19
20namespace Ekos
21{
22
23ManualRotator::ManualRotator(Align *parent) : QDialog(parent)
24{
25 setupUi(this);
26
27 m_AlignInstance = parent;
28 //setWindowFlags(Qt::WindowStaysOnTopHint);
29 connect(takeImageB, &QPushButton::clicked, this, &Ekos::ManualRotator::captureAndSolve);
31
32}
33
34ManualRotator::~ManualRotator()
35{
36
37}
38
39void ManualRotator::setRotatorDiff(double current, double target, double diff)
40{
41 double threshold = Options::astrometryRotatorThreshold() / 60.0;
42 QString iconName;
43
44 if (std::abs(diff) < threshold)
45 {
46 iconName = "checkmark";
47 diffLabel->setText(i18n("Done"));
48 }
49 else
50 {
51 diffLabel->setText(i18n("%1°", QString::number(diff, 'f', 1)));
52 iconName = (diff < 0.0) ? "object-rotate-left" : "object-rotate-right";
53 }
54
55 icon->setPixmap(QIcon::fromTheme(iconName).pixmap(300, 300));
56 targetRotation->setText(i18n("%1°", QString::number(target, 'f', 1)));
57 currentRotation->setText(i18n("%1°", QString::number(current, 'f', 1)));
58}
59
60}
QString i18n(const char *text, const TYPE &arg...)
Ekos is an advanced Astrophotography tool for Linux.
Definition align.cpp:83
void clicked(bool checked)
virtual void reject()
QIcon fromTheme(const QString &name)
QString number(double n, char format, int precision)
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 Sat Dec 21 2024 17:04:45 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.