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 
20 namespace Ekos
21 {
22 
23 ManualRotator::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);
30  connect(cancelB, &QPushButton::clicked, this, &QDialog::reject);
31 
32 }
33 
34 ManualRotator::~ManualRotator()
35 {
36 
37 }
38 
39 void 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 number(int n, int base)
virtual void reject()
Ekos is an advanced Astrophotography tool for Linux. It is based on a modular extensible framework to...
Definition: align.cpp:66
void clicked(bool checked)
QIcon fromTheme(const QString &name)
QString i18n(const char *text, const TYPE &arg...)
QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Fri Aug 19 2022 03:57:52 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.